Perform semantic search across documents in a knowledge base using vector similarity. Returns the most relevant document chunks based on your query.
Path Parameters
Unique identifier of the knowledge base to search (UUID format)
Query Parameters
The search query text to find relevant documents
Number of results to return (default: 5, max: 50)
Whether to use bubble search algorithm for improved relevance (default: false)
Response
Returns an array of search results, each containing:
The text content of the matching document chunk
Similarity score (0-1, higher is more relevant)
UUID of the source document
Additional metadata about the document chunk
Example Request
curl -H "x-api-key: YOUR_API_KEY" \
"https://api.xpander.ai/v1/knowledge/{kb_id}/search?search_query=API%20authentication&top_k=10"
Example Response
[
{
"content": "API authentication is handled via x-api-key header...",
"score": 0.92,
"document_id": "doc-123",
"metadata": {
"source": "api-docs.pdf",
"page": 5
}
},
{
"content": "To authenticate requests, include your API key...",
"score": 0.87,
"document_id": "doc-456",
"metadata": {
"source": "getting-started.md"
}
}
]
API Key for authentication
Query to search in the VDB
use_bubble
boolean | null
default:false
Should use bubble search to return the result capped
bubble_size
integer | null
default:1000
Bubble size (padding + result + margin)
The content of the document