Skip to main content
Give agents sharper answers from large knowledge bases by combining keyword matching, semantic search, and reranking.
The user asks a question; hybrid retrieval and reranking surface the best knowledge snippets.

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, use SmartRetriever with a Knowledge instance:

CLI Usage


Best Practices

Reranking adds latency but improves relevance once you have hundreds of chunks. Start with rerank=True when answers feel noisy.
Fetch more candidates (retrieval_k=10–20) so the reranker has enough to choose from, then let the agent inject the top results.
For technical docs with exact terms, rely on automatic strategy selection — hybrid and reranked modes combine keyword and semantic signals.
Pass user_id or agent_id to SmartRetriever.retrieve() when isolating knowledge per tenant or sub-agent.

Retrieval Strategies

Automatic strategy selection by corpus size

Retrieval Configuration

Configure retrieval behaviour on agents