Optional hybridHybrid dense+sparse searcher (vector + BM25).
When provided, enables the vector and bm25 sources.
Optional collectionVector store collection name for hybrid search.
'knowledge-base'
Optional raptorRAPTOR hierarchical summary tree.
When provided, enables the raptor source.
Optional graphGraphRAG engine for entity/relationship traversal.
When provided, enables the graph source.
Optional memoryCognitive memory manager.
When provided, enables the memory source and memory feedback loop.
Optional hydeHyDE (Hypothetical Document Embedding) retriever. When provided and plan.hyde.enabled is true, generates hypothetical answers before embedding for improved recall.
Optional multimodalMultimodal indexer for image/audio/video search.
When provided, enables the multimodal source.
Optional vectorVector search function (fallback when hybridSearcher is not available).
The search query.
Maximum results to return.
Retrieved chunks.
Optional rerankCross-encoder or LLM-based reranker.
The user query for relevance scoring.
Candidate chunks to rerank.
Maximum chunks to keep after reranking.
Reranked chunks.
Optional deepDeep research synthesis callback.
The user query.
Source hints for research.
Synthesis narrative and source chunks.
Optional decomposeQuery decomposition callback for complex strategies.
The original multi-part query.
Maximum sub-queries to generate.
Array of decomposed sub-query strings.
Optional emitEvent listener callback for retrieval lifecycle events.
A typed UnifiedRetriever event.
Optional rrfKRRF constant k. Higher values flatten score differences.
60
Optional defaultDefault topK for final results.
10
Optional maxMaximum sub-queries for complex decomposition.
5
Optional memoryMemory cache hit confidence threshold. Episodic memories above this confidence skip external sources.
0.85
Optional defaultDefault PAD mood state for memory operations. Used when no mood context is available.
Dependencies injected into the UnifiedRetriever.
All dependencies are optional — the retriever gracefully skips sources whose dependencies are not provided. This allows incremental adoption: start with just vector + BM25, then add GraphRAG, RAPTOR, memory, etc.
Example