LLM Filter
Semantic filtering using LLM to evaluate document relevance based on natural language criteria
Why do anything?
Attribute filters only work on exact values. Complex relevance criteria need semantic understanding.
Why now?
LLMs can evaluate nuanced conditions that rule-based filters cannot express.
Why this feature?
LLM evaluates each document against natural language criteria, returning relevance scores and explanations.
How It Works
LLM filter uses language models to evaluate semantic relevance of documents.
1
Criteria Parsing
Parse natural language filter criteria
2
Document Evaluation
LLM scores each document against criteria
3
Threshold Filtering
Filter documents by relevance score
Why This Approach
LLMs understand nuanced criteria. Enables filters like "documents about customer complaints" without keyword matching.
Where This Is Used
Integration
retriever = client.retrievers.create(stages=[{"type": "llm_filter", "criteria": "..."}])
