Skip to content

v0.3.3 - High-Level API & Better DX

Choose a tag to compare

@scream4ik scream4ik released this 13 Dec 02:10
· 20 commits to main since this release

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_model correctly handles the fact_id argument to perform updates instead of creating duplicates.