Retrieval Strategies
The retrieval strategy system automatically selects the optimal retrieval approach based on corpus size, ensuring efficient and accurate knowledge retrieval.Overview
Available strategies:- DIRECT - Load all content directly (small corpora)
- BASIC - Semantic search only
- HYBRID - Keyword + semantic search
- RERANKED - Hybrid + reranking
- COMPRESSED - Reranked + compression
- HIERARCHICAL - Multi-level summaries for very large corpora
Quick Start
Strategy Selection
Automatic Selection
The system automatically selects strategies based on corpus size:| Corpus Size | Strategy | Description |
|---|---|---|
| < 500 tokens | DIRECT | Load all content |
| < 5,000 tokens | BASIC | Semantic search |
| < 20,000 tokens | HYBRID | Keyword + semantic |
| < 50,000 tokens | RERANKED | Hybrid + reranking |
| < 100,000 tokens | COMPRESSED | With compression |
| > 100,000 tokens | HIERARCHICAL | Multi-level summaries |
Manual Override
Strategy Details
DIRECT Strategy
Best for very small corpora where all content fits in context:BASIC Strategy
Semantic search using embeddings:HYBRID Strategy
Combines keyword (BM25) and semantic search:RERANKED Strategy
Adds reranking for improved relevance:COMPRESSED Strategy
Includes context compression:HIERARCHICAL Strategy
Uses multi-level summaries:CLI Usage
Integration with Agents
Best Practices
- Start with auto-selection - Let the system choose based on corpus size
- Monitor performance - Use profiling to identify bottlenecks
- Adjust for quality - Increase top_k and enable reranking for better results
- Consider latency - More complex strategies add latency

