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.
| Option | Primary unit | Pros | Cons | Use for Maya when |
|---|---|---|---|---|
| Mem0 | Extracted/searchable memories | Fast semantic recall; provider flexibility | Extraction errors; governance stays yours | Preferences and stable facts |
| LangGraph | Checkpoint + store | Controlled workflow resume; explicit state | More infra and design work | Ticket workflow recovery |
| OpenAI Agents SDK | Session | Convenient conversation continuity | Session is not curated user profile | One ongoing support conversation |
| Letta | Editable memory blocks | Agent-visible core memory; explicit edits | New agent runtime and operational model | Agent needs maintained instructions |
| Zep | Temporal knowledge graph | Time-aware relationships and history | Heavier 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.
| Requirement | Recommended first move | Reconsider when |
|---|---|---|
| Similar wording should recall preference | Mem0 or vector-backed store | Recall quality cannot meet fixtures |
| Resume one interrupted workflow | LangGraph checkpoint | Workflow no longer uses a graph |
| Continue one chat | Agents SDK session | Need curated cross-chat facts |
| Agent edits durable instructions | Letta blocks | Human review must gate every edit |
| Explain changes over time | Zep | Graph cost exceeds question value |
Day 04 consumes this hybrid decision and Day 02's fixtures to prove retrieval, isolation, and erasure.