knowledge.search
The passages that match a question.
Reference
POST/api/v1/knowledge-base/search
- Auth
- API key in
X-API-Key - Content
- application/json
- Returns
- 200 · ChunkSearchResponseSchema
Search for document chunks similar to the query. This endpoint uses vector similarity search to find relevant chunks. Results are returned without threshold filtering - apply similarity thresholds at the application layer after optional reranking. Access Control: * Users can only search documents from their organization.
Arguments
| Argument | In | Type | Required | Description |
|---|---|---|---|---|
query | body | string | required | Search query text |
limit | body | integer | default 5 | Maximum number of results |
document_uuids | body | string[] | optional | Filter by specific document UUIDs |
min_similarity | body | number | optional | Minimum similarity threshold |
Example request
curl -X POST "https://api.decibyl.ai/api/v1/knowledge-base/search" \
-H "X-API-Key: dcb_your_key" \
-H "Content-Type: application/json" \
-d '{"query":"string","limit":5,"document_uuids":["string"],"min_similarity":1.5}'Response
{
"chunks": [
{
"id": 1,
"document_id": 1,
"chunk_text": "string",
"contextualized_text": "string",
"chunk_index": 1,
"chunk_metadata": {},
"filename": "string",
"document_uuid": "string",
"similarity": 1.5
}
],
"query": "string",
"total_results": 1
}Errors
| Status | When |
|---|---|
404 | Not found |
422 | Validation Error |