Why Use Filters
- Personalization: Retrieve documents for a specific user or group
- Access control: Restrict searches to authorized content
- Precision: Reduce noise by narrowing results to relevant documents
Manual Filtering
Pass filters explicitly when creating the agent or searching:Agentic Filtering
Let the agent extract filters automatically from the query. The agent analyzes the user’s question and determines which filters to apply.Manual vs Agentic Filtering
| Approach | When to Use |
|---|---|
| Manual | Automation, predictable filters, full control |
| Agentic | User-facing apps, natural language queries |
Traditional vs Agentic RAG
Filters work with both RAG approaches:- Agentic RAG
- Traditional RAG
search_knowledge=True) is recommended for most use cases.
Metadata Design
Good metadata enables effective filtering:- Use consistent values (always
"engineering", not sometimes"eng") - Include temporal data for time-based filtering
- Add access levels for permission-based filtering
Supported Vector Databases
Filtering is supported on:- ChromaDB
- LanceDB
- Milvus
- MongoDB
- PgVector
- Pinecone
- Qdrant
- Weaviate