Knowledgebase
Query Chunks
Search and retrieve relevant chunks from your knowledgebase
GET
Query Chunks
Retrieves relevant chunks from your knowledgebase based on a semantic search query.
Endpoint
Headers
Your project API key for authentication
Query Parameters
The search query to match against the knowledgebase content
Maximum number of results to return. Defaults to 5
Minimum relevance score for chunks to be included. Defaults to 0.3
Example request:
Response
Returns an array of chunks that match the query, ordered by relevance.
Unique identifier for the chunk
The content of the chunk
Length of the chunk content
Example response:
Error Responses
Status Code | Description |
---|---|
400 | Invalid query parameters |
401 | Invalid API key |
404 | Knowledgebase not found |
500 | Internal server error |
How It Works
- The query text is converted into embeddings using the same model as the knowledgebase
- The embeddings are used to perform semantic similarity search against stored chunks
- The most relevant chunks are returned, ordered by similarity score
- Results are limited to the specified topK parameter
Usage Notes
- Queries are processed using semantic search, not exact text matching
- Results are returned in order of relevance to the query
- The response includes the most relevant chunks from across all datasets
- Use the topK parameter to control the number of results returned
- Consider the context when formulating queries for best results