8 min Read it, listen to it, or follow along with both.

Listen along, in my voice

Cloned from a recording of me. My agents regenerate it whenever this chapter changes.

Every company wants the same thing eventually: a system that knows what the company knows. It is the most requested project and the most reliably disappointing one, and the reason is almost never the model.

Separate three things that all get called memory, because they have different solutions and people conflate them constantly.

How retrieval actually works

You cannot put twelve years of documents in front of a model. So the pattern is fetch, then answer. Find the handful of passages likely to be relevant, put those in front of the model, and ask it to answer from them. Fetch, then answer.

The plumbing has four parts, and each one is a place things go wrong:

  1. Chunking. Documents get cut into passages. Cut them badly and a table gets separated from its heading, or a clause from the contract it modifies.
  2. Embedding. Each passage gets converted into a position in a mathematical space where similar meanings sit near each other. This is what lets a search for "termination terms" find a passage that says "either party may end this agreement."
  3. Search. A question gets converted the same way, and the nearest passages come back. Meaning-based search alone is bad at exact strings like part numbers, so serious systems run keyword search alongside it and merge the results.
  4. Reranking. A second, slower pass reorders the candidates by actual relevance. Skipping this is the most common cheap mistake.

The thing to internalize

Almost every failure of one of these systems is a retrieval failure, not a model failure. The model answered correctly from the wrong five paragraphs.

This matters for how you respond when it goes wrong. The instinct is to change the model or rewrite the prompt. The useful move is to look at what was actually retrieved for the failing question. Nine times in ten, the right passage was not in the set, and no model can answer from material it was not shown.

The governance problem nobody mentions in the demo

Here is the part that should stop a project until it is answered, and it is specific to this pattern.

Your company's documents have permissions on them. Some folders are HR only, some are finance only, some are for one team. When you index everything into a retrieval system, you have built a copy of the company's knowledge with the permissions stripped off. Ask it a question and it will happily answer from a document the asker was never allowed to open. Nobody broke in. The system worked as designed.

There are two honest ways to handle this and one dishonest one.

The question to ask any vendor selling you a company brain. How do document permissions survive indexing, and what happens when someone's access is revoked on a Friday afternoon. If the answer involves the word prompt, the answer is no.

Documents, graphs, and the middle ground

Plain retrieval over passages is good at questions whose answer sits in one place. It is bad at questions that require connecting things: how a decision made in one project affected another, or every contract that shares a particular clause.

The alternative approaches extract entities and relationships into a structure first, so the system can traverse connections rather than only matching text. This works, and it costs more to build and considerably more to maintain, because the structure has to be rebuilt as the underlying material changes.

My honest read is that most companies asking for the sophisticated version have not exhausted the simple one. Good chunking, hybrid search, and reranking over a curated set of documents would get them eighty percent of the value. Start there, measure what fails, and let the failures justify the complexity. The failures will be specific and you can point at them, which is a much better basis for spending money than a diagram.

The unglamorous part that decides the outcome

The strongest predictor of whether one of these projects works is not the technique. It is whether the source material is any good.

If your documentation holds four versions of the same policy with no dates, a system built on it will cite the wrong one. It will do so in a tone that sounds authoritative. Retrieval has no opinion about which of your documents is current.

So before indexing anything, do the boring work. Pick the authoritative source for each topic and mark it. Date everything. Archive superseded versions out of the index. Give each area an owner. This is a documentation project wearing an AI project's clothes, and saying so early is more honest than discovering it in month three.

Where it should live

Three questions decide this, and only the third is technical:

One durable principle regardless of where it lives: keep the index rebuildable from the sources. If the retrieval layer is the only place some piece of knowledge exists, you have turned a convenience into a system of record. People will treat it as one.

Revision trail

Aug 10
New chapter. The guide previously covered memory only as an agent property and never addressed company knowledge at all.
Aug 10
Permissions-through-retrieval written as its own section rather than a caveat.