Repository navigation
v0.3.3 - High-Level API & Better DX
This release significantly improves Developer Experience. We recognized that manually wrapping Pydantic models into Fact dictionaries was tedious and broke the flow.
✨ New: commit_model API
You can now pass Pydantic instances directly to MemState. The library automatically resolves the registered schema type and handles the serialization.
Before (Verbose):
user = User(name="Alice")
# You had to remember the schema string and manually dump the model
mem.commit(Fact(type="user_profile", payload=user.model_dump()))Now (Clean):
user = User(name="Alice")
# MemState handles the rest
mem.commit_model(user)It supports both INSERT (auto ID) and UPDATE (explicit fact_id).
📚 Documentation & Examples
- Refactored Examples: All scripts in
examples/have been updated to use the modern, type-safe syntax. - New Benchmarks: Added a benchmark proving 0% Data Drift under network failure vs 9% drift in manual sync.
🐛 Fixes
- Ensured
commit_modelcorrectly handles thefact_idargument to perform updates instead of creating duplicates.