Skip to main content
Most knowledge bases work great with Agno’s defaults. But if you’re seeing slow searches, memory issues, or poor results, a few strategic changes can make a big difference.

When to Optimize

Don’t prematurely optimize. Focus on performance when you notice:
  • Slow search - Queries taking more than 2-3 seconds
  • Memory issues - Out of memory errors during content loading
  • Poor results - Search returning irrelevant chunks or missing obvious matches
  • Slow loading - Content processing taking unusually long
If things are working fine, stick with the defaults and focus on building your application.

The 80/20 of Performance

These five changes give you the biggest performance boost for the least effort:

1. Pick the Right Vector Database

Your database choice has the biggest impact on performance at scale:
Guidelines:
  • LanceDB for development and testing (no setup required)
  • PgVector for production (up to 1M documents, need SQL features)
  • Pinecone for managed services (no ops overhead, auto-scaling)

2. Skip Already-Processed Files

The single biggest speed-up for re-running your ingestion:

3. Use Metadata Filters

Narrow searches before vector comparison for faster, more accurate results:

4. Match Chunking Strategy to Your Content

Different strategies have different performance characteristics:
Learn more about choosing chunking strategies.

5. Use Async for Batch Operations

Process multiple items concurrently:

Common Performance Pitfalls

Issue: Search Returns Irrelevant Results

What’s happening: Chunks are too large, too small, or chunking strategy doesn’t match your content. Quick fixes:
  1. Check your chunking strategy - try semantic chunking for better context
  2. Verify content actually loaded: knowledge.get_content_status(content_id)
  3. Increase max_results to see if relevant results are just ranked lower
  4. Add metadata filters to narrow the search scope

Issue: Content Loading is Slow

What’s happening: Processing large files without batching, or using semantic chunking on huge datasets. Quick fixes:
  1. Use skip_if_exists=True to avoid reprocessing
  2. Switch to fixed-size chunking for faster processing
  3. Process in batches instead of all at once
  4. Use file filters to only process what you need

Issue: Running Out of Memory

What’s happening: Loading too many large files at once, or chunk sizes are too large. Quick fixes:
  1. Process content in smaller batches (see code above)
  2. Reduce chunk size in your chunking strategy
  3. Use include and exclude patterns to limit what gets processed
  4. Clear old/outdated content regularly with knowledge.remove_content_by_id()

Advanced Optimizations

Once you’ve applied the quick wins above, consider these for further improvements: Combine vector and keyword search for better results:

Add Reranking

Improve result quality by reranking with Cohere:

Optimize Embedder Dimensions

Reduce dimensions for faster search (with slight quality trade-off):

Monitoring Performance

Keep an eye on these metrics:

Next Steps

Chunking Strategies

Learn how different chunking strategies affect performance

Vector Databases

Compare vector database options for your scale

Embedders

Choose the right embedder for your use case

Hybrid Search

Combine vector and keyword search for better results
Start simple, optimize when needed. Agno’s defaults work well for most use cases. Profile your application to find actual bottlenecks before spending time on optimization.