Minimal reference for durable agent memory: namespaced key-value storage with upsert, soft-delete, cleanup, optional embeddings, and SQLite durability.
memory-mini is intentionally small. It exists to make one point easy to audit:
agent memory is infrastructure, not a transcript. Namespaces, lifecycle,
upserts, retention, and optional retrieval hooks should be explicit before a
fleet depends on them.
- Repeated writes should be a normal upsert path, not delete-then-store.
- Soft-delete and cleanup are separate lifecycle steps.
- Namespaces keep global facts, project facts, and session summaries from collapsing into one undifferentiated pile.
- Embeddings are optional; the durable key-value contract stands on its own.
pip install memory-mini
pip install memory-mini[embed]from datetime import timedelta
from memory_mini import Store
with Store("memory.db") as memory:
memory.store("session-end-2026-05-01-1", "Shipped docs and tests.", "sessions/project")
memory.store("session-end-2026-05-01-1", "Shipped docs, tests, and CI.", "sessions/project")
print(memory.get("session-end-2026-05-01-1", "sessions/project").value)
memory.soft_delete("session-end-2026-04-01-1", "sessions/project")
memory.cleanup(retention=timedelta(days=30))Durable memory should treat repeated writes as a normal update path. A delete-then-store workflow creates avoidable failure modes: unique keys can remain reserved by soft-deleted rows, audit history becomes ambiguous, and callers have to coordinate two operations instead of one. memory-mini defaults to upsert so storing the same namespaced key again refreshes the active entry in a single transaction.
Soft-delete and cleanup are deliberately separate. Soft-delete hides an entry from normal reads while preserving recoverability. Cleanup is the explicit hard-removal step, usually run after a retention window.
- JustAi — orchestration control plane.
- safe-mini — safe local execution substrate.
- route-mini — routing policy reference.