Query knowledge base
POST /knowledge-bases/{knowledgeBaseId}/query
Performs vector similarity search on the knowledge base, returning ranked chunks and community rankings. Uses the embedding model configured for the knowledge base to embed the query.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Unique identifier for the knowledge base to retrieve
Unique identifier for the knowledge base to retrieve
Request Body
Section titled “Request Body ”object
Search query text
Embedding model to use for this query (defaults to KB’s primary model). Must be configured for this KB.
Maximum number of results to return (1-100, default: 100)
MongoDB-style metadata filter (e.g., {“status”: “final”, “version”: {“$gt”: 1}})
object
object
object
Search mode: semantic (vector search), keyword (BM25 full-text), or hybrid (RRF fusion). Default: semantic
Weight for semantic results in hybrid mode (0-1, default: 0.6)
Weight for keyword results in hybrid mode (0-1, default: 0.4)
Responses
Section titled “ Responses ”Query results
object
Chunks ranked by similarity
object
Unique identifier for the chunk
Text content of the chunk
Primary score: cosine distance (semantic), BM25 (keyword), or RRF (hybrid)
Level 0 community ID (finest granularity)
Level 1 community ID
Source file ID (if from file source)
Source dataset table ID (if from table source)
Character offset where chunk starts in source
Character offset where chunk ends in source
Semantic search score (only in semantic/hybrid modes)
Keyword search BM25 score (only in keyword/hybrid modes)
RRF combined score (only in hybrid mode)
Communities ranked by best chunk score
object
Unique identifier for the community
Community hierarchy level (0 = finest, 3 = coarsest)
Best (lowest) chunk score in this community
Number of matching chunks in this community
object
Search mode used
Whether hybrid mode fell back to semantic
Bad Request - Validation error or invalid input
object
Unauthorized - Authentication required or invalid token
object
Forbidden - Insufficient permissions
object
Not Found - Resource does not exist