skip to content
$cat search-is-not-memory.md

Search Is Not Memory: The Layer AI Agents Lack

13 min readby MDflowview as .md
Disconnected emerald wireframe fragments on the left resolving into a single connected lattice threaded along a timeline on the right, on a dark terminal-grid background

Almost every "connect AI to your data" setup ships the same architecture. Embed the corpus, retrieve the top matching chunks, paste them into the prompt, generate. It works well enough that we stopped questioning it — right up until someone asks the assistant a question no single passage can answer, and it confidently produces a summary of the three chunks it happened to find.

The clearest articulation of why that happens came from an unexpected direction: video. In an AI Engineer talk, James Le of TwelveLabs laid out a distinction that turns out to be the whole problem in one line. Search is not memory.

TL;DR — Search recovers candidates; memory holds a durable, connected structure a system can traverse. Search answers "show me something like this." Memory answers "tell me what this collection knows." Most AI-plus-your-data stacks only ever built the first one, which is why agents can find a document and still can't tell you what your project decided. Building the second is not a model problem — it is five design decisions about what you preserve at write time: ingest once, store primitives, ground every claim, let intent shape memory, keep the layer composable. For a text corpus, you can satisfy all five with plain markdown. That is what MDflow is for. Start free.

What "search is not memory" actually means

Search recovers relevant items from a large library; memory preserves the relationships between them so a system can answer questions no single item contains. Le's framing is precise: search gives you candidates, and candidates carry no continuity.

The difference shows up in the shape of the output, not just the quality. Ask a search system a question and you get back a ranked list of matching fragments — a timestamp, a chunk, a passage. Ask a memory system the same question and you get structured knowledge: a timeline, the entities involved, how they relate, and an explanation with evidence attached. The unit of output changes from retrieval hit to corpus knowledge.

Le's examples come from video, where the gap is brutally obvious. A search index over a video archive can find every clip that looks like a goal. It cannot tell you how one player's involvement developed across a tournament, because that answer lives in the relationships between moments in different files, recorded on different days, from different cameras — and a top-k lookup has no representation of "between."

The same gap exists in text; it is just easier to paper over. Retrieval over your team's documents will happily find the four files that mention a migration. It will not tell you what the migration decided, what was rejected and why, or which of those four files superseded the others — because nothing in the index encodes supersession, and no chunk contains it.

Two questions, two architectures:

SearchMemory
Question it answers"Show me something like this""Tell me what this collection knows"
Unit of outputRanked chunksStructured knowledge: entities, timelines, relations
Where meaning is computedAt query time, by the model, from what fitsAt write time, once, into a durable structure
Handles "between" itemsNoYes — that is the whole point
Cost per new questionFull re-derivationTraversal of an existing structure

Why retrieval alone fails AI agents

Because retrieval recomputes understanding on every question, and understanding does not fit in the space between a question and an answer. Le identifies three failures in the standard stack, and all three survive the translation from video to text.

Wrong context. Forcing material into the shape the retriever prefers destroys the relationships that gave it meaning. In video, sampling frames and extracting a transcript throws away the spatio-temporal structure that defines an event. In a document corpus, chunking does the same thing to argument structure: a decision and its rationale land in different chunks, get retrieved independently, and arrive at the model as two unrelated facts.

Wrong memory. Text-system "memory" usually means a bigger context window or a vector store — both useful, neither durable. What is actually needed is continuity: the ability to link what you are looking at now to something recorded in another file, another quarter, another author's notes. A vector index has no notion of the same thing, seen again.

Wrong reasoning. A stateless model handed a pile of chunks does not automatically build a persistent structure of who did what and what changed. It produces an answer and forgets. Ask again tomorrow and it pays the full derivation cost again, possibly reaching a different conclusion — which is the inconsistency problem in a different disguise.

The uncomfortable corollary is the same one we reached in From Systems of Record to Systems of Context: adding another data source does not fix this. If five connected sources produce a generic answer, the sixth produces a longer generic answer. The missing layer is not another pipe.

The five principles of a memory layer

Le's five design principles are the useful, portable part of the talk. They were derived for video, and they read as a specification for any corpus an agent will reason over.

  1. Ingest once, reason many times. Pay the interpretation cost up front, at write time, rather than re-deriving meaning on every request. This is the database mental model: you do not rescan the source data for every query. For a knowledge base, the "ingestion" is a human or agent writing down what something meant, once, in a place that persists.

  2. Store primitives, not just answers. Keep the units — the moments, the entities, the decisions, the constraints — not only the polished summary. Primitives recombine into workflows you have not thought of yet; a summary can only be re-read. A decision log with the rejected options intact is a primitive. The paragraph in the launch post that says "we chose Postgres" is an answer.

  3. Ground every claim. Every assertion should point back to a specific, addressable source location. In video that is a timestamp inside a file. In a knowledge base it is a document URL and a version. Without it you have a plausible narrator; with it you have provenance, and a human can check the work.

  4. Let intent shape memory. The same material means different things in different workflows — Le's example is one video corpus serving sports analytics, brand safety, and compliance review, each needing different primitives. The memory layer should therefore be configurable by the people who know what matters, not fixed by whoever wrote the ingestion pipeline.

  5. Keep the layer composable. API-first, so the memory is infrastructure rather than a feature of one application. A memory layer only one product can read is not memory; it is that product's cache.

Le's implementation of these for video is a context graph — moments at the bottom, then appearances, then entities, then relationships, then corpus-level context at the top — because different questions traverse different parts of the structure. A simple lookup lands on a moment; an entity question starts at a person and expands into appearances; a narrative question follows relationships across time.

That layering is worth internalising even if you never build a graph. A memory layer is a navigable structure over your material, not a search index into it.

Which applications benefit most

  1. Engineering knowledge bases — where the valuable answer is almost never in one file. What was decided, what was rejected, which incident caused it, and which document superseded which.
  2. Long-running agent workflows — anything spanning days or many sessions, where each session otherwise restarts from zero and re-derives the same conclusions.
  3. Research and analysis — where the accumulated interpretation of sources is the asset, and every claim has to be traceable to a source.
  4. Support, on-call, and operations — runbooks and postmortems are pure memory-over-records: the alert is the record, the runbook is the structure that makes it actionable.
  5. Compliance and audit workflows — the domain where "ground every claim" stops being a nice property and becomes the requirement.
  6. Any team running more than one agent — the moment two agents must agree on what a project is, the shared structure has to live outside both of them.

How MDflow fits

MDflow is a memory layer for text that you author rather than infer. TwelveLabs builds the video version with encoders, a spatio-temporal store, and a graph — the right machinery for petabytes of footage. For a knowledge base, the equivalent structure can be written by hand in markdown, which means it is available this afternoon, is auditable, and needs no pipeline to warm up.

What already lines up today

Ingest once, reason many times — folder descriptions. Every folder in MDflow carries a description stating what its documents are for. It is a stored field you curate once, and it is load-bearing at query time: mdflow_get_context ranks folder descriptions above folder names and document titles when an agent asks about a topic. That is the ingest-once principle applied literally — you write the meaning down one time, and every agent on every future question is served it. See Folder Descriptions as Agent Context for how far this gets you without a vector database.

Store primitives — documents, not a rendered app. Documents are stored markdown-native, with no proprietary block model in between. Internal @mention links connect documents to each other, so a decision can point at the spec it implements and an agent can traverse instead of re-searching. Collections assemble a related set — a spec, its decision log, its glossary — without moving anything, so one document can belong to several structures at once. Since 0.22.0 you can also attach the source files a note is about, keeping the primitive and its evidence in one place.

Ground every claim — addressable, versioned documents. Every document has a stable address, and every shared document has a raw .md twin any tool or agent can fetch — this post included, at /blog/search-is-not-memory.md. Version history records what changed, when, and what it replaced, so an agent's citation resolves to something a human can open and verify rather than to a paraphrase.

Let intent shape memory — you write the descriptions. The configurability Le argues for is, in MDflow, just the fact that a person states the intent. Describe a folder as "architecture decisions and the incidents that drove them" and retrieval behaves differently from the same documents under "reference docs." Workspaces scope the outer boundary so one part of your work does not bleed into another.

Keep the layer composable — MCP, REST, and open discovery. The same corpus is reachable over a remote MCP server (OAuth sign-in for Claude and the ChatGPT app; a Personal Access Token for Cursor, Codex, and Claude Code), an HTTP API, a VS Code extension, and an n8n node — plus llms.txt, an agent card, and an OpenAPI spec so agents can discover the surface without being told. Crucially the write tools are real, so an agent that learns something can write it back instead of losing it when the session ends. That is what makes the layer compound rather than decay.

Where we are headed

Direction, not a dated commitment: serving a whole collection to an agent as one cross-linked context bundle rather than three separate retrievals; richer typed frontmatter so a document can carry status, owner, and freshness as structured signals an agent can weigh; and tighter review round-trips for agent-proposed updates, so a memory layer agents write to stays one a human can trust.

The bottom line

The industry built search, called it memory, and has spent two years surprised that agents cannot answer questions about a corpus they can search perfectly. Search recovers candidates. Memory preserves structure. The gap between them is the gap between an assistant that finds your documents and one that can tell you what your team knows.

Closing it is not a model upgrade. It is five decisions made at write time: pay the interpretation cost once, keep the primitives, make every claim citable, let the people who know what matters shape what is preserved, and expose the whole thing over an open interface. TwelveLabs implemented that as a context graph over video. For text, plain markdown — organised, described, linked, versioned, and reachable over MCP and an HTTP API — does the same job.

Start free · Connect an AI agent · Read the API docs

Frequently asked questions

What is the difference between search and memory for AI agents?

Search recovers candidates that resemble a query; memory holds a durable, connected structure the system can traverse. Search answers show me something like this and returns a ranked list of chunks. Memory answers tell me what this collection knows and returns structured knowledge: entities, timelines, relationships, and explanations that no single retrieval hop could produce. Search is a lookup; memory is a representation you build once and reuse.

Why isn't RAG enough for an AI agent?

Because retrieval-augmented generation recomputes understanding on every question. It fetches the top matching chunks and asks the model to reconstruct meaning from them in one pass, which works for questions a single passage can answer and fails for questions that span a corpus. Anything requiring continuity across documents, time, or sources needs structure that was preserved at write time, not inferred at query time.

What are the five principles of a memory layer?

Ingest once and reason many times, so expensive interpretation is paid up front rather than per query. Store primitives, not just answers, so downstream workflows can recombine them. Ground every claim in a citable source location. Let intent shape memory, because the same material means different things in different workflows. Keep the layer composable and API-first, so any application can build on it. These were set out by James Le of TwelveLabs for video intelligence, and they generalise to any corpus.

Do I need a graph database to give an AI agent memory?

No. A graph is one implementation of a memory layer, and a good one at large scale. The properties that matter are durability, connectivity, and citability. A well-organised markdown corpus with explicit folder descriptions, internal links between documents, and stable URLs per document satisfies all three, is readable by every model without a schema, and can be adopted in an afternoon.

How do I make my notes function as agent memory rather than just search results?

Write down the connective tissue, not just the facts. Give every folder a description that states what its documents are for, link related documents to each other so an agent can traverse rather than re-search, keep the primitives instead of only polished summaries, and store everything where each document has a stable address an agent can cite. In MDflow that is markdown documents with folder descriptions that rank first in retrieval, internal document links, and a raw .md twin for every shared document.

Further reading