- 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
The three techniques cover complementary retrieval and ranking stages.
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.
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
Choose one reranker:Adjusting Results
Next Steps
Hybrid Search
Combine vector and keyword search
Embedders
Choose the right embedding model