Quickstart (5m)
Get started with the topk
search database in under 5 minutes.
This quickstart guide will help you set up and use topk
in less than 5 minutes. You’ll learn how to create a collection, add documents, and perform searches using semantic search, keyword matching, and metadata filtering.
1. Install the SDK
The TopK SDK offers convenient programming interfaces to interact with the TopK API. You can install the SDK using the package managers listed below.
Choose your preferred language to install the SDK:
2. Create an API key
To get started with TopK, you need an API key. Here’s how you can get one for free:
- Head down to the Console.
- Create your account and generate an API key.
You’ll need this key to authenticate with the API. Make sure to keep it safe and secure.
3. Create your first collection
Collections are the primary data structure in TopK. They store documents and allow you to query them.
First, create a Client
instance with your API key and .
Then, create a collection, specifying a schema. The example below creates a books
collection with a semantic index on the title
field.
Note: Other fields can still be upserted even if they are not defined in the schema.
4. Add documents to the collection
After creating a collection, you can start adding documents to it.
A document is a JSON-style dictionary with one condition: it must have an _id
field.
5. Query your collection
Now, send your first semantic search query:
Optionally, you can call .rerank()
at the end of your query to automatically improve relevance of the results. See reranking for more details.
6. (Optional) Clean up
To delete the entire collection:
Need support or want to give some feedback? You can join our community or drop us an email at support@topk.io.
Next steps
Continue exploring the TopK platform:
Was this page helpful?