Skip to main content

What is Advanced Retrieval?

Advanced Retrieval gives you precise control over how memories are found and ranked. While basic search uses semantic similarity, these advanced options help you find exactly what you need, when you need it.

Search Enhancement Options

Reranking

Reorders results using deep semantic understanding to put the most relevant memories first.
  • Need the most relevant result at the top
  • Result order is critical for your application
  • Want consistent quality across different queries
  • Building user-facing features where accuracy matters

Real-World Use Cases

Python

Choosing the Right Configuration

rerank is the only lever here that changes result order. filters, top_k, and threshold change which memories come back, not how they’re ordered. The two functions below send the same query and filters; the only difference is the rerank flag.
What changes in the response: both calls return the same fields on each memory (see the Search Memories API reference for the full response shape). The only difference is the order of the results array, the same effect shown in the Reranking example above: quick_search returns results ranked by raw similarity, standard_search returns the reranked order.

Best Practices

Do

  • Start simple with basic search and measure impact before enabling reranking
  • Use reranking when the top result quality matters most
  • Monitor latency and adjust based on your application’s needs
  • Handle empty results gracefully

Don’t

  • Enable reranking by default without measuring necessity
  • Ignore latency impact in real-time applications
  • Use advanced retrieval for simple, fast lookup scenarios

Performance Guidelines

Latency Expectations

Python

Optimization Tips

  1. Cache frequent queries to avoid repeated advanced processing
  2. Use session-specific search with run_id to reduce search space
  3. Implement fallback logic when search returns empty results
  4. Monitor and alert on search latency patterns

Discord

Join our community

GitHub

Ask questions on GitHub

Support

Talk to founders