Quick Wins
1. Choose the Right Vector Database
Database choice has the biggest impact at scale:| Database | Use Case |
|---|---|
| LanceDB/ChromaDB | Development, testing (zero setup) |
| PgVector | Production up to 1M docs, need SQL |
| Pinecone | Managed service, auto-scaling |
2. Skip Already-Processed Files
The biggest speed-up when re-running ingestion:3. Use Metadata Filters
Narrow searches before search:4. Match Chunking to Content
| Strategy | Speed | Quality | Best For |
|---|---|---|---|
| Fixed Size | Fast | Good | Uniform content |
| Semantic | Slower | Best | Complex documents |
| Recursive | Fast | Good | Structured docs |
5. Use Async for Batch Operations
Process multiple sources concurrently:Common Issues
Irrelevant Search Results
Causes: Chunks too large/small, wrong chunking strategy. Fixes:- Try semantic chunking for better context
- Increase
max_resultsto check if relevant results are ranked lower - Add metadata filters to narrow scope
Slow Content Loading
Causes: Reprocessing existing files, semantic chunking on large datasets. Fixes:- Use
skip_if_exists=True - Switch to fixed-size chunking
- Process in batches
Memory Issues
Causes: Loading too many large files at once, chunk sizes too large. Fixes:- Process in smaller batches
- Reduce chunk size
- Use include/exclude patterns
- Clear outdated content with
knowledge.remove_content_by_id(content_id)