API ReferenceKnowledge base search
Advanced semantic search
Performs semantic search with advanced options via POST. Allows more complex queries and detailed configuration.
Authorization
ApiKeyAuth AuthorizationBearer <token>
Bearer token for API authentication
In: header
Path Parameters
id*string
Unique ID of the Knowledge Base
Request Body
application/json
query*string
Search query
Length
length <= 1000limit?integer
Maximum number of results
Default
10Range
1 <= value <= 50similarityThreshold?number
Minimum similarity threshold
Default
0.7Range
0 <= value <= 1includeMetadata?boolean
Include metadata in results
Default
trueResponse Body
application/json
curl -X POST "https://app.docutray.com/api/knowledge-bases/string/search" \ -H "Content-Type: application/json" \ -d '{ "query": "How to configure the authentication system?" }'{
"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
Empty
Add document to Knowledge Base POST
Adds a new document to the Knowledge Base with automatic embedding generation.
Semantic search in Knowledge Base GET
Performs semantic search using vector similarity in a specific Knowledge Base. Uses embeddings generated with Gemini API and cosine similarity to find relevant documents.