- Agentic RAG: Agent decides when to search the knowledge base
- Hybrid search: Combines vector similarity with keyword matching
- Reranking: Reorders results using a dedicated ranking model
Why Combine These Techniques
Together, these provide better retrieval accuracy than any single technique alone.
How Reranking Works
After hybrid search returns initial results, the reranker:- Takes the query and candidate documents
- Scores each document for relevance using a cross-encoder model
- Reorders results so the most relevant appear first
rerank-v3.5 is trained specifically for this task and significantly improves result quality.
Example
agentic_rag.py
Usage
1
Set up your virtual environment
2
Install dependencies
3
Export your API keys
4
Run Agent
Configuration Options
Different Rerankers
Adjusting Results
Next Steps
Hybrid Search
Learn more about combining search types
Embedders
Choose the right embedding model