Memory, recall, audit and erasure for autonomous agents
Give autonomous AI agents self-hosted long-term memory. Resume a stopped job, reuse facts across runs, and audit who wrote each fact.
Loom provides self-hosted long-term memory for autonomous agents. An agent can reuse facts across runs, resume a stopped job from a checkpoint, and record the run and its outcome for inspection. Loom stores this data in ClickHouse, with Postgres available for live memory and knowledge state.
Resume an agent after a restart
An agent that checks a catalog can save its last completed batch under the run ID
its scheduler assigns. A replacement process reads that checkpoint before starting
work. Save facts that should outlive the job with memory.set.
Keep the job’s current cursor in working memory.
Try the checkpoint on the single-user quickstart. Use a disposable run ID on the local deployment. Save the last completed batch:
curl --fail-with-body --silent --show-error http://localhost:7777/v1/working_memory.set \
--json '{"org":"local","namespace":"default","agent":"catalog-worker","run_id":"catalog-restart-demo","block_key":"checkpoint","content":"batch-04"}'
From a fresh shell or agent process, read the checkpoint with the same identity and run ID:
curl --fail-with-body --silent --show-error http://localhost:7777/v1/working_memory.get \
--json '{"org":"local","namespace":"default","agent":"catalog-worker","run_id":"catalog-restart-demo","block_key":"checkpoint"}'
The response should have found: true and content: "batch-04". Read again with an
unused run ID and expect found: false. The exact-key check requires no model call.
Delete the test checkpoint with working_memory.delete.
On a shared deployment, scope the agent’s token and carry the same namespace, agent, user and session identity into the replacement process. Record the checkpoint after a batch completes. A crash between a side effect and its checkpoint can cause a retry, so use a stable operation ID to deduplicate the side effect. Run the crash and retry example to verify that an item committed before a stop produces one result after recovery. The trace and resume guide also covers MCP.
What you get
- Memory and recall. Versioned facts with provenance, search that abstains when nothing is close enough, and a ranking boost for memories that successful runs relied on. Memory · Runs
- Procedures. Reusable how-tos the agent learns from doing:
procedure.addstores one as a graph of steps,procedure.matchfinds the ones that fit a task, and the runs the agent reports teach Loom the proven path and the steps that fail. A revised graph is kept only if its runs do not do worse. Procedures and learnings - Refusal. A pinned fact refuses contradicting writes, and
blacklist.addregisters a pattern no write may store. Conflicts and refusal - Audit. Each operation that changes memory leaves an audit row with a SHA-256 of its content, and a worker seals hourly windows into a hash chain, so an edit or deletion is detectable. The transport’s audit writes are fail-open (a failed insert loses the row); under the Postgres authority a memory revision’s audit row is stored with the revision. Audit log
- Erasure you can check.
erasure.requesterases a scope from every table that holds memory content (tombstones by default;purge=truedeletes the rows of auser_idornamespace_listscope) and ends with a residue census and a receipt. Retention and erasure - Rollback.
namespace.rollbackreturns every memory in a namespace to its version at a point in time. History and provenance - Headless operation. A bot gets its own identity (it signs itself up where self-signup is open), checks its connection before its first run, and can be diagnosed when it goes quiet. Headless bots
Audit and erasure are engineering primitives, not a compliance certification. Security
Check one agent task
Use a disposable namespace on your deployment, with a writer token for the agent. Integrate Loom into an agent covers the client and identity.
- Open the task with
run.beginand write a fact withmemory.setcarrying the returnedrun_id(runs). Add a checkpoint when the agent needs to resume after a stop. - Follow the procedure example
to register, match and report an execution, then call
procedure.evolveexplicitly. The agent executes the steps; inspect the match’s trust status. Close the task once withrun.complete, following the procedure run reporting rules to count each execution once. - With viewer access, inspect
run.getand read the namespace’srun.beginandrun.completeevents throughaudit.list. The offline verifier checks stored row hashes; read the audit page’s failure modes before treating the trail as complete. - As the namespace admin, erase the disposable namespace
and check for
status="completed",residue_count=0andverified_at. Save the receipt before the request ledger expires. Erasure retains audit rows and excludes backups; retention and erasure describes the boundary.
Some ops on this page are marked experimental on the status page.