query_documents
Find relevant content in ingested documents by combining keyword and semantic search, returning ranked results with file paths, scores, and context.
Instructions
Search ingested documents with hybrid keyword + semantic matching. Returns results sorted by relevance, each with filePath, chunkIndex, text, fileTitle, score (0 = best, higher = worse), and source (for ingest_data items).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results (default 10, range 1-20). Lower favors precision, higher recall. | |
| query | Yes | Search query. Preserve specific user terms (for keyword match); add context when the query is vague (for semantic match). | |
| scope | No | Optional absolute path prefix(es) — one string or a list (unioned) — restricting results to a filePath equal to or under a prefix. "/docs/api" matches "/docs/api/auth.md" but not "/docs/apiv2". Must be absolute (server OS style); a relative prefix matches nothing — derive one from a filePath returned by an earlier query, or omit scope. | |
| instance | No | Instance name to search. Use "*" for all instances. Required when multiple instances are configured. | |
| searchMode | No | Search mode preset. "exact" (hybridWeight=0.8) for identifiers and symbols, "code" (0.5) for balanced code understanding, "doc" (0.3) for broad semantic search. Overrides per-instance hybridWeight defaults. | |
| fromTimestamp | No | Optional ISO 8601 timestamp — only return chunks ingested on or after this time. Example: "2026-07-01T00:00:00Z". | |
| untilTimestamp | No | Optional ISO 8601 timestamp — only return chunks ingested on or before this time. Example: "2026-07-10T23:59:59Z". | |
| highlightContext | No | Characters of surrounding context around each query-term match in the returned chunks (default 0 = no highlight). When > 0, results include a "matchContext" array with highlighted snippets. |