POST /v1/query
Search across all indexed sources in your knowledge base and return the most relevant content chunks. You can control the number of results, the search strategy, and optionally restrict the search to a specific subset of sources.Request Body
string
required
The search query. Write queries in natural language for semantic or hybrid searches, or use keywords and phrases for keyword searches.
integer
default:"5"
The maximum number of results to return. Minimum
1, maximum 20.string
default:"hybrid"
The search strategy to use. One of
semantic, keyword, or hybrid. See Choosing a Search Type below for guidance on which to use.array
An optional array of source IDs to restrict the search to specific content sources. When omitted, the query runs across all indexed sources. For example:
["src_abc123", "src_def456"].number
An optional minimum relevance score threshold between
0.0 and 1.0. Results with a score below this value are excluded from the response. Use this to filter out low-quality matches. A value of 0.7 or higher returns only high-confidence results.Example Request
Example Response
Response Fields
array
An array of matching content chunks ordered by relevance score, highest first.
integer
The total number of results returned in this response. This reflects the actual count after any
min_score filtering is applied, and will be less than or equal to the limit you specified.Choosing a Search Type
Select the search strategy that best fits your query patterns and content type.Semantic search
Semantic search
Semantic search converts your query into a vector embedding and finds content chunks that are conceptually similar, even when they use different words. Use semantic search when you expect users to phrase queries in natural language or when synonyms and paraphrasing are common. For example, a semantic search for “cancel my plan” will match content about “subscription termination” even though the exact words differ.
Keyword search
Keyword search
Keyword search performs traditional full-text matching against the indexed content. Use keyword search when precision matters — for example, when searching for specific product names, error codes, or unique identifiers that must appear verbatim in the results.
Hybrid search (recommended)
Hybrid search (recommended)
Hybrid search combines semantic and keyword strategies, merging their result sets and re-ranking by a blended relevance score. This gives you the recall benefits of semantic search alongside the precision of keyword matching, making it the best default choice for most use cases.
Filtering by Source
To restrict a query to specific content sources, pass an array of source IDs in thesource_ids field. This is useful when your knowledge base contains content from multiple teams or products and you want search results to stay within a defined scope.
GET /v1/knowledge-base/sources endpoint.