API ReferenceKnowledge base search
Semantic search in Knowledge Base
Performs semantic search using vector similarity in a specific Knowledge Base. Uses embeddings generated with Gemini API and cosine similarity to find relevant documents.
Authorization
ApiKeyAuth AuthorizationBearer <token>
Bearer token for API authentication
In: header
Path Parameters
id*string
Unique ID of the Knowledge Base
Query Parameters
query*string
Search query
Length
length <= 1000limit?integer
Maximum number of results
Default
10Range
1 <= value <= 50similarityThreshold?number
Minimum similarity threshold (0-1)
Default
0.7Range
0 <= value <= 1includeMetadata?boolean
Include metadata in results
Default
trueResponse Body
application/json
curl -X GET "https://app.docutray.com/api/knowledge-bases/string/search?query=How+to+configure+the+system%3F"{
"data": [
{
"document": {
"id": "string",
"documentId": "string",
"content": {},
"metadata": {},
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
},
"similarity": 0.8542
}
],
"query": "string",
"resultsCount": 0
}Empty
Empty
Empty
Empty
Empty
Advanced semantic search POST
Performs semantic search with advanced options via POST. Allows more complex queries and detailed configuration.
Manual Knowledge Base synchronization POST
Triggers manual synchronization of a Knowledge Base. Can regenerate embeddings for all documents or sync with external sources.