03

Match Memory Mechanism to Job

Compare memory products against Maya's support task instead of treating every persistence feature as long-term memory.

Separate conversation recovery from facts

Mem0 gives semantic fact recall, but Maya's agent may also need to resume a half-finished refund workflow. A checkpoint records execution state; it should not become a permanent profile.

LangGraph persistence stores checkpoints by thread. Its pros: explicit resumable graph state and time travel. Cons: application-managed schema, storage, and lifecycle; it does not automatically decide which cross-thread fact matters.

from langgraph.checkpoint.memory import InMemorySaver

checkpointer = InMemorySaver()
config = {"configurable": {"thread_id": "acme:maya:ticket-42"}}
# Compile graph with checkpointer=checkpointer, then invoke with config.

Use a production checkpointer backend; in-memory state disappears when this process exits.

Compare four durable-memory styles

Different memory APIs own different units of state. This table is a selection aid, not a benchmark.

OptionPrimary unitProsConsUse for Maya when
Mem0Extracted/searchable memoriesFast semantic recall; provider flexibilityExtraction errors; governance stays yoursPreferences and stable facts
LangGraphCheckpoint + storeControlled workflow resume; explicit stateMore infra and design workTicket workflow recovery
OpenAI Agents SDKSessionConvenient conversation continuitySession is not curated user profileOne ongoing support conversation
LettaEditable memory blocksAgent-visible core memory; explicit editsNew agent runtime and operational modelAgent needs maintained instructions
ZepTemporal knowledge graphTime-aware relationships and historyHeavier graph/data model“What changed for Maya?” matters

OpenAI Agents SDK sessions persist conversation history; Letta memory uses memory blocks; Zep focuses on temporal agent memory. Confirm current product limits and deployment posture from their official docs before adoption.

Keep app policy outside provider memory

A vendor's storage abstraction cannot decide who may see a fact. Build a small application boundary that verifies tenant identity, calls chosen backend, and logs an opaque memory reference rather than copying sensitive text into logs.

type MemoryRequest = { tenantId: string; userId: string; query: string };

export async function recall(req: MemoryRequest) {
  const namespace = `${req.tenantId}:${req.userId}`;
  const hits = await memoryBackend.search({ query: req.query, namespace });
  auditLog({ event: "memory.search", namespace, hitCount: hits.length });
  return hits;
}

memoryBackend is an adapter you own. Validate caller authorization before this function; string namespaces are a routing convention, not an access-control system.

Make a choice from workload evidence

Choice becomes clearer when based on evidence: Maya's team needs profile recall and resumable tickets now, not a full temporal graph. Choose Mem0 for curated facts plus LangGraph checkpoints for active ticket recovery; reassess Zep only if time-based relationship questions become product requirements.

RequirementRecommended first moveReconsider when
Similar wording should recall preferenceMem0 or vector-backed storeRecall quality cannot meet fixtures
Resume one interrupted workflowLangGraph checkpointWorkflow no longer uses a graph
Continue one chatAgents SDK sessionNeed curated cross-chat facts
Agent edits durable instructionsLetta blocksHuman review must gate every edit
Explain changes over timeZepGraph cost exceeds question value

Day 04 consumes this hybrid decision and Day 02's fixtures to prove retrieval, isolation, and erasure.