knowledge parameter — one surface for sources, chunking, reranking, and retrieval policy.
Quick Start
1
Simple Usage
2
With Configuration
embedder="openai" is the default and means “no override”. For Gemini, Cohere, or local Ollama embeddings, see Knowledge → Use a non-OpenAI embedder.How It Works
The user asks a question; the agent embeds the query, retrieves the top-k chunks, then generates an answer with citations.Configuration Options
For the retrieval-time tuning surface (
top_k, rerank, citations, strategy, …), see the full RetrievalConfig field reference on the RAG page.
Pass tuning without wrapping in KnowledgeConfig
retrieval_config= is a shortcut for retrieval-time tuning on Agent(...) directly. A dict merges on top of what knowledge= derived; a RetrievalConfig instance replaces it wholesale.
Agent for the merge-vs-replace rules and the full field table.
Agent Methods
agent.start() / agent.chat()
Conversation with automatic retrieval when auto_retrieve=True:
agent.query()
Structured answer with citations:
agent.retrieve()
Retrieval only — no LLM generation:
Multi-Agent Shared Knowledge
Best Practices
Set retrieval_threshold for noisy corpora
Set retrieval_threshold for noisy corpora
Use
retrieval_threshold=0.3 or higher when low-scoring chunks pollute answers.Retrieve more, rerank down
Retrieve more, rerank down
For large bases, set
retrieval_k=20 with rerank=True — cast a wide net, then keep the best chunks.Use skip_retrieval for non-RAG prompts
Use skip_retrieval for non-RAG prompts
Arithmetic, greetings, and meta questions do not need retrieval — pass
skip_retrieval=True.Related
Retrieval Strategies
Auto-select strategy by corpus size
CLI Retrieval
Run retrieval from the command line

