Skip to main content

artl-memory

The multi-person memory layer for agents. Verbatim utterances · per-person isolation · evidence chains · confidence scores.

It remembers everyone in the room — separately. We don't promise understanding. We promise not to forget.

中文文档

artl-memory is extracted from a production assistant. It does not "summarize a profile of you and pretend to know you" — it stores who said exactly what, and when, each memory carrying its source utterance and a confidence score. When a fact is corrected, the old entry is marked expired — never silently overwritten — and the evidence chain stays in place.

Scope: the ledger, not the ears. artl-memory contains no audio, no ASR, no voiceprint. Your upstream pipeline (diarization, voiceprint, manual labels) decides who said what and hands this library the name — it keeps the books. That is what makes it dependency-free: usable without ears, plug-and-play with them.

pip install .        # from source (PyPI package not yet published)

Which memory layer should you pick?

Everyone arriving here has Mem0 (~60k★) as their reference point, so let's be direct about it. These four tools answer different questions — this table is for picking the right one, not for ranking them.

artl-memory Mem0 memoripy v4 MCP memory (official)
Needs an LLM to write memory No — zero model calls Yes — extraction LLM on every add() No required — deterministic extractor, bring-your-own optional No — the agent itself decides what to store
What gets stored Verbatim utterances + derived facts LLM-extracted summaries Evidence + derived memory, versioned Entities / relations / observations
Can you trace a memory to its source? Yes — source_event + confidence on every entry Partial — extraction rewrites wording Yes — citations and receipts No
Multi-person isolation First-class — per-person ledger, skills get scoped MemViews Per-user_id scoping Per-user_id scoping No — one shared graph
Deletion Hard delete — secure_delete + VACUUM + WAL truncation, verified by byte-level scan API delete; vector-store semantics forget tooling Delete tools on the JSONL file
Works fully offline Yes No (LLM + vector store calls) Yes Yes
Semantic (vector) search No — explainable bigram scoring, on purpose Yes Optional embeddings No — substring match
Dependencies 0 (stdlib sqlite3) LLM client + vector DB + embedder 0 required (v4) Node.js runtime

Be fair to each of them:

  • Pick Mem0 if you want automatic "talk → extracted profile" with semantic search, mature framework integrations (LangChain, CrewAI, AutoGen) and published benchmark numbers. That's a lot of real value. The trade-offs are documented by its own community: an audit of 10,134 Mem0 entries found 97.8% junk, including hallucinated user profiles that get re-extracted and amplified across sessions (mem0#4573); the HaluMem benchmark found extraction-stage hallucination is systemic across LLM-based memory systems (arXiv:2511.03506). If the wording of a memory doesn't have to be provably what a human said, that trade may be fine for you.
  • Pick memoripy if you like the evidence-first philosophy on a single-user workload and want an official MCP server out of the box.
  • Pick the official MCP memory server if you need a minimal scratchpad for one agent on one machine. It calls itself a reference implementation, and it is honest about being one.
  • Pick artl-memory if the question is "several people talk to one agent — in a meeting room, a family, a mediation session — and the record has to hold up later": who said which exact sentence, how confident was the transcription, what did the agent believe before the correction, and can 王强's utterances really be erased byte-for-byte when he asks. If a smart profile matters more than a trustworthy ledger, we are the wrong tool — and this README will tell you so again below.

Why multi-person

Most agent memory systems are single-user models: one user, one profile. artl-memory was a multi-person model from day one:

  • Per-person isolation: 王强's utterances never leak into 李四's recall; skills and plugins only see their own slot through MemView, which holds no store handle (same-process introspection can still dig — for hostile code, use process isolation)
  • Verbatim first: the original sentence is stored before any judgement; rewriting history does not exist on this path
  • Evidence chains: every memory carries source_event (which utterance it came from) and confidence; corrections expire the old entry and link it via supersedes — expiry is not deletion
  • Time-based downgrade: utterances older than N days are pruned — unreferenced rows are deleted, referenced rows keep their snippet so the chain never dangles
  • Right to be forgotten: store.purge_designer("王强") physically erases all five tables' worth of his data (PRAGMA secure_delete + VACUUM + WAL truncation), and returns per-table deletion counts

Quickstart (30 seconds)

from artl_memory import SqliteMemoryStore, MemoryService, MemView

store = SqliteMemoryStore("memory.db")
mem = MemoryService(store, designer="heima")

mem.remember("preference", "王强:预算", "三十万",
             source="utterance:wq-001", confidence=0.9)
mem.recall("王强的预算")        # relevance × confidence × time decay — every factor explainable

view = MemView(store, owner="skill:render", designer="heima")
view.put("风格", "奶油风")       # this skill's memory; nobody else's gets in

Run the multi-person example:

python examples/two_people.py

Zero dependencies, two backends

  • Zero hard dependencies: standard library only (sqlite3 is built in). A memory layer should not drag a dependency tree through your door.
  • InMemoryStore for tests and trials (not thread-safe); SqliteMemoryStore with WAL, single connection, auto-reopen after close, corrupt-file quarantine, and a versioned schema.
  • The same conformance suite runs against both backends: python tests/test_conformance.py (pytest-compatible)
  • Adversarial tests cover "undocumented but must not explode": python tests/test_adversarial.py
  • Regression tests pin every bug ever found by external review: python tests/test_regressions.py

Boundaries (stated plainly)

  • Values are stored JSON-serialized: tuple comes back as list; serialize custom objects yourself.
  • recall is O(n) full-scan scoring — deliberately index-free for explainability. The scan window is MemoryService(recall_window=...), default 10000 entries; when the window fills up you get a loud RuntimeWarning, never silent truncation. For bulk imports use remember_many(...) (one fsync per batch, ~100x faster than per-item commits) and make sure the window exceeds your total entry count.
  • recall scores by literal token overlap; it does not paraphrase. Rephrasing or mixing languages will miss: who pays thirty万 for the living room does not recall the Chinese entry「三十万」. If you need semantic search, layer embeddings on top of recall.
  • Time decay floors at 0.4: very old high-confidence entries keep participating in ranking, just discounted. To retire an old memory from ranking entirely, forget it (expiry, not deletion).
  • Empty query returns an empty list — when there is no question, it does not pretend to understand one.
  • Lock boundaries: MemoryService.remember is thread-safe via the service lock; InMemoryStore itself is not thread-safe — use it through the service layer. Multi-process writes to the same SQLite file are guarded by database-level unique constraints (only one active entry per slot+key); the loser re-reads and converges automatically.
  • Isolation is at the API surface. Nothing in-process is cryptographically hidden — if plugins are adversarial, put them behind a process boundary.

Explicitly not doing

  • No vector retrieval. bigram recall is deliberate: you can always see why it remembered this entry. Need embeddings? Layer them on top of recall.
  • No cloud sync, no multi-machine. Your data is your file. Feature, not bug.
  • No LLM calls. The memory layer doesn't know LLMs exist — swap brains freely, the memory stays.

License

Apache-2.0 · ARTL family

Metadata

Release files for artl-memory 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for artl-memory 0.2.0
File Size Uploaded Provenance Actions
artl_memory-0.2.0.tar.gz 41.8 kB Without provenance Details for artl_memory-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for artl-memory 0.2.0
File Interpreter ABI Platform Actions
artl_memory-0.2.0-py3-none-any.whl Python 3 none any Details for artl_memory-0.2.0-py3-none-any.whl

Total release size: 72.1 kB

Release files / artl_memory-0.2.0.tar.gz

Download URL artl_memory-0.2.0.tar.gz
Size 41.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6fe5efa5f781d85e7441263009c5f3b853f2fcec5134d148d5a1ed96cddc25a5
BLAKE2b-256 checksum
How to use checksums
12c344dc2384ae1abb0d49eb54c1c97a91b36563a28016fa6caff8db0149b782
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / artl_memory-0.2.0-py3-none-any.whl

Download URL artl_memory-0.2.0-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3087acee4a68250c3f7e703eb5b46f5e6c8691653280d9a563fbbb136781d95b
BLAKE2b-256 checksum
How to use checksums
e841be178f83d5e02935f6fec024f2205d2d06c3d17c02acff598c529009ad44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for artl-memory 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page