Repository navigation
v0.5.0 - Hybrid Search & Semantic Retrieval
This release transforms MemState into a complete Memory Engine.
Previously, MemState ensured your data was written consistently. Now, it ensures it is retrieved consistently.
🔍 New Feature: Hybrid Structured-Semantic Search
We introduced a unified store.search() API that bridges the gap between Vector similarity and SQL strictness.
Why is this safer than standard RAG?
Standard RAG retrieves text directly from the Vector DB. If your Vector DB is slightly behind (indexing lag) or out of sync, you get stale data.
MemState Search uses the "Index-Lookaside" pattern:
- Discovery: Finds relevant IDs in the Vector DB (using semantic query + metadata filters).
- Hydration: Loads the actual payload from the SQL Storage (Source of Truth).
- Result: You always get the latest committed state, never stale vectors.
# Search by meaning + Filter by strict metadata
results = await store.search(
query="What does the user like?",
filters={"role": "preference"},
limit=5
)
# Returns ScoredFact objects with fresh data✨ Integrations Upgrade
- Qdrant: Implemented modern
query_pointsAPI. Added DX Magic: you can now pass simple Python dicts{"role": "user"}as filters, and MemState automatically converts them to Qdrant's complexmodels.Filtersyntax. - ChromaDB: Full support for semantic search with metadata filtering.
⚠️ Breaking Changes
- Protocol Update: The
MemoryHookandAsyncMemoryHookprotocols now require asearchmethod. If you have written custom hooks, you need to implement this method (returning an empty list[]is acceptable if retrieval is not supported).