search_documents
Find relevant passages from indexed documents using hybrid, semantic, or keyword search. Returns text chunks with source metadata and relevance scores.
Instructions
Search the indexed document corpus.
Returns the k best-matching text chunks, each with its source metadata: doc_id, chunk_index, title, url, the chunk text, and a relevance score (higher is better; scores are comparable within one response, not across modes). Results may include multiple chunks from the same document. Use fetch_document with a result's doc_id to read the full source document.
Args: query: A natural-language question or search phrase. k: How many chunks to return (default 5, max 25). mode: 'hybrid' (default) fuses semantic and keyword search — best for most questions. 'vector' is semantic-only — best for paraphrased or conceptual questions. 'lexical' is keyword-only — best when the exact term must appear (identifiers, drug names, error codes).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| mode | No | hybrid | |
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |