AI agents
Semantic Memory and Knowledge Stores
Design durable facts, procedures, concepts, and reference material for retrieval by agents.
By the end you can
- Define semantic agent memory as an operational contract rather than a capability label
- Contrast Document corpus with Structured store in “An operations agent followed a correct procedure with an expired threshold”
- Trace “Semantic similarity can retrieve a policy that no longer applies” through a concrete execution path
- Produce “Publish one memory item responsibly” with evidence for “The agent can identify the authoritative and current source for a retrieved claim”
Visual
A stored fact needs authority and validity before retrieval
Knowledge unit, Authority, Validity, and Retrieval view are what a stored fact needs before it can be safely returned. The Retrieval view and the Change history should stay with different owners and different tests.
Authority is the box that looks decorative until it is missing. Google's AI Overviews launched at I/O in May 2024. Within a fortnight it was returning answers drawn from a satirical Reddit comment, and from satirical content republished on a geological software provider's website. Google acknowledged the failures on 30 May 2024. Elizabeth Reid, its head of Search, wrote: “Forums are often a great source of authentic, first-hand information, but in some cases can lead to less-than-helpful advice, like using glue to get cheese to stick to pizza.” She listed the fixes: better detection of nonsensical queries, limits on satire and humour content, limits on user-generated content, and extra triggering restrictions. The Associated Press counted “more than a dozen technical improvements” the next day.
Read the failure against the diagram. The passages retrieved were the closest topical match available — a data void. The Retrieval view had no field for who is entitled to define the information. So a joke forum post and a republished satire came back as fact. Nothing in the pipeline asked the Authority question. Nothing in the store could have answered it.
- 1
Knowledge unit
A fact, rule, procedure, schema, or concept with explicit scope.
- 2
Authority
The owner or source entitled to define the information.
- 3
Validity
Effective date, expiry, jurisdiction, product version, or environment.
- 4
Retrieval view
Indexes and metadata that make the unit discoverable.
- 5
Change history
Supersession, conflict, correction, and retirement records.
Example
A retrieved number loses to a memorised one at least 83% of the time
The runbook case has been run as a controlled experiment. The case is an approved procedure whose embedded numeric limit has been superseded, retrieved because semantic fit outranked effective date. Longpre and colleagues built the test in 2021. Their framework rewrites the retrieved passage so that it contradicts what the model memorised in training, then counts how often the model answers from memory anyway. They call that a “memorization ratio”.
Generative QA readers frequently ignored the retrieved passage in favour of the training-time answer. The ratio rose from under 15% to at least 50% as the T5 reader scaled from small (60M) to XXL (11B) parameters. Scale did not fix the conflict. It deepened the model's confidence in itself.
Numbers were the worst case of all: “The most striking result is when a numeric entity is replaced with a textual one; at least 83% of the time the model predicts the Original answer.”
That is the expired-threshold failure with a rate attached. An out-of-date limit sitting in the store is only the first half of the problem. The second half is that a numeric limit is exactly the kind of token the model is most willing to supply from memory, even when the corrected passage is sitting in its context.
- Decision at stake: Design durable facts, procedures, concepts, and reference material for retrieval by agents — knowing the retrieved text has to win an argument against what the model already believes.
- Hidden assumption: Embedding similarity determines which policy is legally controlling — and, underneath it, that a retrieved number displaces a memorised one.
- Primary control question: Semantic similarity can retrieve a policy that no longer applies, and at XXL (11B) scale the reader answered from memory rather than the substituted passage at least 50% of the time.
- Evidence to collect: The agent can identify the authoritative and current source for a retrieved claim — tested with substituted entities, because numeric answers reverted to the memorised original at least 83% of the time.
A vector index returns neighbours, not authority
Semantic memory contains reusable knowledge rather than one episode: product facts, definitions, policies, procedures, schemas, and domain relationships. It may live in databases, documents, graphs, search indexes, or versioned configuration.
Knowledge stores need ownership, effective dates, authority, contradiction handling, and retirement. Embedding retrieval alone cannot establish which statement is current or controlling.
The separation is older than the current tooling. Lewis and colleagues described retrieval-augmented generation in 2020 as “models which combine pre-trained parametric and non-parametric memory for language generation”. The non-parametric half was a dense vector index of Wikipedia, reached through a neural retriever. AWS states the same separation operationally: RAG is “the process of optimizing the output of a large language model, so it references an authoritative knowledge base outside of its training data sources before generating a response.”
How much work the outside store is doing can be measured. FreshQA is a 600-question benchmark, graded with more than 50K human judgments, splitting its questions into never-changing, slow-changing, fast-changing and false-premise. Vu and colleagues published it in 2024. On the fast-changing and recent-knowledge questions the paper reports: “While GPT-4 generally obtains the highest accuracy on these questions, it never exceeds 15% in both evaluation modes.” The two modes are RELAXED and STRICT. GPT-4 stayed under 15% in both. It also refused to answer fast-changing questions 60% of the time, against 16% for ChatGPT.
That is the size of the hole a knowledge store exists to fill. The store is authoritative because someone maintains it. A vector index returns neighbours, not authority.
Contradictions do not resolve themselves: without an owner entitled to say which statement supersedes which, the store will keep serving both.
Comparison
Contrasting implementations of semantic agent memory
Where the knowledge sits — a Document corpus, a Structured store, or Model weights — decides how hard it is to correct. Hold each of them against one question. Can a claim that comes back be traced to the source that governs it now, and not merely to a source that governed it once? The failure mode is shared. Semantic similarity can retrieve a policy that no longer applies, because a retired rule still reads as relevant as the one that replaced it.
The weights column is the one teams most often treat as merely inconvenient to update, on the theory that a fact can be edited in place when it changes. RippleEdits tested that theory. It is a diagnostic benchmark of 5K factual edits — 2,000 “recent”, 1,000 “random” and 1,000 “popular” — and it checks whether editing one fact in a model's weights propagates to the facts logically implied by it. Cohen and colleagues published it in 2024. Prominent weight-editing methods failed to introduce consistent changes. A simple in-context, retrieval-style editing baseline obtained the best scores.
So “hard to update or cite” is not a matter of engineering convenience. An edited weight can leave the entailed facts contradicting the edit. No item-level authority exists to tell you which of the two you just retrieved.
Document corpus
Knowledge remains in authored files and passages.
- Preserves context
- Hard exact updates
- Needs chunking
Structured store
Facts and rules use schemas, tables, or graphs.
- Precise queries
- Modeling cost
- Clear versioning
Model weights
Some knowledge is implicit in the underlying model.
- Low retrieval latency
- Hard to update or cite
- No item-level authority
Key idea
Semantic similarity can retrieve a policy that no longer applies
A highly relevant passage may be draft, expired, local to another region, or contradicted by a newer source. Ranking a passage highly cannot settle whether it is still valid.
Law is the domain where authority and effective scope are most formally defined, and it has been audited. The first preregistered evaluation of commercial retrieval-augmented legal research tools was published in 2025 by Magesh and colleagues. LexisNexis's Lexis+ AI, Thomson Reuters's Westlaw AI-Assisted Research and Ask Practical Law AI each hallucinated between 17% and 33% of the time. On accuracy, Lexis+ AI answered 65% of queries accurately, against 41% for Westlaw AI-Assisted Research and 19% for Ask Practical Law AI.
The authors name the assumption that breaks. General-purpose RAG evaluations presume retrievable documents are authoritative and applicable. In their words, “Legal documents often contain outdated information, and their relevance varies by jurisdiction, time period, statute, and procedural posture.” Jurisdiction, time period, statute and procedural posture are validity metadata. None of them are visible to a similarity score.
Filter by authority and effective scope before semantic ranking, then surface conflicts rather than silently merging them.
Rank order describes wording, not standing, and an agent that confuses the two will quote an expired passage with perfect confidence.
Steps
Publish one memory item responsibly
Publishing one memory item responsibly is a small enough exercise to finish and a strict enough one to fail. A single item already forces the two decisions that matter: where the claim comes from, and when it stops being true. Write it so a reader can follow it back to the document it rests on. Write it so that once that document has been superseded, the item surfaces as out of date rather than as a close match.
The “Build retrieval tests” step has two published metrics behind it, so it does not have to be scored by impression. Four generative search engines — Bing Chat, NeevaAI, perplexity.ai and YouChat — were audited by human evaluation in 2023. The finding: “on average, a mere 51.5% of generated sentences are fully supported by citations and only 74.5% of citations support their associated sentence”. Liu and colleagues call those two quantities citation recall and citation precision.
Run the same two counts on the answers your own item participates in. Citation recall asks what share of generated sentences are fully supported by the citation attached to them. Citation precision asks what share of the citations actually support the sentence they hang on. Both are computable by hand on a few dozen answers. Together they are the concrete form of the evidence line for this lesson: the agent can identify the authoritative and current source for a retrieved claim.
- 1
Define the unit
Choose the smallest fact or procedure that can be governed coherently.
- 2
Assign ownership
Name the source and role authorized to update it.
- 3
Add validity metadata
Include dates, versions, regions, and supersession links.
- 4
Build retrieval tests
Use current, historical, conflicting, and out-of-scope queries.
- 5
Plan retirement
Remove obsolete content from default retrieval while preserving required audit history.
Filing the new rule beside the old one retires nothing
Separate memory systems by update and authority requirements. A policy store should not behave like a personal preference log. The moment that tests the separation is a rule change. Whoever maintains the store has to go back and retire the old text, not just file the new one alongside it.
NIST shows what that looks like when someone owns the store. Special Publication 800-53 Rev. 4 dates from April 2013, including updates as of 22 January 2015. Rev. 5 superseded it on 23 September 2020. It was then formally withdrawn, on 23 September 2021. The archived PDF was re-issued behind a warning notice: “The attached publication has been withdrawn (archived) and is provided solely for historical purposes. It may have been superseded by another publication (indicated below).” The notice carries the withdrawal date, the withdrawal note, and the superseding publication by name: SP 800-53 Rev. 5.
Everything the diagram calls Change history is on that one cover page. A supersession date, a retirement date, a pointer to the document that replaced it, and the old text still readable for anyone who needs the historical record. The old revision was not deleted. It was demoted, in a way a retrieval pipeline can read. The property to protect through every such change is that the agent can identify the authoritative and current source for a retrieved claim.
One store for everything means the rule that must change the day it changes inherits the update habits of notes nobody ever revisits.
Key takeaways
- Semantic memory contains reusable knowledge rather than one episode: product facts, definitions, policies, procedures, schemas, and domain relationships.
- Knowledge stores need ownership, effective dates, authority, contradiction handling, and retirement. On FreshQA's fast-changing questions GPT-4 never exceeded 15% accuracy in either the RELAXED or the STRICT mode, and refused 60% of them.
- A knowledge unit is a fact, rule, procedure, schema, or concept with explicit scope. It also has to beat the model's memory: when a numeric answer was replaced by a textual one, the reader returned the memorised original at least 83% of the time.
- Authority is the owner or source entitled to define the information; AI Overviews had no such field in May 2024 and served a satirical Reddit comment as an answer.
- Filter by authority and effective scope before semantic ranking, then surface conflicts rather than silently merging them — audited legal RAG tools still hallucinated between 17% and 33% of the time.
- Separate memory systems by update and authority requirements: NIST superseded SP 800-53 Rev. 4 on 23 September 2020 and withdrew it on 23 September 2021, keeping the old text behind a warning notice rather than beside the new one.