UW-M01.The example works. In case UW-M01, one of this site's own cases, the worker dies right after the roof assessment arrived for SUB-1004. Attempt 2 of run run-7f3a continues from state_version 2, makes no second provider call, and ends with one recommendation, escalate, citing R-ROOF-03. All of it lives in eleven plain tables.
Then the platform team reviews the design, and the thread fills with names. "Why not LangGraph? It has checkpointers." "Temporal does this." "DBOS does it with only Postgres." "We are on AWS, use Step Functions." "Claude has a memory tool now." "Mem0 is a memory layer." "Put the memories in pgvector." Someone adds: "We already send OpenTelemetry traces, so we can resume from the trace."
These are not ten versions of one thing. Two are standards that store nothing. Four save where a run had got to. Two keep what an agent knows. One is an index. And resuming from a trace mixes up the two questions this site keeps apart: memory is information retained for future use; a checkpoint is saved execution state that allows a workflow to resume. So the sorting question is not which one is good. It is this: what does this thing store for me, which of the two questions does it answer, and what does it leave with me?
A framework stores records for you. It does not decide which run a record belongs to, which write may happen twice, or what may become a memory. Those stay in your code, whichever framework you pick.
This reference page deepens checkpoints, resume and write policy, and it is the only page here that makes statements about named products and standards. One note before any result appears: the agent here is a scripted stand-in, so these results show how the mechanism works, not how good any model is.
1. Five storage jobs, whoever writes the code#
Start from what UW-M01 needs stored, before any tool is named.
Carry the ids. The call to the roof provider carries attempt 1's trace id in a header, so its log line can be joined to the right attempt later. Nothing is stored; the id travels.
Save the run state. After step 2 the run has the roof assessment in hand. Saving that is a checkpoint: run-7f3a, state_version 2, roof age 22 years.
Keep the event history. The ordered list of what happened: step 1 finished, the provider answered. State can be rebuilt by reading it again, which is called replay.
Keep memory records. After the underwriter decides, the run may leave MEM-0031 for scope broker:BRK-017: "This broker reports roof age from the owner's statement, not from an inspection."
Find memories by meaning. A similarity index ranks records by closeness to a question. The scope filter decides which records may be candidates at all.
Diagram: Five storage jobs, and which kind of tool takes each
Read left to right. The first lane carries ids between processes and stores nothing. The second lane answers where were we: the state of a run and the history of what happened in it. The third lane answers what do we know: memory records and an index to find them. The last lane is never handed over. For each tool on this page, ask which boxes it runs for you.
- 1 · Carry the ids
- Trace context: Carries the trace id of one attempt from process to process so its steps can be joined later. Standards do this job.
- 2 · Where were we?
- Run state: Saves which step the run reached and what it gathered, so a new attempt can continue the same run.
- Event history: Records every event of the run in order, so state can be rebuilt by replay and a person can audit it.
- 3 · What do we know?
- Memory records: Keeps information for future runs with its scope, source, expiry and status.
- Similarity index: Ranks stored records by how close their embedding is to a question. It finds; it does not decide what may be found.
- 4 · Yours, whatever you adopt
- Ids, keys and policy: The run id, the idempotency key, the write policy and the scope filter. No tool on this page decides them for you.
Lane 2 answers "where were we?", lane 3 "what do we know?". Lane 1 answers neither: a trace explains a run, and a checkpoint resumes it. No tool below takes over lane 4.
One more word, because four tools use it. Durable execution means each finished step is recorded as the run goes, so after a crash the next attempt continues from the last recorded step. In UW-M01 it is the difference between one provider call and two.
For a backend engineer. It is the batch job with a job-run table and a step-execution table that restarts from the last completed step. The new part: steps call a model and outside tools, so a step that already ran must never run again unnoticed.
2. How each one was read#
Each section was written from the tool's own documentation, read on 2026-11-17, and every claim has a row with its source address in the repository's fact log, docs/facts/frameworks.md. Where a page read is silent, the text says "the documentation read here does not say". No prices, no ranking. Code for a tool is "documented shape; not run here": assembled from documented calls and checked for syntax only. The only code this site runs is the plain Python of examples/uw-memory/.
Every section has nine parts: 1 what it is, 2 the problem it solves, 3 what it stores for you, 4 UW-M01 in it, 5 strengths, 6 limitations, 7 integration and security, 8 when plain code is better, 9 version, date and sources. Parts 5, 6, 7 and 9 are folded. The tools also name the same things differently:
| This site | LangGraph | Temporal | DBOS | Step Functions |
|---|---|---|---|---|
| run | the work on one thread | Workflow Execution | workflow | execution |
| the key you choose for a run | thread_id | Workflow Id | workflow ID | execution name |
| step | node | Activity | step | state |
| checkpoint | checkpoint (StateSnapshot) | Event History, replayed | row of step output | state kept between states |
| attempt after a crash | not on the pages read | not a named id on the pages read | column recovery_attempts | redrive (Redrive count) |
| pause for a person | interrupt | not read | not read | task token |
Common confusion. Temporal's Run Id is not this site'srun_id: it is system generated and changes with retries, Continue-As-New and resets. The id you choose,run-7f3a, is the Workflow Id. Mem0'srun_idis a scope for memories.
The moment of UW-M01 is the same in all four runtimes.
Diagram: UW-M01 · the same crash, four places the roof assessment is kept
Time runs down the page. Attempt 1 gets the roof assessment and the runtime records it before the worker dies. Attempt 2 reads the record instead of calling the provider. Only the name and the shape of the record differ between the tools; the rule is the same in all of them.
- Worker attempt 1 to Roof provider: get_roof_assessment for SUB-1004. Step 2 of the ten steps. The only call to the provider in the whole run.
- Roof provider to Worker attempt 1: 22 years. The application said 9 years; the difference later triggers rule R-ROOF-03.
- Worker attempt 1 to The record (runtime store): Record step 2 and its result. LangGraph: a checkpoint after the super-step. Temporal: an activity-completed event. DBOS: a step output row. Step Functions: the state's output, kept between states.
- Worker attempt 1: The worker dies. Nothing in its variables survives. What survives is what was recorded.
- Worker attempt 2 to The record (runtime store): Read the last record of run-7f3a. By thread id, Workflow Id, workflow ID or execution name: the key you chose for the run.
- The record (runtime store) to Worker attempt 2: Step 2 done, 22 years. Attempt 2 continues at step 3. The provider is called zero more times: one call in total.
Attempt 1 records step 2 before it dies; attempt 2 reads that record by the key you chose for the run. The shape of the record changes from tool to tool: a snapshot, an event, a row. What never changes: the record must exist before the crash, and the key names the run, not the attempt.
Two standards come first and stay apart from the products: they define formats and store nothing.
Standard: W3C Trace Context#
1 · What it is. A W3C Recommendation, dated 23 November 2021, that defines two HTTP headers, traceparent and tracestate, for carrying tracing context from one process to the next.
2 · The problem it solves. One attempt crosses several processes. Without an agreed header each hop starts its own trace; with it, every hop names the same trace.
3 · What it stores for you. Nothing. traceparent carries a version, a 32-hex-character trace id, a 16-hex-character parent id and flags; tracestate carries vendor pairs. No storage rules are set.
4 · UW-M01 in it. On this site each attempt is one trace, so attempt 2, a new process, starts a new trace. The two lines are illustrative values in the documented format; documented shape; not run here.
attempt 1 → roof provider traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
attempt 2 → search_guidance traceparent: 00-9a1c0e5b2d7f4e3a8c6b1d0f2e4a6c8b-3c5e7a9b1d2f4e6a-01
Two traces, one run. The run_id joins them; the header never does.
8 · When plain code is better. When one process does all the work, there is nothing to carry. A trace id in your own log lines is enough until the second process appears.
W3C Trace Context: strengths, limits, privacy, sourcesParts 5, 6, 7 and 9
5 · Strengths. One format that every tracing library can read, so a trace survives a change of vendor.
6 · Limitations. It names a trace, not a run, an attempt or a business object. A design that uses the trace id to find saved state has merged two ids that the run identity page keeps apart: on resume the trace id changes and the state would be lost.
7 · Integration and security. The Recommendation says vendors must not put personally identifiable or otherwise sensitive information in either header, and that the value is built from random numbers that must not come from user data. A submission_id is a business id; keep it out of tracestate and carry it as an attribute inside your own system instead.
9 · Version, date and sources. Recommendation of 23 November 2021, read on 2026-11-17: W3C Trace Context. Sample: two header lines, illustrative values.
Standard: OpenTelemetry#
1 · What it is. An open-source framework and toolkit for creating and exporting traces, metrics and logs. Its documentation says it is not an observability backend; storage and display are left to other tools.
2 · The problem it solves. Instrumenting the worker and its tools once, for any tracing backend. Its default propagator uses the W3C Trace Context headers.
3 · What it stores for you. Nothing. It creates spans with attributes, status and links and hands them to an exporter. A span link relates a span to spans in another trace.
4 · UW-M01 in it. The mapping is this site's; the field names are the documented ones; documented shape; not run here.
| In the run | In OpenTelemetry |
|---|---|
Attempt 1 of run-7f3a | One trace; every span shares its trace id |
Step 2, get_roof_assessment | A span, attributes run_id = run-7f3a, attempt_number = 1 |
| The crash | The trace ends without its later spans |
| Attempt 2 | A new trace; its first span carries a link to attempt 1's last span |
| Which step to start from | Not here. It comes from the checkpoints table |
8 · When plain code is better. A single process with structured log lines that carry run_id and attempt_number gives a person the same story until there are several services to join.
OpenTelemetry: strengths, limits, baggage, sourcesParts 5, 6, 7 and 9
5 · Strengths. One instrumentation for any backend, and a documented way (links) to say that attempt 2 continues attempt 1.
6 · Limitations. The context propagation page says nothing about storing context to resume work later. That matches this site's rule: a trace is evidence for people who diagnose, and resume state lives in the checkpoint store. Sampling makes the point sharper: a trace may not be kept at all.
7 · Integration and security. Baggage propagates arbitrary key-value pairs, and the documentation warns against putting credentials, API keys or personal data in it, because it may be logged or sent to services you do not trust. The same holds for span attributes that hold a submission's content. The home of traces is observe.sammuthu.com.
9 · Version, date and sources. Specification 1.62.0, read on 2026-11-17: What is OpenTelemetry · Context propagation · Traces · Specification. Sample: the mapping table; no code.
What this is not. A trace explains a run; it is not the state a run resumes from. Traces, logs and metrics as evidence belong to observe.sammuthu.com.
LangGraph persistence: checkpointers and stores#
1 · What it is. The persistence layer of LangGraph, a library for building agents as graphs. It has two parts with two jobs: a checkpointer saves the graph state of one thread, and a store keeps data across threads.
2 · The problem it solves. A graph that pauses or dies must continue where it was (a checkpoint), and what one thread learned must be readable in the next (memory). LangGraph gives the two separate components.
3 · What it stores for you. The checkpointers guide says a snapshot is saved at each super-step, one tick of the graph. A snapshot holds the values, the nodes to run next, its thread_id and checkpoint_id, and its parent. If a node fails within a super-step, the nodes that succeeded keep their writes and do not run again on resume. The store keeps items under tuple namespaces and ranks them by semantic similarity when an embedding index is configured.
4 · UW-M01 in it. Attempt 1 runs on thread thread-SUB-1004; a new process reads the latest snapshot of that thread, then one memory is written and searched. A successful run would show the roof assessment and next pointing past it. Documented shape; not run here.
# uw_langgraph.py · documented shape; not run here
from langgraph.store.postgres import PostgresStore
from my_agent import DB_URI, builder, checkpointer # your graph builder and a PostgresSaver (checkpointers guide)
config = {"configurable": {"thread_id": "thread-SUB-1004"}}
with PostgresStore.from_conn_string(DB_URI) as store:
store.setup() # first use only: runs the schema migrations
graph = builder.compile(checkpointer=checkpointer, store=store)
graph.invoke({"submission_id": "SUB-1004"}, config) # attempt 1; the worker dies after the roof step
snapshot = graph.get_state(config) # attempt 2, a new process: the latest checkpoint of the thread
print(snapshot.values.get("roof_assessment"), snapshot.next)
store.put(("BRK-017", "memories"), "MEM-0031",
{"text": "This broker reports roof age from the owner's statement, not from an inspection."})
hits = store.search(("BRK-017", "memories"), query="roof age source", limit=5)
8 · When plain code is better. When the workflow is a fixed list of ten steps with no graph to compile, a checkpoints table with one row per step does the same job, and the interrupt is a status column.
LangGraph: strengths, limits, security, sourcesParts 5, 6, 7 and 9: the node that runs twice, scope by convention
5 · Strengths. Checkpoint and memory are separate objects with separate keys, which is the distinction of this site built into the API. Snapshots form a history you can list, replay from, or fork with update_state. Three durability modes say when a checkpoint is written: only at the end ("exit"), while the next step runs ("async"), or before it starts ("sync").
6 · Limitations. The interrupts page states the edge case that matters most: when a paused node resumes, "the runtime restarts the entire node from the beginning", so code before interrupt() runs again and side effects there "should (ideally) be idempotent". If record_recommendation sat in the same node as underwriter_review, a resume after three days would store the recommendation twice without a key; that is case UW-M04 in another form. Replay from an earlier checkpoint re-executes the later nodes, model calls included, so it is not the read-only replay of an event log. The "exit" mode leaves no record if the process dies mid-run. The pages read show no attempt counter, so the attempts table stays yours, and they say nothing about expiry of store items.
7 · Integration and security. The stores guide does not discuss access control; scope is a namespace convention, and a search on a prefix such as ("BRK-017",) also returns sub-namespaces. The tenant filter must therefore be built by your code from the authenticated broker, never from model output. Results past limit are silently truncated. Checkpoints hold the full state, a submission's content included; the guide names an EncryptedSerializer that reads its key from LANGGRAPH_AES_KEY, and recommends pruning old checkpoints with a retention policy.
9 · Version, date and sources. langgraph 1.2.22 (released 2026-11-14, MIT), read on 2026-11-17: Persistence · Checkpointers · Stores · Memory · Interrupts. On that date the older address /durable-execution answered with the Persistence page, and durability modes were documented under Checkpointers. Sample: the block above, compiled only.
Temporal#
1 · What it is. A workflow platform. A service records every event of a workflow execution in an append-only Event History, and workers run your code. Its documentation calls a Workflow Execution "a durable, reliable, and scalable function execution".
2 · The problem it solves. Long runs across unreliable calls without checkpoint code of your own. When a worker dies, another replays the history: the code runs again, and each completed step returns its recorded result.
3 · What it stores for you. The Event History of each execution, in the service's database (Cassandra, MySQL or PostgreSQL; SQLite for development). Workflow code must be deterministic so replay makes the same calls in the same order; outside calls go into Activities, which retry by default.
4 · UW-M01 in it. Two activities and a workflow, with the idempotency key built from the run and the step. A successful run would show one roof completion in the history even after a worker died. Documented shape; not run here.
# uw_temporal.py · documented shape; not run here
from datetime import timedelta
from temporalio import activity, workflow
@activity.defn
async def get_roof_assessment(submission_id: str) -> dict:
... # the provider call; its completion is recorded in the Event History
@activity.defn
async def record_recommendation(write: dict) -> str:
... # INSERT ... with a unique idempotency_key: an activity can run more than once
@workflow.defn
class Underwrite:
@workflow.run
async def run(self, inputs: dict) -> dict:
roof = await workflow.execute_activity(
get_roof_assessment, inputs["submission_id"], start_to_close_timeout=timedelta(seconds=30)
)
recommendation = {"recommendation": "escalate", "citations": ["R-ROOF-03"], "roof": roof} # steps 3 to 6
key = inputs["run_id"] + ":record_recommendation" # run and step, never the attempt
await workflow.execute_activity(
record_recommendation,
{"submission_id": inputs["submission_id"], "recommendation": recommendation, "idempotency_key": key},
start_to_close_timeout=timedelta(seconds=30),
)
return recommendation
# started with: client.execute_workflow(Underwrite.run, {"run_id": "run-7f3a", "submission_id": "SUB-1004"},
# id="run-7f3a", task_queue="underwriting")
8 · When plain code is better. When steps are few, short and each writes its result to a table anyway, a checkpoints row per step gives the same resume with no service to operate and no determinism rules to learn.
Temporal: strengths, limits, security, sourcesParts 5, 6, 7 and 9: determinism, history limits, ids in plain text
5 · Strengths. The history is both the resume state and an audit trail of the run. Retries, timeouts and long waits are part of the runtime, not your code. A Workflow Id you choose is unique among open executions, so a second start of run-7f3a is refused by default.
6 · Limitations. Determinism is the price of replay. The workflow definition page says reordering, adding or removing calls breaks running executions with a non-determinism error, and offers Worker Versioning (recommended) and patching for changed code; this is the state migration problem in Temporal's form. A history is terminated past 51,200 events, 2,000 Updates or 10,000 Signals; Continue-As-New starts a fresh execution, and with it a new Run Id. Activities may run more than once, which is why the documentation recommends idempotent activities: the key in the block is still yours. The documentation read here does not say in those words whether a worker crash changes the Run Id; the page lists retries, Continue-As-New and resets.
7 · Integration and security. Workflow Ids are stored in plain text, bypass custom Payload Codecs and appear in the Web UI, the CLI, the history and logs, and the documentation warns against putting personal data in them. A Payload Codec can encrypt payloads on your own hosts so that "the Temporal Server sees only encrypted data". Waiting for the underwriter would use Signals, which were not read for this page.
9 · Version, date and sources. Python SDK temporalio 1.36.1 (MIT), read on 2026-11-17: Workflow Execution · Event History · Workflow Definition · Activities · Retry policies · Workflow Id and Run Id · Persistence · Payload Codec · Python tutorial. Sample: the block above, compiled only.
DBOS#
1 · What it is. An open-source library for durable workflows. Its documentation says there is "no separate orchestration server and no infrastructure required besides Postgres": the library writes checkpoints to a system database from inside your process.
2 · The problem it solves. Temporal's problem, without a workflow service. After a crash the workflow function is called again with its saved inputs, and completed steps return their saved outputs.
3 · What it stores for you. Rows in system tables, among them workflow_status (one per workflow, with a column named recovery_attempts) and operation_outputs (one per completed step). SQLite by default; Postgres recommended for production.
4 · UW-M01 in it. Two steps and a workflow, started under the workflow ID run-7f3a. A successful run would leave one saved output for the roof step, which recovery reads instead of calling the provider. Documented shape; not run here.
# uw_dbos.py · documented shape; not run here
import os
from dbos import DBOS, DBOSConfig, SetWorkflowID # the page shows SetWorkflowID without its import line
config: DBOSConfig = {
"name": "uw-underwriting",
"application_version": "2026.2",
"system_database_url": os.environ.get("DBOS_SYSTEM_DATABASE_URL"),
}
DBOS(config=config)
@DBOS.step(retries_allowed=True)
def get_roof_assessment(submission_id: str) -> dict:
... # the provider call; its output becomes a row in operation_outputs
@DBOS.step()
def record_recommendation(submission_id: str, recommendation: dict, idempotency_key: str) -> None:
... # INSERT with a unique idempotency_key: a step interrupted before its output was saved runs again
@DBOS.workflow()
def underwrite(run_id: str, submission_id: str) -> dict:
roof = get_roof_assessment(submission_id)
recommendation = {"recommendation": "escalate", "citations": ["R-ROOF-03"], "roof": roof} # steps 3 to 6
record_recommendation(submission_id, recommendation, run_id + ":record_recommendation")
return recommendation
DBOS.launch()
with SetWorkflowID("run-7f3a"):
underwrite("run-7f3a", "SUB-1004")
8 · When plain code is better. DBOS is close to plain code already. Your own tables win when you need columns it lacks, such as trace_id per attempt or policy_version per checkpoint.
DBOS: strengths, limits, security, sourcesParts 5, 6, 7 and 9: determinism, retries off by default
5 · Strengths. The checkpoints are rows in a database you already run, readable with SQL. A second start with the same workflow ID returns the existing workflow, so a duplicate start is harmless by default. The recovery_attempts column is the closest thing on this page to this site's attempt_number.
6 · Limitations. The workflow must be deterministic: "invoke the same steps with the same inputs in the same order", or recovery raises DBOSStepNondeterminismError. Step retries are off by default (retries_allowed=False; when on, 3 attempts, 1 second, backoff 2.0). The architecture page says steps should be idempotent because an interrupted step is retried, and that once a step "is checkpointed, it is never re-executed": the window between the effect and its checkpoint is where UW-M04 lives. The documentation read here does not say how a workflow waits days for a person, or what recovery_attempts counts beyond its name.
7 · Integration and security. Step outputs and workflow inputs are stored serialized in the system database, so a submission's content sits there with the same access rules as that database. Conductor, the optional control plane, is off the execution path according to the architecture page. application_version is recorded per workflow, which helps when code changes under running workflows.
9 · Version, date and sources. dbos 3.6.0 (released 2026-11-17, MIT), read on 2026-11-17: Architecture · Workflows · Steps · Programming guide · System tables. The architecture page names only Postgres while the programming guide makes SQLite the default; both are reported here as read. Sample: the block above, compiled only.
AWS Step Functions#
1 · What it is. A managed AWS service that runs workflows defined as state machines in JSON. Each step is a state; each running instance is an execution.
2 · The problem it solves. Coordinating steps across services with retries, waits and human approval, while the service keeps state and history.
3 · What it stores for you. For Standard workflows, state persists between transitions and the history is readable for 90 days after the execution closes, up to 25,000 events; inputs and outputs are capped at 256 KiB. Express workflows keep no state between transitions.
4 · UW-M01 in it. Three of the ten states: the roof call with a retrier, the write, and the review waiting for a token. A successful run would pause at UnderwriterReview until the cockpit returns the token. Documented shape; not run here.
{
"Comment": "Three of the ten steps of run-7f3a. Documented shape; not run here.",
"StartAt": "GetRoofAssessment",
"States": {
"GetRoofAssessment": {
"Type": "Task",
"Resource": "arn:aws:lambda:REGION:ACCOUNT:function:get_roof_assessment",
"Retry": [{"ErrorEquals": ["States.Timeout"], "IntervalSeconds": 2, "MaxAttempts": 2, "BackoffRate": 2.0}],
"ResultPath": "$.roof",
"Next": "RecordRecommendation"
},
"RecordRecommendation": {
"Type": "Task",
"Resource": "arn:aws:lambda:REGION:ACCOUNT:function:record_recommendation",
"ResultPath": "$.recorded",
"Next": "UnderwriterReview"
},
"UnderwriterReview": {
"Type": "Task",
"Resource": "arn:aws:states:::sqs:sendMessage.waitForTaskToken",
"Parameters": {
"QueueUrl": "https://sqs.REGION.amazonaws.com/ACCOUNT/underwriter-cockpit",
"MessageBody": {"submission_id.$": "$.submission_id", "TaskToken.$": "$$.Task.Token"}
},
"ResultPath": "$.human_decision",
"End": true
}
}
}
8 · When plain code is better. When state exceeds 256 KiB, the team is not on AWS, or the steps are calls inside one service, a table and a loop are smaller than a definition and its permissions.
Step Functions: what "exactly-once" covers, security, sourcesParts 5, 6, 7 and 9
5 · Strengths. Nothing of yours runs the workflow, so no worker of yours can die holding it; a failed state is handled by the service. A failed Standard execution can be redriven: it continues from the unsuccessful step with the same input and the same execution ARN, and successful steps are not rerun, within 14 days. A task token lets a run wait up to the one-year limit for the underwriter.
6 · Limitations. Read the guarantee in full. The documentation says Standard workflows follow an exactly-once model, "where your tasks and states are never run more than once, unless you have specified Retry behavior". The retrier in the block above is such behavior: if the provider answered but the reply was lost to a timeout, the task runs again and the provider is called twice. And a redrive reruns the failed task. So the write still needs its key. Exactly-once is at-least-once plus deduplication, and the deduplication of an outside effect is yours. Redrive also keeps the definition of the original execution: changed code needs a new execution. Express workflows are at least once (asynchronous) or at most once (synchronous) and do not support the task token.
7 · Integration and security. State and history live in the vendor's service in your account. Starting a Standard execution with the name of one already running returns an idempotent response, so the execution name run-7f3a works as a guard against a double start. Task tokens must come from principals in the same AWS account. Every Lambda and queue the definition names needs its own permission.
9 · Version, date and sources. Managed service; no version number. Read on 2026-11-17: What is Step Functions · Choosing workflow type · Redrive · Integration patterns · Error handling · Quotas. Sample: the JSON above, parsed only.
What this is not. Deciding the next step, branching and the control plane are orchestration; this page only says what each runtime stores for that decision. The home of orchestration is orchestrate.sammuthu.com.
The Claude memory tool#
1 · What it is. A Claude API tool with six file commands (view, create, str_replace, insert, delete, rename) under /memories. It "operates client-side": the model asks, your application carries out the command.
2 · The problem it solves. Letting the model decide during work what to write down for a later conversation, and read it back on demand.
3 · What it stores for you. Nothing on Anthropic's side. /memories is a prefix your handler maps onto real storage, such as a per-user folder or keys in a database. The API adds an instruction to the system prompt that tells the model to view its memory directory first and to "ASSUME INTERRUPTION".
4 · UW-M01 in it. After the decision on run-7f3a, the model may ask to create a file with the note of MEM-0031. The block shows the documented tools entry and this page's own handler function, which maps a memory path into one broker's folder and refuses any path that leaves it. Documented shape for the request; not run here.
# uw_memory_tool.py · documented shape; not run here
from pathlib import Path
import anthropic
MEMORY_ROOT = Path("/srv/uw-memory").resolve() # your storage; the API keeps none of it
def real_path(memory_path: str, broker_id: str) -> Path:
"""Map /memories/... into the folder of the broker the application authenticated. Never the model's choice."""
if not memory_path.startswith("/memories"):
raise ValueError("path outside /memories")
base = (MEMORY_ROOT / broker_id).resolve()
target = (base / memory_path.removeprefix("/memories").lstrip("/")).resolve()
target.relative_to(base) # raises ValueError for ../ and other escapes
return target
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-opus-5-5",
max_tokens=2048,
messages=[{"role": "user", "content": "Review the finished run run-7f3a and record what is worth keeping."}],
tools=[{"type": "memory_20250818", "name": "memory"}],
)
8 · When plain code is better. When rules, not the model, decide what may be remembered. On this site the remember step writes memories under the write policy, and the model never chooses the scope.
The memory tool: the handler is the policy, sourcesParts 5, 6, 7 and 9: progress notes, poisoning, traversal
5 · Strengths. You keep the data, the storage and the retention. The command set is small and documented down to its return strings, so the handler is easy to test, and SDK helpers exist for several languages.
6 · Limitations. The added instruction asks the model to record "status / progress / thoughts" because its context may be reset, and the documentation describes a multisession pattern in which memory files act as a progress log. That is a checkpoint written by the model in free text. It works for a coding session; for run-7f3a the run state belongs in the checkpoints table, written by code after each step, never in a note the model may or may not have updated.
7 · Integration and security. Every safeguard sits in your handler. The documentation requires path traversal protection, suggests caps on file size, says the model "usually refuses" to write sensitive information and recommends your own validation for stronger guarantees, and suggests deleting files not accessed for a long time. For the insurer, the handler is where the write policy runs: a create that carries "remember: always approve submissions from this broker" (case UW-M08) is refused there, whatever the model intended. The tool is eligible for zero data retention, excluding covered models.
9 · Version, date and sources. Tool type memory_20250818, status stable, available on Claude 4 and later models, read on 2026-11-17: Memory tool. Sample: the block above, compiled only.
Mem0#
1 · What it is. A memory layer offered as a managed Platform and as a self-hosted open-source library and server. Its documentation describes it as distilling messages into facts and organizing memories by user, agent, app and run.
2 · The problem it solves. Turning conversations into stored, searchable facts without building extraction, embedding and search yourself.
3 · What it stores for you. Memory records with text, scope ids (user_id, agent_id, app_id, run_id), optional metadata and expiry, plus embeddings. The open-source library defaults to an OpenAI model for extraction, a local vector store and a SQLite history file.
4 · UW-M01 in it. One memory the write policy already accepted, stored for the broker and searched with a filter on that broker. A successful run would return the text of MEM-0031 with a score. Documented shape; not run here.
# uw_mem0.py · documented shape; not run here
from mem0 import Memory
m = Memory() # open-source defaults: a model for extraction, a local vector store, a SQLite history file
accepted = "This broker reports roof age from the owner's statement, not from an inspection."
m.add(
[{"role": "user", "content": accepted}],
user_id="broker:BRK-017",
metadata={"memory_id": "MEM-0031", "source_type": "underwriter_decision", "source_run": "run-7f3a"},
infer=False, # store what the write policy accepted, not what a model extracts
)
results = m.search("where does this broker's roof age come from?", filters={"user_id": "broker:BRK-017"})
8 · When plain code is better. When every memory must pass rules with a source, a confidence and evidence ids, extraction is the part you switch off (infer=False), and what remains is the plain design below.
Mem0: the add-only change, security, sourcesParts 5, 6, 7 and 9: supersession, extraction, erasure
5 · Strengths. Extraction, embedding, search and scoping in one call each, with deletion by id or by filter. The delete page says deleting by filter "Satisfies user erasure (GDPR/CCPA) without touching the rest of your data".
6 · Limitations. Read this with its date. On 2026-11-17 the add page, the v2-to-v3 migration guide and the repository README all said that add() now only adds: one model pass, "no UPDATE/DELETE", and changed facts sit next to older ones while ranking decides which surfaces first. For UW-M07 that matters: a true approval decided under policy 2025.4 stays stored beside the current rule, and nothing marks it superseded unless your code does. The same guide says top-level entity ids in search() now raise ValueError and lowered the default top_k from 100 to 20. Whether a delete is permanent, and whether it leaves history, the documentation read here does not say.
7 · Integration and security. With extraction on, a model decides what becomes a fact, so an injected passage could become one; send only what your write policy accepted. The scope id is a string you pass: build it from the authenticated broker, never from model output. On the Platform the data is stored by the vendor; with the open-source library it is wherever you configure the stores. The open-source defaults call an outside model provider for extraction and embedding.
9 · Version, date and sources. Apache 2.0 (repository README), read on 2026-11-17; no release number was visible on the pages read: Overview · Add · Update · Delete · Platform or open source · Open source · Python quickstart · Migration v2 to v3 · Repository. Sample: the block above, compiled only.
pgvector#
1 · What it is. An open-source PostgreSQL extension for vector similarity search. Its README says it lets you store your vectors with the rest of your data.
2 · The problem it solves. Finding the memories closest in meaning to a question inside the same database, transaction and backup as the rows they describe.
3 · What it stores for you. A vector column type (plus halfvec, sparsevec, bit), distance operators such as <-> and <=>, and two approximate index types, HNSW and IVFFlat, which trade some recall for speed. Scope, status, expiry and provenance are your columns.
4 · UW-M01 in it. An embedding column on memories, an index, and the read for the broker's next submission: scope and status first, then distance. Documented shape; not run here; this site's example uses SQLite and word overlap instead.
-- documented shape; not run here (PostgreSQL with pgvector)
CREATE EXTENSION vector;
ALTER TABLE memories ADD COLUMN embedding vector(1536); -- the dimension of your embedding model
CREATE INDEX ON memories USING hnsw (embedding vector_cosine_ops);
SELECT memory_id, text
FROM memories
WHERE scope = 'broker:BRK-017' AND status = 'active' AND expires_at > now()
ORDER BY embedding <=> $1
LIMIT 5;
8 · When plain code is better. With a few thousand memories per broker, an exact scan with no index returns the right rows with no recall loss. And word overlap, as in this site's example, is enough to teach the ranking.
pgvector: the filter after the index, sourcesParts 5, 6, 7 and 9: fewer rows than asked for
5 · Strengths. One database: a memory row and its vector commit together, are deleted together and are restored together. Joins to evidence and runs are ordinary SQL.
6 · Limitations. The README states the edge case that matters for scope: "With approximate indexes, filtering is applied after the index is scanned." Its example: a condition that matches 10% of rows, with HNSW and the default hnsw.ef_search of 40, leaves about 4 matching rows on average. The WHERE scope = ... still holds, so another broker's memory never comes back (UW-M11 is safe), but fewer than five may come back, and the missing ones are silent. The README offers iterative index scans (SET hnsw.iterative_scan = strict_order;), a partial index when the filter has few distinct values, and partitioning when it has many.
7 · Integration and security. Tenant separation is your WHERE clause and the database's access rules, nothing in the extension. A deletion must remove the row and its vector; because both are one row, one DELETE does it, but backups and any derived summary keep their copies (see security).
9 · Version, date and sources. v0.8.7 in the install instructions, Postgres 13 or later, read on 2026-11-17: Repository and README · LICENSE; the licence file does not print a name, and its text carries PostgreSQL Global Development Group copyright lines. Sample: the SQL above, not run.
All of them side by side#
The table holds only what the sections prepared, with the same date. yes: a page read describes it. no: out of that business by its own description. partly: part of the job. unstated: the pages read do not say, which is not no. Use the buttons to filter.
| Name | Group | Saves run state | Keeps memory | Event history | Similarity search | Pauses for a person | Data lives | Form, as read |
|---|---|---|---|---|---|---|---|---|
| W3C Trace Context | standard | no | no | no | no | no | none | Recommendation, 2021 |
| OpenTelemetry | standard | no | no | no | no | no | none | Specification 1.62.0 |
| LangGraph persistence | product | yes | yes | partly | yes | yes | you | Library 1.2.22, MIT |
| Temporal | product | yes | no | yes | no | unstated | you | Service plus SDK 1.36.1, MIT |
| DBOS | product | yes | no | partly | no | unstated | you | Library 3.6.0, MIT |
| AWS Step Functions | product | yes | no | yes | no | yes | vendor | Managed service |
| Claude memory tool | product | no | yes | no | no | no | you | API tool memory_20250818 |
| Mem0 | product | no | yes | no | yes | no | either | Platform or library, Apache 2.0 |
| pgvector | product | no | partly | no | yes | no | you | Postgres extension 0.8.7 |
| Plain tables of this site | design | yes | yes | yes | partly | yes | you | Standard-library Python and SQLite |
How to read four of the cellspartly, you, and what the table does not say
For LangGraph and DBOS, partly under event history means a history of snapshots or of step outputs, not every event of the run. For pgvector, partly under memory means it stores the vectors while your table holds the memory. "Data lives" you means a database you run; Temporal is you because only its self-hosted service was read. For the plain design, partly under similarity search means word overlap standing in for embeddings. Nothing in the table says which one to choose: read it by rows for one tool, and by columns for one job.
The plain database design of this site#
Every product above stores some of these records for you. The example stores all of them in eleven SQLite tables, defined in examples/uw-memory/schema.sql; the stores page explains each shape. The right column answers "which product would hold this row instead?".
| Table | One row is | Who else would hold it |
|---|---|---|
runs | One execution for a submission | Temporal execution, DBOS workflow_status, Step Functions execution |
attempts | One process-level try inside a run | No product read here, by name |
checkpoints | Saved state after one step | LangGraph checkpoint, DBOS operation_outputs |
events | One thing that happened, in order | Temporal Event History, Step Functions history |
evidence | The provider's answer, under its own id | None; business data |
recommendations | The agent's recommendation, with a unique key | None; the key is yours |
outbox, inbox | A message owed, and a message already seen | None read here |
decisions | A person's decision | None; a task token or resume value only carries it |
memories | One memory with scope, provenance and lifetime | LangGraph store, Mem0, memory tool files; pgvector for the index |
shared_records | A record several agents update, with a version | None read here |
Three of these rows make a repeat harmless, and no runtime can hold them for you, because no runtime knows which of your writes may happen twice. The first is the attempt. Here it is as the example defines it, quoted from schema.sql:
-- One process-level try inside a run. A resume is the next attempt of the same run.
CREATE TABLE IF NOT EXISTS attempts (
run_id TEXT NOT NULL REFERENCES runs(run_id),
attempt_number INTEGER NOT NULL, -- 1, 2
trace_id TEXT NOT NULL UNIQUE, -- 32 hex; one trace per attempt
status TEXT NOT NULL CHECK (status IN ('running', 'ok', 'crashed', 'paused')),
resumed_from_version INTEGER, -- the state_version it started from; NULL for a fresh start
started_at TEXT NOT NULL,
ended_at TEXT,
ended_reason TEXT,
PRIMARY KEY (run_id, attempt_number)
);
trace_id is UNIQUE (one trace per attempt) and the primary key is the run plus the attempt number: the two ids run identity keeps apart sit side by side in one row. The second is the key of the write, built by the function idempotency_key in examples/uw-memory/idempotency.py, quoted as it stands:
def idempotency_key(run_id: str, step: str, attempt_number: int, mode: str) -> str | None:
"""The key for one write.
run_step run-7f3a:record_recommendation (right: one key per intended effect)
attempt run-7f3a:2:record_recommendation (wrong: a resumed attempt gets a new key)
none no key (every delivery stores a row)
"""
if mode == "none":
return None
if mode == "attempt":
return f"{run_id}:{attempt_number}:{step}"
return f"{run_id}:{step}"
Only the run_step mode survives a resume: attempt 2 builds the same key as attempt 1, and the UNIQUE column on recommendations turns the repeat into "already stored". The third is the outbox row, which the outbox page treats. Put the checkpoints into a product and the run state leaves your schema, which is the point; keep these three and memories in your own tables, and the policy that makes them safe stays in one place you can test.
When plain code is better#
Refuse "resume from the trace": the trace id changes with every attempt, a trace may be sampled away, and OpenTelemetry describes nothing about resuming. For the other names, the table says when the product's code is worth more than your own.
| Plain tables are enough while | A product earns its place when |
|---|---|
| Runs are short and run in one process | Runs wait days or cross many workers and services |
| Each step writes its own result anyway | Timers, long waits and retries would be your code |
| Memories pass written rules with a source and an owner | The model's own notes or extracted facts are the goal |
| A few thousand memories per scope, exact scan | Large collections need an approximate index |
Production pitfall. Adopting a durable-execution product does not make writes idempotent. Temporal recommends idempotent activities, DBOS idempotent steps, LangGraph idempotent side effects before an interrupt, and Step Functions' "exactly-once" holds unless a retrier is defined. Keep the key run-7f3a:record_recommendation whichever runtime you choose.
A test before you adopt one#
Run these on paper against any product or design, your own included.
- Crash (
UW-M01). Kill the process after the roof step. Does the next attempt read the result, with one provider call in total? - Window (
UW-M04). Kill it after the write, before that step's record. Does your key turn the repeat into one row? - Ids. Name the field for the run, the attempt and the trace. If two are one field, which question can you no longer answer?
- Wait (
UW-M06). Pause three days for the underwriter. Which code runs again on resume? - Scope (
UW-M11). Is the scope filter built by your code from the authenticated broker, or from a string the model passed? - History (
UW-M07). When a fact changes, what marks the old one superseded? - Deletion (
UW-M12). After a delete, what remains in histories, backups, summaries and embeddings? - Exit. Can you export run state and memories in a plain format today?
A product that fails a test is not ruled out. The test tells you which part stays your code.
Four costs a runtime brings that the documentation does not priceDeterminism, saved state under new code, data location, a second source of truth
Determinism. Every replay-based runtime requires workflow code to make the same calls in the same order. A model call is not deterministic, so it must sit in a recorded step, and any branch on its answer must read the recorded answer. Teams learn this from the first non-determinism error in production.
Saved state under new code. A run that waits three days for the underwriter will resume under whatever code was deployed meanwhile. Temporal documents Worker Versioning and patching, DBOS records application_version per workflow, and Step Functions keeps the original definition for a redrive. Plain tables need a state_version and a migration rule of their own. The advanced page treats state migration.
Data location. Checkpoints and histories hold the submission's content: the roof assessment, the broker's statements, sometimes personal data. A managed service stores them in the vendor's service; a self-hosted one in a database you must secure, back up and purge. Retention of run state is a policy decision, separate from retention of memories.
A second source of truth. A runtime's history says a step completed; your recommendations table says a row exists. After a crash in the window between them they can disagree, and the reconciliation is yours. The outbox pattern is the same problem between a row and a message.
In one breath#
A framework stores records for me, and I ask which: run state, an event history, memories, an index, or only an id in a header. LangGraph's checkpointers, Temporal, DBOS and Step Functions save where a run was; LangGraph's store, the Claude memory tool and Mem0 keep what an agent knows; pgvector finds rows by meaning; the two standards carry trace ids and store nothing, so nobody resumes from a trace. The run id, the idempotency key, the write policy and the scope filter stay in my code, and until runs wait for days across many workers, plain tables do the same work.
The same idea for a coding agent: an instruction file it loads is memory and a file checkpoint is saved state, whichever tool runs the agent, and files shows which survives what.
This page compared tools on one moment of one case. The insurance lab puts the whole example together: every table filled by the run of UW-M01, the resume, the single recommendation, the underwriter's decision and the memories written, with the code.