How Search Works
1
Query Analysis
The agent analyzes the user’s question to understand what information would help.
2
Search Execution
The system runs vector, keyword, or hybrid search based on configuration.
3
Retrieval
The knowledge base returns the most relevant content chunks.
4
Response Generation
Retrieved information is combined with the question to generate a response.
Search Types
Vector Search
Finds content by meaning, not exact words. When you ask “How do I reset my password?”, it finds documents about “changing credentials” even if those exact words don’t appear.Keyword Search
Classic text search that matches exact words and phrases. Uses your database’s full-text search or keyword matching capabilities.Hybrid Search
Combines vector similarity with keyword matching. Usually the best choice for production.Agentic vs Traditional RAG
Traditional RAG always searches with the exact user query and injects results into the prompt. Agentic RAG lets the agent decide when to search, reformulate queries, and run follow-up searches if needed.- Traditional RAG
- Agentic RAG
- Skip searching when it already knows the answer
- Reformulate queries for better results
- Run multiple searches to gather complete information
- Combine results from different searches
Filtering Results
Filter searches by metadata to target specific content:Custom Retrieval Logic
Override the default search behavior with a custom retriever:Improving Search Quality
Chunk Size
How you split content affects retrieval precision:Embedding Model
Your embedder converts text into vectors that capture meaning. The right choice depends on your content:
See Embedders for available options.
Metadata
Rich metadata enables better filtering:Content Structure
Well-organized content searches better:- Use clear headings and sections
- Include relevant terminology naturally
- Add summaries at the top of long documents
- Use descriptive filenames (
hr_vacation_policy_2024.pdfnotdocument1.pdf)
Testing
Test with real queries to validate search quality:Next Steps
Hybrid Search
Deep dive into combining vector and keyword search
Filtering
Filter results by metadata
Vector DB
Storage options for embeddings
Performance Tips
Optimize for speed and accuracy