How It Works
Quick Start
1
Simple Usage
Enable reranking on the agent’s knowledge config:
2
With Configuration
Use
KnowledgeConfig for chunking, vector store, and rerank model:How It Works
Strategy selection scales with corpus size — see Retrieval Strategies.
Advanced: SmartRetriever
For direct control over retrieval strategy and filters, useSmartRetriever with a Knowledge instance:
CLI Usage
Best Practices
Enable rerank for large corpora
Enable rerank for large corpora
Reranking adds latency but improves relevance once you have hundreds of chunks. Start with
rerank=True when answers feel noisy.Tune retrieval_k before reranking
Tune retrieval_k before reranking
Fetch more candidates (
retrieval_k=10–20) so the reranker has enough to choose from, then let the agent inject the top results.Use hybrid strategies at scale
Use hybrid strategies at scale
For technical docs with exact terms, rely on automatic strategy selection — hybrid and reranked modes combine keyword and semantic signals.
Scope by user or agent
Scope by user or agent
Pass
user_id or agent_id to SmartRetriever.retrieve() when isolating knowledge per tenant or sub-agent.Related
Retrieval Strategies
Automatic strategy selection by corpus size
Retrieval Configuration
Configure retrieval behaviour on agents

