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.
Reorders results using deep semantic understanding to put the most relevant memories first.
When to Use
How it Works
Performance
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
Python
# Get the most relevant travel plans firstresults = client.search( query="What are my upcoming travel plans?", rerank=True, user_id="user123")# Before reranking: After reranking:# 1. "Went to Paris" → 1. "Tokyo trip next month"# 2. "Tokyo trip next" → 2. "Need to book hotel in Tokyo" # 3. "Need hotel" → 3. "Went to Paris last year"
# Smart home assistant finding device preferencesresults = client.search( query="How do I like my bedroom temperature?", rerank=True, # Get most recent preferences first user_id="user123")# Finds: "Keep bedroom at 68°F", "Too cold last night at 65°F", etc.
Python
# Find specific product issues with high precisionresults = client.search( query="Problems with premium subscription billing", user_id="customer456")# Returns only relevant billing problems, not general questions
Python
# Critical medical information needs perfect accuracyresults = client.search( query="Patient allergies and contraindications", rerank=True, # Most important info first user_id="patient789")# Ensures critical allergy info appears first
Python
# Find learning progress for specific topicsresults = client.search( query="Python programming progress and difficulties", rerank=True, # Recent progress first user_id="student123")# Gets comprehensive view of Python learning journey