Skip to content

v0.3.0 - RAG Synchronization & ACID Consistency

Choose a tag to compare

@scream4ik scream4ik released this 04 Dec 02:57
· 35 commits to main since this release

This release marks a major strategic shift for MemState. We are evolving from a "Git-like" tool into a Hybrid Memory Engine that ensures atomicity between your structured data (SQL) and semantic data (Vector DBs).

⚡ Key Feature: Automatic RAG Sync

The biggest pain in AI Agents is "Split-Brain" memory: when the SQL database is updated, but the Vector DB still holds old embeddings, causing hallucinations.

MemState v0.3.0 solves this with ChromaSyncHook:

  • Transactional Integrity: Vector embeddings are only created/updated when the transaction commits. No more "ghost data" from failed or discarded sessions.
  • Automatic Cleanup: When a fact is deleted via rollback() or delete(), it is instantly removed from the vector store.
  • Zero Boilerplate: No need to manually write collection.upsert() in your business logic.

🛠 New API

import chromadb
from memstate.integrations.chroma import ChromaSyncHook

# 1. Setup Chroma
chroma_client = chromadb.Client()

# 2. Attach the Hook
# Automatically syncs the 'content' field to ChromaDB on commit
hook = ChromaSyncHook(
    client=chroma_client,
    collection_name="agent_memory",
    text_field="content",
    metadata_fields=["role", "created_at"]
)

memory = MemoryStore(storage, hooks=[hook])

📦 Installation

To get the new vector capabilities:

pip install memstate[chromadb]

🔄 Changes

  • Feature: Added memstate.integrations.chroma with strict Dependency Injection support.
  • Feature: Added support for custom text_formatter and metadata_formatter strategies for flexible Schema-to-Vector mapping.
  • Documentation: Rebranded project as an "ACID-like state manager" to emphasize data consistency guarantees.