Infrastructure · Retrieval
Hybrid Search for Better Memory Retrieval
Hybrid search combines vector similarity and keyword (BM25) search to retrieve agent memories more reliably — catching exact matches vectors miss and semantic matches keywords miss.
Vector
“prefers email contact”
Keyword
Order #ORD-88421
Why hybrid
Why hybrid search for memory
Vectors miss exact IDs, SKUs and names; keywords miss paraphrases and semantic intent.
Example: a user asks about order ORD-88421 — BM25 finds the exact ID; vectors find “the package I ordered last Tuesday.” Production memory stacks combine both for higher recall@k.
Pipeline
How hybrid retrieval works
Parallel vector + BM25 → merge scores → top-k results.
- Embed the query → run vector similarity search
- Tokenize the query → run BM25/keyword search
- Merge result lists via reciprocal rank fusion (RRF) or weighted score fusion
- Apply metadata filters (user_id, tags, date range)
- Return top-k for LLM context injection
Combine with Park et al. (2023) recency × importance × relevance scoring for final ranking. Mem0 median search 0.148 s on LOCOMO (Chhikara et al., 2025).
Platforms
Where hybrid is available
| Platform | Hybrid capability | Memory use |
|---|---|---|
| Weaviate (Engram) | Native hybrid (alpha tuning) | Engram memory collections |
| Elasticsearch | Dense + sparse vectors | Enterprise agent memory |
| pgvector + tsvector | SQL-side fusion | Postgres-native stacks |
| Pinecone | Sparse-dense hybrid | Managed vector memory |
| Zep | Graph + vector hybrid | Temporal graph memory |
FAQ
Frequently asked questions
Is hybrid search always better for agent memory?
Not always — pure vectors suffice for open-ended preference memory. Hybrid wins when memories contain exact IDs, SKUs, order numbers, account codes or proper names.
Does Weaviate hybrid search work with Engram?
Yes — Engram runs on Weaviate with native hybrid search (alpha parameter balances vector vs keyword). See Engram explained.
Does Mem0 support hybrid search?
Mem0 uses vector similarity by default. For hybrid keyword+vector, use Weaviate via Engram or add BM25 layer in custom middleware over your vector store.
How do you tune hybrid search weights?
Weaviate uses alpha (0=BM25 only, 1=vector only). Start at 0.5, benchmark recall@k on your domain with LOCOMO or custom eval set.
Hybrid search vs graph traversal?
Different layers — hybrid fuses vector+keyword within a store; graph traversal follows entity relationships. Zep combines both for temporal graph memory.
How do you benchmark hybrid retrieval?
Compare recall@k on queries with exact IDs vs paraphrases. Run LOCOMO subset with and without hybrid enabled. See memory metrics.