retrieve
Unifies retrieval across KG, memory, and docs by expanding queries with domain knowledge to surface conceptual matches that keyword search misses.
Instructions
Unified retrieval across KG, Memory, and Docs with KG-powered query expansion. Use for conceptual queries where keyword search fails. Automatically expands query using KG domain knowledge (e.g., 'transformer optimization' -> includes KV cache, Flash Attention). Fuses results via reciprocal rank fusion. Returns results with source attribution. Default: compact=true (shorter snippets, ~500-800 tokens). Use compact=false for full content (~2000 tokens).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results (default: 10) | |
| query | Yes | Search query | |
| rerank | No | Use cross-encoder reranking for better relevance (default: false). Requires a running reranker. | |
| compact | No | Low token mode: shorter snippets (200 chars). Default: true. Set false for full content (500 chars). | |
| sources | No | Sources to search (default: ['kg', 'docs', 'memory']) | |
| doc_type | No | Filter docs by type (markdown, json, code, etc.) | |
| doc_source | No | Filter docs by source (github, arxiv, devdocs, etc.) | |
| expand_query | No | Use KG for query expansion (default: true) | |
| rerank_top_n | No | Candidates to fetch before reranking (default: 20). Only used if rerank=true. | |
| semantic_threshold | No | Min similarity for semantic search (default: 0.5) |