> ## Content Index
> Fetch the complete content index at: https://www.implicator.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# Give Your AI a Memory Layer That Survives Sessions
- URL: https://www.implicator.ai/give-your-ai-a-memory-layer-that-survives-sessions/
- Published: 2026-06-30T07:15:31.000Z
- Updated: 2026-11-09T19:11:48.000Z
- Description: Coding agents, support bots, and assistants all restart cold. A bigger context window does not fix it; a memory layer does. A build-along with Mem0 and Qdrant, the contradiction test most demos skip, and the real token math, costs, and controls a production memory store actually needs.
- Author: Marcus Schuler
- Tags: Implicator PRO Briefing

*Implicator PRO Briefing / 30 Jun 2026*

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Pro Members Only Every coding agent, support bot, and personal assistant restarts cold. It forgets the plan that changed on Thursday, mixes one user's context with another's, and keeps resurrecting an instruction the team abandoned. A memory layer fixes that, and the building blocks already sit on GitHub: Mem0, Graphiti, Letta, Qdrant. This briefing builds a complete local memory layer from a blank folder, tests it against a contradiction most demos skip, and shows where the real costs and risks live. By the end you will know which repo to reach for, what it costs at scale, and what controls a production memory store needs. New to Implicator PRO? [Subscribe for $8/month](https://www.implicator.ai/become-an-implicator-pro-member/) — new deep dive every Tuesday morning 3am PST. |
|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

Open a new terminal on Friday morning and the failure is easy to reproduce. The agent knows the model, the shell, and the files it can read. It does not know that Alex prefers TypeScript examples, that the demo moved to 10:30 a.m. Pacific, or that the team abandoned Azure on Thursday and switched the whole proof of concept back to Docker and Qdrant.

Developers solve this today by pasting old notes into the prompt, pointing the agent at a folder, or trusting a larger context window to carry the week. That works until it doesn't. The desk gets bigger, but the agent still has to find the right page, ignore the stale page, and notice that Thursday replaced Monday. A memory layer changes the job. It extracts durable facts from a session, stores them outside the model with scope and metadata, retrieves only the relevant facts before the next answer, and logs what it used.

That is why the most useful agent memory projects on GitHub do not look like magic. They look like plumbing. [Mem0](https://impli.me/yVqUoy?ref=implicator.ai) stores extracted facts and retrieves them by user, agent, app, or run. [Graphiti](https://impli.me/IoBGeE?ref=implicator.ai) builds temporal knowledge graphs with provenance and validity windows. [Letta](https://impli.me/neyHv6?ref=implicator.ai) treats memory as part of a stateful agent runtime, with small always-visible memory blocks and larger archival memory searched on demand. Qdrant and pgvector sit underneath as places where the memory can live. None of these replaces the model. They give the application a place to keep state.

The build path in this piece is deliberately plain: Mem0 plus Qdrant, with either OpenAI or local Ollama. It runs on a laptop, starts with Docker, uses one Python client, and tests the part that matters most: a user changes a plan midweek, then asks the agent what to do on Friday. The pass condition is not whether the assistant sounds clever. It is whether it remembers the current plan, scopes the facts to the right user, and leaves the old Azure instruction behind.

That sounds small. It is the difference between a chatbot and software that improves with use.

Summary

- Mem0's paper reports 1,764 memory tokens and 1.440 seconds p95 latency on one LoCoMo setup, versus 26,031 tokens and 17.117 seconds for full context.
- LongMemEval tests 500 human-written questions across extraction, multi-session reasoning, temporal reasoning, knowledge updates, and abstention.
- The local build uses Qdrant on port 6333, Mem0 as a Python client, and either 1,536-dimensional OpenAI embeddings or 768-dimensional Ollama embeddings.
- GitHub metadata checked June 30, 2026 showed Mem0 at 59,730 stars, Graphiti at 28,153, Letta at 23,587, and Qdrant at 32,809.

## What changed in agent memory

Agent memory has moved from feature copy to infrastructure. The change did not arrive because a vendor found the perfect memory algorithm. It arrived because the failures became routine. Coding agents restart cold. Customer support agents forget prior cases unless the app retrieves them. Personal assistants retain facts that should expire. Enterprise agents need audit logs for what they recalled and why.

The same pressure has already surfaced in developer tools. Claude Code's Auto Dream feature, covered in a [memory consolidation analysis](https://www.implicator.ai/anthropic-adds-auto-dream-to-claude-code-fixing-memory-decay-between-sessions/), exists because auto-written notes decay. Duplicate entries pile up, relative dates lose meaning, and stale facts compete with current ones. The Enzyme memory layer for Obsidian, described in [a January profile](https://www.implicator.ai/the-memory-problem-nobody-solved-until-now/), starts from a different point: partial structure can tell an agent where to look even when a user never wrote a perfect note. Repo Radar's May issue put [agentmemory](https://www.implicator.ai/repo-radar-5-github-projects-worth-your-week-4/) in the same bucket, with local SQLite capture and recall for coding sessions.

Those projects differ in design, but they agree on one point. Memory is not the same as dumping a transcript back into a prompt. A useful layer has five steps: extraction, storage, retrieval, injection, and audit. Extraction decides what is worth keeping. Storage attaches scope, source, time, and sometimes graph relationships. Retrieval filters by user, agent, project, tenant, or run. Injection puts a short, labeled packet into the next prompt. Audit records what happened so a user can inspect, edit, export, or delete it.

Long context solves the storage side of the problem. It lets the model read more of the record in a single call, but the application still has to decide whether Monday's plan lost to Thursday's update, whether a note belongs to one user or the whole team, and when the evidence is too thin for an answer. LongMemEval was built around those chores. Its 500 human-written questions test extraction, multi-session reasoning, temporal reasoning, knowledge updates, and abstention; the authors reported that long-context models still trailed oracle retrieval by 30% to 60% on LongMemEval-S, a roughly 115,000-token version that already fits inside many frontier windows.

Memory turns the problem into systems work. That is less glamorous than a longer window. It is also what product teams can test.

**Working model:** Treat the context window as the desk and the memory layer as the labeled cabinet beside it. A bigger desk helps, but the cabinet decides which folders should be on the desk before the next task starts. 

I — TRADEOFFS

## The working desk still gets crowded

The technical reason to add memory is not that full context is useless. Full context can be more accurate in narrow tests. Mem0's own vendor-authored paper reports a LoCoMo table where the full-context baseline scored 72.90 on its judge metric, above Mem0 at 66.88 and Mem0g at 68.44\. That should make teams cautious about any sales claim that memory always wins.

The same table explains why developers still reach for a memory layer. Full context used 26,031 tokens and 17.117 seconds p95 total latency. Mem0 used 1,764 memory tokens and 1.440 seconds p95\. Mem0g used 3,616 memory tokens and 2.590 seconds p95\. Accuracy was not free. It arrived with a large prompt and a slow response.

1,764 memory tokens per query, against 26,031 for full context (Mem0, LoCoMo) 

For a consumer chat product, that tradeoff may be acceptable when the user asks a high-value question. For an agent that runs twenty small tool calls in a workflow, the delay compounds. A memory search that retrieves eight facts can be cheaper than dragging the whole week into every call. It also gives the application hooks that a raw prompt lacks: delete this user's facts, expire this project note, log that this answer relied on a memory written on Wednesday, or separate a demo user's state from a production customer's state.

Mem0's V3 API design shows the product boundary. The managed add endpoint requires at least one entity ID, such as `user_id`, `agent_id`, `app_id`, or `run_id`. Its search endpoint requires those IDs inside filters. Search combines semantic retrieval, BM25 keyword matching, and entity matching with defaults of `top_k=10`, `threshold=0.1`, and `rerank=false`, according to the API docs. The scope field is not decoration. It keeps Miriam's CFO demo facts out of someone else's support case.

Contradictions are the harder part. Mem0's current managed V3 add path is documented as asynchronous and ADD-only. Older open-source prompts in the Mem0 repository define ADD, UPDATE, DELETE, and NONE operations for reconciling facts, but the V3 managed path pushes teams toward separate update/delete endpoints, linked-memory handling, expiration policy, or application logic. A memory system that only appends will eventually remember too much.

Graph systems attack that problem by keeping time. Graphiti, the open-source engine behind Zep's memory work, stores entities, facts, episodes, validity windows, and provenance. That means a system can preserve the old Azure plan as history while marking the Docker and Qdrant plan as current. The price is ingestion complexity, entity resolution, and graph storage. If the application only needs user preferences and project constraints, a vector store plus metadata may be enough.

Letta draws a different line. Its docs describe memory blocks as always visible in the agent prompt, while archival memory is searched through tools. That split is useful because some facts should never be retrieved probabilistically. An agent's name, role, durable operating rules, or a user's preferred language can sit in core memory. A meeting note from March belongs in archival search.

None of this removes judgment. Memory can poison itself if the extractor stores a false inference. It can become creepy when it keeps personal details a user did not intend to preserve. Security teams are anxious because a memory store concentrates personal data, credentials, and business context in one place. Product teams are excited because the same store makes an agent feel less disposable. Both reactions are rational.

II — SHORTLIST

## The repos worth testing first

A useful GitHub shortlist should separate memory frameworks from stores and adjacent agent tooling. The first group decides what to keep and how to retrieve it. The second group stores vectors or graph relationships. The third group captures code context or session history around coding agents. GitHub stars do not prove quality, but activity, license, docs, and a clear rollback path are good first filters.

__Memory-layer repositories to test first__
| Project                                                  | GitHub signal                                                         | Best use                                                                                                                                                              | Watch before production                                                                                                      |
| -------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [Mem0](https://impli.me/yVqUoy?ref=implicator.ai)        | 59,730 stars, Python, Apache-2.0GitHub metadata checked June 30, 2026 | Fast practical memory layer for agents, with Qdrant, pgvector, Chroma, Milvus, Redis, Pinecone, MongoDB, Azure AI Search, S3 Vectors, and Neptune options documented. | V3 managed add is ADD-only, so changed facts need update/delete logic, expiration, or linked-memory cleanup.                 |
| [Graphiti](https://impli.me/IoBGeE?ref=implicator.ai)    | 28,153 stars, Python, Apache-2.0                                      | Temporal knowledge graphs with entities, episodes, validity windows, provenance, and hybrid graph retrieval.                                                          | Entity resolution and graph operations add work. Use it when time and relationships are first-order product requirements.    |
| [Letta](https://impli.me/neyHv6?ref=implicator.ai)       | 23,587 stars, Python, Apache-2.0                                      | Stateful agents with always-visible memory blocks plus searchable archival memory.                                                                                    | Core memory consumes prompt space on every call, so keep it small and push older material to archival search.                |
| [LangMem](https://impli.me/RM5pdp?ref=implicator.ai)     | 1,530 stars, Python, MIT                                              | LangGraph teams that want memory tools in the agent path or a background memory manager.                                                                              | The simple examples use in-memory stores. Production needs a persistent store and evaluations.                               |
| [Cognee](https://impli.me/Ufhh2a?ref=implicator.ai)      | 25,754 stars, Python, Apache-2.0                                      | Company-brain style ingestion with remember, recall, forget, and graph-backed search.                                                                                 | Test ontology quality on your own workload before accepting broad reasoning claims.                                          |
| [Supermemory](https://impli.me/BGtSGQ?ref=implicator.ai) | 27,944 stars, TypeScript, MIT                                         | Managed or local memory and context API with document memories, profiles, and graph relationships.                                                                    | Its leaderboard claims should be treated as vendor claims until reproduced in your own eval.                                 |
| [Qdrant](https://impli.me/TMx2lQ?ref=implicator.ai)      | 32,809 stars, Rust, Apache-2.0                                        | Default local vector store for the build-along and a credible path to cloud deployment.                                                                               | Embedding dimensions must match the embedder. OpenAI and local Ollama examples use different sizes.                          |
| [pgvector](https://impli.me/yxKEe9?ref=implicator.ai)    | 21,992 stars, C, Postgres extension                                   | Teams that already run Postgres and want vectors beside relational data, joins, backups, and access controls.                                                         | Large vector workloads require index tuning and database discipline, not just an extension install.                          |
| [agentmemory](https://impli.me/69paz3?ref=implicator.ai) | 24,316 stars, TypeScript, Apache-2.0                                  | Coding-agent session capture across Claude Code, Cursor, Codex CLI, and Gemini CLI, with local SQLite recall.                                                         | Automatic capture can retain secrets, abandoned assumptions, and source snippets. Audit hooks before use on sensitive repos. |

The build in this article uses Mem0 and Qdrant because it is the shortest route from blank folder to working recall. Graphiti belongs in the second test, especially if the product needs temporal facts. Letta belongs in the design discussion even when the team does not adopt it, because its core-memory versus archival-memory split is the cleanest mental model for what should always sit in the prompt.

The coding-agent projects are adjacent but instructive. agentmemory and codegraph are not general personal memory systems. They are evidence that memory is spreading sideways into the developer loop. Code context, prior bugs, generated diffs, tool calls, and repository symbols are all becoming state that an agent can retrieve instead of rediscovering. Developers are impatient because the pain is visible every morning: the agent re-reads the same files and repeats the same wrong assumption.

III — BUILD

## A complete local memory layer

Start with the simplest stack that can prove the point. One vector store. One memory client. One user. Three dated updates. A Friday question.

The demo tests four requirements. It should scope memory to one user. It should retrieve current facts. It should handle a contradiction between Monday and Thursday. It should inject a small packet into the prompt rather than replay the transcript.

Create the project folder:

```bash
mkdir ai-memory-demo
cd ai-memory-demo
mkdir src data
cat > .gitignore <<'EOF'
.env
.venv/
__pycache__/
data/
EOF

```

Start Qdrant locally:

```bash
cat > docker-compose.yml <<'EOF'
services:
  qdrant:
    image: qdrant/qdrant:latest
    ports:
      - "6333:6333"
      - "6334:6334"
    volumes:
      - ./data/qdrant:/qdrant/storage
EOF

docker compose up -d
curl http://localhost:6333/healthz

```

The expected response is short:

```text
healthz check passed

```

Install the Python dependencies:

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install mem0ai qdrant-client python-dotenv openai

```

Choose the hosted model path or the local path. The hosted route is easier for a first run:

```bash
cat > .env <<'EOF'
OPENAI_API_KEY=put-your-key-here
MEMORY_BACKEND=openai
EOF

```

For a local run, install Ollama separately, then pull a chat model and an embedding model:

```bash
ollama pull llama3.1:8b
ollama pull nomic-embed-text
cat > .env <<'EOF'
MEMORY_BACKEND=ollama
EOF

```

Now add a memory client. The configuration below is the entire local memory layer: Qdrant for storage, Mem0 for extraction and search, OpenAI or Ollama for the model and embeddings.

```python
# src/memory_client.py
import os
from dotenv import load_dotenv
from mem0 import Memory

load_dotenv()

def build_memory():
    backend = os.getenv("MEMORY_BACKEND", "openai")

    if backend == "ollama":
        return Memory.from_config({
            "vector_store": {
                "provider": "qdrant",
                "config": {
                    "collection_name": "ai_memory_demo",
                    "host": "localhost",
                    "port": 6333,
                    "embedding_model_dims": 768,
                },
            },
            "llm": {
                "provider": "ollama",
                "config": {
                    "model": "llama3.1:8b",
                    "temperature": 0,
                    "max_tokens": 2000,
                    "ollama_base_url": "http://localhost:11434",
                },
            },
            "embedder": {
                "provider": "ollama",
                "config": {
                    "model": "nomic-embed-text:latest",
                    "ollama_base_url": "http://localhost:11434",
                },
            },
        })

    return Memory.from_config({
        "vector_store": {
            "provider": "qdrant",
            "config": {
                "collection_name": "ai_memory_demo",
                "host": "localhost",
                "port": 6333,
                "embedding_model_dims": 1536,
            },
        }
    })

```

The dimension setting is the beginner trap. Mem0's OpenAI quickstart uses `text-embedding-3-small`, which is 1,536 dimensions. The Ollama path here uses `nomic-embed-text`, configured at 768 dimensions. If Qdrant receives vectors of one size and the collection expects another, inserts or search will fail.

Seed the memory with three sessions:

```python
# src/seed_memory.py
from memory_client import build_memory

m = build_memory()
USER_ID = "demo_alex"

turns = [
    [
        {"role": "user", "content": "I am Alex Rivera, founder of FinchLab. We build a CFO copilot for seed-stage SaaS companies. I prefer concise bullets and hate decorative dashboards. Our Friday demo is for a CFO persona. Avoid AWS because the client runs Azure."},
        {"role": "assistant", "content": "Understood. I will keep future demo planning concise and Azure-friendly."},
    ],
    [
        {"role": "user", "content": "Change of plan. The CFO persona is Miriam. She cares most about burn multiple, runway, and why the model made a recommendation. The demo moved to Friday at 10:30 a.m. Pacific. Use TypeScript snippets."},
        {"role": "assistant", "content": "I will tailor the demo around Miriam, burn multiple, runway, explainability, and TypeScript."},
    ],
    [
        {"role": "user", "content": "One more update. Do not use Azure in the demo after all. Keep it local with Docker and Qdrant. Use a dark-mode UI."},
        {"role": "assistant", "content": "Got it. The demo should be local with Docker and Qdrant, and use a dark-mode UI."},
    ],
]

for messages in turns:
    result = m.add(messages, user_id=USER_ID, metadata={"source": "demo_seed"})
    print(result)

```

Run it:

```bash
python src/seed_memory.py

```

Search before answering Friday's question:

```python
# src/search_memory.py
from memory_client import build_memory

m = build_memory()
USER_ID = "demo_alex"
query = "What should I remember before planning Alex's Friday CFO demo?"

results = m.search(query, filters={"user_id": USER_ID})
print(results)

```

The hits should include Alex, FinchLab, Miriam, burn multiple, runway, explainability, Friday at 10:30 a.m. Pacific, TypeScript, Docker, Qdrant, and dark mode. If Azure appears as current guidance, the memory layer has failed the contradiction test. It may mention Azure only as the superseded plan.

A prompt packet for the final answer should be dull and labeled:

```text
Persistent memory retrieved for this turn:
- Scope: user_id=demo_alex
- Use these facts only when relevant.
- If a retrieved fact conflicts with the user's current message, follow the current message and update memory after the turn.

<memories>
- Alex Rivera is founder of FinchLab.
- FinchLab builds a CFO copilot for seed-stage SaaS companies.
- Alex prefers concise bullets and dislikes decorative dashboards.
- The CFO persona is Miriam.
- Miriam cares about burn multiple, runway, and recommendation explainability.
- The demo is Friday at 10:30 a.m. Pacific.
- The demo should run locally with Docker and Qdrant, not Azure.
- The UI should use dark mode.
- Alex wants TypeScript snippets.
</memories>

```

Then the assistant can answer the real question:

```text
Show Miriam a 15-minute CFO workflow.

1. Start with one question: Which account puts runway at risk this quarter?
2. Show only burn multiple, runway, and cash impact.
3. Open one recommendation and expose the evidence trail behind it.
4. Show the local setup in one slide: TypeScript app, Docker, Qdrant memory store.
5. Close with the control point: the CFO can edit or delete remembered assumptions.

Do not show decorative dashboards. Keep the UI dark and the copy in concise bullets.

```

This is the whole test. A no-memory assistant asks who Miriam is. A memory-backed assistant gives the answer that Alex would expect after a week of work.

**Production rule:** Never let automatic extraction store secrets, health data, credentials, or sensitive inferences without a policy gate. A memory store deserves the same access control and deletion path as a customer database. 

For teams using the Mem0 managed API, the equivalent raw HTTP calls show the same shape. Add memory with a scoped entity:

```bash
curl -X POST "https://api.mem0.ai/v3/memories/add/" \
  -H "Authorization: Token $MEM0_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "demo_alex",
    "messages": [
      {"role": "user", "content": "I prefer concise bullets and local Docker demos with Qdrant."}
    ],
    "metadata": {"source": "article_demo"}
  }'

```

Search with the same scope:

```bash
curl -X POST "https://api.mem0.ai/v3/memories/search/" \
  -H "Authorization: Token $MEM0_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "How should I tailor Alex's demo?",
    "filters": {"user_id": "demo_alex"},
    "top_k": 8,
    "threshold": 0.1,
    "rerank": false
  }'

```

The managed add endpoint queues work. Do not assume a memory is searchable until the event finishes. That small operational detail is the kind that makes a demo feel broken even when the architecture is fine.

IV — ECONOMICS

## The business case is latency, scope, and deletion

Memory vendors often lead with accuracy charts. Buyers should start with unit economics and control. If an agent has to reread a full transcript for every turn, the cost line grows with history. If it searches a memory store and injects the eight facts that matter, the cost line grows with the retrieved packet.

Use the Mem0 LoCoMo table as a worked example, not a universal quote. The example below assumes a small product rather than a social network scale workload:

```text
100 users x 20 turns per day x 30 days = 60,000 turns per month

```

At the full-history figure in the Mem0 table, 26,031 input tokens per answer would push about 1.56 billion input tokens through the answer model during that month. OpenAI's listed GPT-5 mini input price of $0.25 per million tokens puts that history portion at about $390.47\. A 250-token answer on each turn adds another $30.00 at the listed $2 per million output-token price.

A memory-layer proxy changes the shape of the bill. The arithmetic is mechanical once the retrieved packet is smaller:

```text
Retrieved memory input: 1,764 tokens x 60,000 turns = 105.84M tokens = $26.46
Extraction input: 600 tokens x 60,000 turns = 36M tokens = $9.00
Extraction output: 120 tokens x 60,000 turns = 7.2M tokens = $14.40
Embeddings: 600 tokens x 60,000 turns = 36M tokens = $0.72
Answer output: 250 tokens x 60,000 turns = 15M tokens = $30.00
Rough total before storage and app overhead: $80.58

```

The exact figure will move with model choice, retry rates, and retrieval size. The important point is simpler: memory shifts the bill away from repeated full-history input and toward extraction, embeddings, search, storage, and audit.

Those figures are not a price sheet for a real product. They are a sanity check. The savings come from not sending the whole transcript every time. The new costs are extraction, embedding, search, reranking, storage, and memory operations. Product teams should run the same math with their own answer model, turn count, average memory packet, and retention policy.

$80.58 modeled monthly memory-layer cost across 60,000 turns, against roughly $420 for full history 

Backend costs depend on where the system runs. Local Qdrant costs the machine and the time to operate it. Qdrant Cloud lists a free tier with 0.5 vCPU, 1 GB RAM, and 4 GB disk. Pinecone's pricing page lists a Standard plan with a $50 monthly minimum after trial and storage at $0.33 per GB per month. Chroma Cloud offers a free usage-based entry plan and a Team plan priced at $250 plus usage. AWS prices S3 Vectors at $0.06 per GB-month for storage, $0.20 per GB PUT, and $2.50 per million query requests, with data processed and returned charged separately. MongoDB's Atlas pricing page lists M0 free, Flex from $0.011 per hour up to $30 per month, and dedicated clusters from $0.08 per hour or $56.94 per month; Atlas Search nodes sit on a separate line item.

The honest founder answer is narrow. A local demo is cheap. A small prototype can stay in free or low paid tiers. A production system pays for answer-model tokens, extraction tokens, managed vector or graph storage, observability, and the people who keep the memory clean.

Security teams will ask better questions than the benchmark slide. Who can write memory? Who can read it? Can a user inspect the exact fact used in an answer? Can they delete one memory without deleting the account? Does the system retain source quotes? Does it store inferred traits? How does it handle tenant separation? What gets logged when retrieval fails?

Memory makes those questions visible. A giant prompt usually hides them.

Smarter about AI in five minutes a day

Strategic AI news from San Francisco. No hype, no "AI will change everything" throat clearing. Just what moved, who won, and why it matters. Daily at 6am PST.

Email address 

Subscribe 

Check your inbox. Click the link to confirm.

No spam. Unsubscribe anytime.

V — TEMPORAL

## Graph memory starts when facts get dates

Vector memory is enough for many products. Store a fact, embed it, retrieve it with filters. The pattern works for preferences, project notes, prior decisions, and small user profiles. It struggles when the answer depends on what was true at a particular time.

Graphiti and Zep are worth studying because they make time explicit. Graphiti's README describes temporal context graphs with entities, facts or relationships, episodes as provenance, validity windows, and hybrid semantic, keyword, and graph retrieval. That lets a system represent a user's plan as something that can change without pretending the old plan never existed.

That matters in enterprise workflows. A bank's customer-risk status can change. A contract can move from draft to executed. A model evaluation can expire after a new release. A support case can close, reopen, and close again. A vector record can store each sentence, but the application still has to know which one is current. Temporal graph memory moves that burden into the model of the data.

Zep's vendor-authored paper reports strong LongMemEval numbers, with a large gap between full-context runs and temporal retrieval. The table gives the comparison this way:

- **GPT-4o-mini:** full context at 55.4% accuracy, 31.3 seconds, and 115,000 tokens; Zep at 63.8%, 3.20 seconds, and 1,600 tokens.
- **GPT-4o:** full context at 60.2%, 28.9 seconds, and 115,000 tokens; Zep at 71.2%, 2.58 seconds, and 1,600 tokens.

The table supports the product case for temporal retrieval, but it remains vendor research and should be replicated on the buyer's workload.

Letta belongs in the same conversation for a different reason. Always-visible memory blocks are expensive if they grow, but reliable if they stay small. An agent's identity, system role, and a handful of durable user preferences should not require search. Everything else can move to archival retrieval. That split is a design guardrail. It prevents product teams from stuffing a hidden essay into every prompt and calling it memory.

Supermemory adds another useful distinction: documents are not the same as memories. A PDF manual, a ticket archive, and a codebase are document retrieval. A user's stated preference, an account status, and a project decision are memory. The same product may handle both, but the policies differ. Documents need citations and freshness checks. Memories need user control and retention rules.

VI — RISK

## The risk is memory that remembers too well

Persistent memory creates institutional emotions. Developers feel relief when agents stop restarting from zero. Product managers feel vindicated because personalization becomes measurable. Security teams feel exposed because the system now has a durable record of what users told it. Legal teams feel cornered when product copy says the agent "remembers" but the deletion path is unclear.

The safety risk is not only a breach. It is an accurate memory used in the wrong moment. A personal assistant that keeps steering unrelated conversations back to a sensitive disclosure may be doing exactly what retrieval tells it to do. A coding agent that stores an abandoned workaround can keep resurrecting it after the team moved on. A customer-support bot that infers a user's condition from repeated messages may create a regulated-data problem even if no one typed the formal term.

> The safety risk is not only a breach. It is an accurate memory used in the wrong moment.

Good memory systems therefore need boring controls. Extraction prompts should reject secrets, sensitive attributes, generic greetings, and low-confidence inferences. Stored memories should carry source quotes, confidence, type, scope, timestamps, and retention class. Retrieval should filter by tenant and user before ranking. Injection should label facts as retrieved memory, not hidden truth. The answer policy should say current user instruction beats old memory. After the answer, the system should update or supersede stale facts rather than letting both versions compete forever.

A practical extraction prompt can be strict:

```text
You are a memory extractor. Extract only facts that may matter in future sessions.
Return JSON. Do not infer sensitive attributes. Do not store greetings or generic acknowledgments.
Resolve relative dates against OBSERVATION_DATE.

For each candidate, return:
- memory: one self-contained factual sentence
- type: preference | profile | plan | project | decision | event | constraint
- subject: user | assistant | organization | project
- scope: user_id | agent_id | app_id | run_id
- source_quote: the shortest exact quote supporting the memory
- confidence: high | medium | low
- operation: ADD | UPDATE | DELETE | NONE
- supersedes_memory_id: only if the new fact replaces an old one

If a new fact contradicts an old one, prefer the newest dated fact and mark the older one for DELETE or supersession.

```

Teams using Mem0 managed V3 should note the distinction between this general extraction pattern and the documented ADD-only managed add path. The prompt expresses the behavior a product may want. The API path determines where that behavior must live.

Memory also changes the competitive map. Model vendors want memory inside their consumer and developer products because it raises switching costs. Framework vendors want to own the extraction and retrieval layer because that is where application behavior lives. Vector database companies want the storage role. Agent-runtime companies want memory to be part of state, tools, and execution. Enterprises want control over all of it, which usually means self-hosting, private cloud, or at least exportable state.

No single project owns the stack yet. That is why the GitHub layer is so active. The market is still deciding whether memory is a feature, a database, a graph, a runtime, or a protocol. For the next year, it will be all of those at once.

VII — CHECKLIST

## What the complete stack should include

The minimum credible memory stack has eight parts.

First, it needs scope IDs before the first memory is written: user, agent, app, run, project, tenant, and environment. Retrofitting scope later is how memories leak across demos, teams, and customers.

Second, it needs typed memories. A preference is not a decision. A decision is not a document summary. A project constraint is not a personal trait. Different types should have different retention rules and retrieval weights.

Third, it needs source evidence. A memory without the quoted line that created it becomes hard to audit. Users and reviewers should be able to ask why the system believes a fact.

Fourth, it needs update and deletion paths. Contradictions are normal. People change jobs, projects change vendors, and demos move. The store has to mark current facts without losing the audit trail when history matters.

Fifth, it needs retrieval tests. The Alex and Miriam demo is one. A second test should check that an irrelevant user cannot retrieve Alex's memories. A third should check that a deleted memory does not return after re-indexing.

Sixth, it needs prompt discipline. Keep memory packets short, labeled, and scoped. Do not hide retrieved facts inside a giant system prompt. If the memory conflicts with the user's current message, current instruction wins.

Seventh, it needs observability. Log add events, search queries, retrieved memory IDs, injection packets, update operations, and deletion requests. Without those logs, a bad answer becomes a mystery.

Eighth, it needs a user-facing control surface. Show memories. Edit memories. Delete memories. Export memories. This is not just compliance hygiene. It is product trust.

The early version can be smaller. Mem0 plus Qdrant, a strict extraction prompt, a short injection template, and a delete button are enough for a prototype. The enterprise version adds temporal graph modeling, tenant-level policy, data residency, audit workflows, retention classes, and red-team tests.

The mistake is waiting for the model to solve all of that. It won't. The model call remains stateless. The memory layer is where the application becomes accountable.

> The model call remains stateless. The memory layer is where the application becomes accountable.

VIII — THESIS

## Synthesis

The memory argument is often framed as a contest against long context. That framing misses the product issue. A larger context window increases the amount of source material in the call. The memory layer carries ownership, age, retrieval policy and deletion rights.

Build the Mem0 and Qdrant demo first. Seed it with a contradiction. Search it with the right scope. Inspect what the assistant uses on Friday. If the result feels useful, add deletion. If deletion works, add source quotes and retention classes. If temporal state becomes the hard part, test Graphiti or Zep. If the agent identity and user preferences keep appearing in every call, study Letta's core-memory model.

The repos are already good enough for serious experiments. They are not settled enough for blind trust. Vendor benchmarks need replication. GitHub stars need skepticism. Automatic capture needs secret scanning. Local demos need production redesign before customer data arrives.

But the direction is clear. Agents that work across sessions need a durable state layer. The best one will not be the system that remembers the most. It will be the system that remembers the right thing, proves where it came from, forgets when told, and keeps the current plan ahead of last week's plan.

On Friday morning, the agent should not ask who Miriam is. It should open the right drawer, put nine facts on the desk, and get to work.

IX — SIGNALS

## What to watch

**Mem0** 

Whether V3 memory update and delete workflows become as simple as ADD by the end of 2026.

**Zep and Graphiti** 

Whether temporal graph memory gets independent LongMemEval or product-specific replications outside vendor papers.

**Letta** 

Whether stateful agent runtimes make always-visible core memory a common design pattern for enterprise agents.

**Vector stores** 

Whether Qdrant, pgvector, Chroma, Pinecone, and MongoDB converge on hybrid search plus metadata filtering as the default memory backend.

**Consumer AI products** 

Whether memory control surfaces improve from hidden settings pages to inspectable, editable timelines.

### Key Takeaways

- **Scope comes first:** User, agent, app, run, project, and tenant IDs should exist before the first memory is written.
- **Contradictions prove quality:** A useful memory test includes a changed plan, not only repeated preferences.
- **Graph waits for time:** Vector memory is enough until the product needs to know what was true when.
- **Core stays tiny:** Always-visible memory should carry identity and durable rules, while old facts belong in search.
- **Costs shift sideways:** Memory cuts repeated prompt tokens but adds extraction, embeddings, search, storage, and audit work.
- **Control is product:** Show, edit, export, and delete are not compliance extras when the system claims to remember.

Frequently Asked Questions

What is an AI memory layer, and how is it different from a bigger context window? 

A memory layer extracts durable facts from a session, stores them outside the model with scope and metadata, and retrieves only the relevant ones before the next answer. A larger context window just holds more text in a single call. Memory adds ownership, retrieval policy, and a deletion path that a raw prompt does not.

Should I start with Mem0, Graphiti, or Letta? 

Start with Mem0 plus Qdrant for the shortest path from a blank folder to working recall. Add Graphiti when the product needs temporal facts with validity windows and provenance. Study Letta when agent identity and durable preferences should sit in the prompt on every call rather than be retrieved probabilistically.

Does a memory layer always beat full context on accuracy? 

No. Mem0's own LoCoMo table shows full context scoring 72.9 on its judge metric, above Mem0 at 66.88\. The case for memory is latency, token cost, scope control, and deletion, not raw accuracy. Full context used 26,031 tokens and 17.117 seconds p95; Mem0 used 1,764 tokens and 1.440 seconds.

What is the hardest part to get right? 

Contradictions. Mem0's managed V3 add path is documented as asynchronous and ADD-only, so changed facts need separate update or delete logic, expiration, or linked-memory cleanup. A store that only appends eventually keeps a superseded plan beside the current one, and the application has to decide which is live.

What controls does a production memory store need? 

Scope IDs before the first write, typed memories, source quotes for audit, update and deletion paths, retrieval tests, short labeled injection packets, observability logs, and a user-facing surface to show, edit, export, and delete. In short, the same access control and deletion path a customer database already gets.

AI-generated summary, reviewed by an editor. [More on our AI guidelines](https://www.implicator.ai/about/).

### Sources & Further Reading

#### Primary Sources

- [Mem0 GitHub repository](https://impli.me/yVqUoy?ref=implicator.ai), open-source memory layer and benchmark claims.
- [Mem0 Python SDK quickstart](https://impli.me/KkqCQf?ref=implicator.ai), default client setup, add, and search examples.
- [Mem0 Qdrant docs](https://impli.me/RP8ibf?ref=implicator.ai), Qdrant provider configuration and dimension settings.
- [Mem0 V3 memory API docs](https://impli.me/dL4xWM?ref=implicator.ai), add and search behavior, filters, and defaults.
- [Graphiti GitHub repository](https://impli.me/IoBGeE?ref=implicator.ai), temporal context graph model, provenance, and validity windows.
- [Letta memory docs](https://impli.me/tyqQmo?ref=implicator.ai), memory blocks, archival memory, and context hierarchy.

#### Research & Analysis

- [LongMemEval paper](https://impli.me/jU8ply?ref=implicator.ai), benchmark for long-term interactive memory across five abilities.
- [Mem0 arXiv paper](https://impli.me/oMUF5S?ref=implicator.ai), vendor-authored LoCoMo token and latency table.
- [Zep arXiv paper](https://impli.me/yu1JNT?ref=implicator.ai), vendor-authored temporal graph memory evaluation.
- [OpenAI pricing docs](https://impli.me/XsqGES?ref=implicator.ai), token prices used in the cost model.

#### Further Reading

- [Claude Code Auto Dream](https://www.implicator.ai/anthropic-adds-auto-dream-to-claude-code-fixing-memory-decay-between-sessions/), how memory consolidation handles stale notes and contradictions.
- [The Memory Problem Nobody Solved Until Now](https://www.implicator.ai/the-memory-problem-nobody-solved-until-now/), Enzyme's Obsidian-based view of memory as a map of where to look.
- [Repo Radar: agentmemory](https://www.implicator.ai/repo-radar-5-github-projects-worth-your-week-4/), coding-agent memory as local session capture and recall.
- [Qdrant GitHub repository](https://impli.me/TMx2lQ?ref=implicator.ai), vector database used in the local setup path.
- [pgvector GitHub repository](https://impli.me/yxKEe9?ref=implicator.ai), Postgres extension for vector search in existing database stacks.