API reference
Search
Three search endpoints return the same ranked result shape: full-text, semantic, and hybrid. Read Search concepts to understand when to use each mode.
Base path
https://api.kognita.ai/api/v1/knowledge-bases/{id}/search/v1/knowledge-bases/{id}/search/full-textFull-text keyword search
/v1/knowledge-bases/{id}/search/semanticVector similarity search
/v1/knowledge-bases/{id}/search/hybridWeighted blend of full-text + semantic
Shared response schema
All three endpoints return the same SearchResponse:
{
"success": true,
"data": [
{
"id": "chunk_001", // chunk ID
"contentChunk": "...", // text of the matching chunk
"score": 0.94 // relevance score, higher = more relevant
}
]
}Full-text search
/api/v1/knowledge-bases/{id}/search/full-textTokenizes the query and matches against a PostgreSQL full-text index. No embedding model call is made, giving it the lowest latency of the three modes.
Path parameters
| Parameter | Type | Description |
|---|---|---|
idrequired | string(path) | Knowledge base ID. |
Request body
| Parameter | Type | Description |
|---|---|---|
queryrequired | string(body) | The search query string. |
limit | integer(body) | Maximum number of results to return. Default: 10. Max: 100. |
metadataFilter | object(body) | Optional key/value pairs to filter results by metadata fields set at ingest time. |
{
"query": "knowledge base API",
"limit": 10,
"metadataFilter": { "source": "docs" }
}Responses
{
"success": true,
"data": [
{ "id": "chunk_001", "contentChunk": "...", "score": 1.2 },
{ "id": "chunk_003", "contentChunk": "...", "score": 0.9 }
]
}Semantic search
/api/v1/knowledge-bases/{id}/search/semanticEmbeds the query using the knowledge base's configured embedding model and returns the nearest neighbors by cosine similarity. Understands synonyms and paraphrases.
Request body
| Parameter | Type | Description |
|---|---|---|
queryrequired | string(body) | The natural language query. |
limit | integer(body) | Maximum results. Default: 10. Max: 100. |
metadataFilter | object(body) | Optional key/value pairs to filter results by metadata fields set at ingest time. |
{
"query": "how do I store knowledge for my AI assistant?",
"limit": 5,
"metadataFilter": { "source": "docs" }
}Responses
{
"success": true,
"data": [
{ "id": "chunk_001", "contentChunk": "...", "score": 0.94 }
]
}Hybrid search
/api/v1/knowledge-bases/{id}/search/hybridCombines full-text and semantic scores with a configurable weight. Recommended as the default for most RAG pipelines.
Request body
| Parameter | Type | Description |
|---|---|---|
queryrequired | string(body) | The search query. |
limit | integer(body) | Maximum results. Default: 10. Max: 100. |
semanticWeight | number [0–1](body) | How much weight to give semantic similarity vs full-text. 0 = full-text only, 1 = semantic only. Default: 0.5. |
metadataFilter | object(body) | Optional key/value pairs to filter results by metadata fields set at ingest time. |
{
"query": "what is a knowledge base?",
"limit": 10,
"semanticWeight": 0.7,
"metadataFilter": { "source": "docs" }
}Choosing semanticWeight
0.0Pure full-text. Best when queries use exact domain terms.0.3Mostly keyword, some semantic boost. Good for product search.0.5Balanced (default). Safe starting point.0.7Mostly semantic. Recommended for natural language Q&A.1.0Pure semantic. Use when you want concept matching only.Responses
{
"success": true,
"data": [
{ "id": "chunk_002", "contentChunk": "...", "score": 0.87 },
{ "id": "chunk_001", "contentChunk": "...", "score": 0.82 }
]
}