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, maximum: 50)
Response
Returns a flat array of search results, each containing:
The extracted text content from the matching document
Relevance score (float, higher indicates better match)
Example Request
curl --request GET \
--url 'https://api.xpander.ai/v1/knowledge/<kb-id>/search?search_query=pricing+plans&top_k=5' \
--header 'x-api-key: <your-api-key>'
Example Response
[
{
"content": "The extracted text content from the matching document...",
"score": 81.41
}
]
Notes
- Search only returns results from documents with
status: "completed"
- Pending or failed documents are excluded from search results
- Empty results indicate no matching content in the knowledge base
- Returns 404 if the knowledge base is not found
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