Sub topic 2
Where AI answers get their information: model memory and retrieval
This chapter assumes you know how search engines and websites work, you have a general idea of what a large language model (LLM) does, and you can read basic JSON and Python. It builds the model that the rest of the tutorial relies on. An AI answer about your brand comes from one of two places, or from a mix of both. Which one applies decides which of your actions can change the answer, and how fast.
The two sources
An AI assistant draws on two kinds of information when it answers.
- Parametric knowledge is what the model absorbed during training and stored in its weights, the numeric parameters that make up the network. It is "memory". The model does not look anything up. It produces text shaped by patterns it learned.
- Retrieved content is text fetched at the moment of the question, from a search index, a web crawl, a document store, or a tool, and placed into the model's input. The model then writes an answer using that text. The approach is called retrieval-augmented generation (RAG), and the act of tying the answer to the fetched text is called grounding.
The two behave very differently from a brand's point of view.
| Property | Parametric knowledge | Retrieved content |
|---|---|---|
| Where it lives | Inside the model weights | In the prompt, fetched per question |
| Freshness | Fixed at the training cutoff | As fresh as the index or crawl |
| Can you see the source? | No | Often, as citations or links |
| How fast can you change it? | Only with the next model version | Days to weeks, as pages are recrawled |
| Typical failure | Outdated, vague, or confidently wrong claims | Wrong or weak page retrieved, or good page ignored |
| Main brand lever | Long-term presence across many sources | Being findable and clearly written for the retriever |
How parametric knowledge works
During training the model reads very large amounts of text and learns to predict what comes next. It does not store documents as a database stores rows. It compresses statistical regularities: which names appear near which topics, which facts follow which phrases.
Three consequences matter for brands.
- Frequency and consistency help. A brand that appears often, in many independent places, with the same name and the same description, leaves a stronger trace than one mentioned rarely.
- There is a cutoff. Anything that happened after training ended is unknown to the model unless retrieval supplies it. A rebrand, a new product, or an acquisition may be missing or wrong.
- Recall is lossy. The model may blend two similarly named companies, attach a feature to the wrong vendor, or invent a plausible detail. This failure is often called hallucination. Obscure entities are more at risk, because the model has fewer examples to anchor on.
You cannot inspect the weights to see what the model "knows" about you. You can only sample its outputs, which is why the measurement chapter later uses repeated sampling.
How retrieval works
Retrieval systems vary, but most follow the same sequence.
- The system reads the user's question and decides whether it needs outside information.
- It turns the question into one or more search queries. These are often rewritten and are not the user's exact words.
- It fetches candidate pages or passages from a search index or other store.
- It ranks them, and keeps a small number of passages that fit within the model's context window, the limited amount of text the model can read at once.
- The model writes an answer from those passages plus its own memory, often adding citations.
Step 1 is easy to overlook. Many assistants answer from memory when they judge the question to be general knowledge, and search only when it looks time-sensitive, local, or specific. A question like "what is a CRM?" often needs no search. "Best CRM for a 20-person agency in 2026" usually triggers retrieval.
Most real answers are hybrid
Pure memory and pure retrieval are the two ends of a range. Typical products sit in between:
- A chat assistant with web search turned off answers from memory only.
- The same assistant with search on may use memory to understand the question and to fill gaps, and retrieval for specifics.
- An AI summary at the top of a search results page is usually strongly grounded in the pages the search engine already ranks.
- An enterprise assistant over internal documents is grounded in those documents and has no view of your public footprint.
So "what does AI say about my brand?" has no single answer. It depends on the product, the settings, and the exact question. Treat each combination of product and mode as a separate system to observe.
Telling the two apart in practice
You cannot see inside the process, but you can look for signals.
- Citations or links in the answer indicate retrieval was used. Their absence suggests memory, though not always.
- Recent facts such as this month's pricing or a news event point to retrieval.
- Same answer with search toggled off shows how much comes from memory.
- Different answers to the same question across runs are normal. Sampling randomness and changing search results both cause variation.
The script below applies the first signal to saved answers. It counts how many contain at least one URL, as a rough proxy for "grounded". It is a heuristic. Some products cite sources in a separate field that is not part of the answer text, and some answers quote URLs that were not retrieved.
import re
URL_PATTERN = re.compile(r"https?://[^\s)\]>\"']+")
def classify(answer):
urls = URL_PATTERN.findall(answer)
return ("likely_retrieval" if urls else "likely_memory", urls)
saved_answers = [
"Example Analytics offers dashboards. Source: https://www.example.com/product",
"Many teams use ExampleAI for reporting.",
"Rival Corp is an alternative (see https://reviews.example.org/rival-corp).",
]
summary = {"likely_retrieval": 0, "likely_memory": 0}
for text in saved_answers:
label, urls = classify(text)
summary[label] += 1
print(label, urls)
print(summary)Running it prints one line per answer, then {'likely_retrieval': 2, 'likely_memory': 1}. The numbers only become meaningful when you run it over many answers, collected the same way, for a fixed set of prompts.
What this means for brand work
The split tells you which levers to use for which goal.
- For retrieval-driven answers, the question is whether a retriever can find a page about you and whether the passage is clear enough to be used. Pages that state who you are, what you do, and for whom, in plain sentences, are easier to quote. Fast changes are possible here, because a page that was not indexed yesterday can be indexed next week.
- For memory-driven answers, the question is whether the open web contains many consistent, independent descriptions of you. That is slow. You do not control when a new model is trained or what it includes, and changes appear only when a new model version ships.
- For both, an unambiguous name helps. A retriever searching for a vague or shared name returns the wrong company's pages. A model with a blurred memory of the name merges identities. Later chapters on naming, structured data and third-party corroboration build on this.
Retrieval can also correct memory, but not always. If the model has a strong prior that your product is something it is not, a retrieved page that says otherwise may be outweighed or ignored, especially if the page is not clearly authoritative.
Common errors in reasoning
- "Our site ranks, so the AI will mention us." Ranking helps retrieval, but the model decides what to include. Being retrieved is necessary for grounded mentions, not sufficient.
- "We updated the site, so the model knows." Updating pages affects retrieval soon and memory only after retraining. If the product has search off, nothing changes.
- "One test prompt proves it." Outputs vary. One answer is an anecdote. Use many phrasings and several runs.
- "The AI is wrong about us, so retrieval is broken." The cause could be memory, a poor retrieval query, or a good page that was outranked. Separate the cases by toggling search where possible and reading the citations.
- "Citations mean the facts are verified." They do not. See the callout above.
Edge cases
- Long-tail brands. A small brand with little coverage may be absent from memory entirely. Retrieval is then the only route, and only works when the user's question names the brand or a close category match.
- Category questions versus name questions. "What is Example Analytics?" asks about a known name and can lean on both sources. "What are good analytics tools?" asks the system to choose names, and that choice leans heavily on memory and on whichever pages the retriever surfaces for the category.
- Personalisation and location. Some products tailor retrieval to location or history. Two people can see different answers.
- Blocked crawlers. If your site blocks the crawlers that feed an AI product, your own pages may not be retrieved, while third-party pages about you still are.
Exercise
A marketing lead says: "We rewrote our About page last week. ChatGPT-style assistants with web search on now describe us correctly, but the same assistant with search off still gives the old description. Why, and what does each result tell us?"
Show answer
With search on, the assistant retrieves live pages, so the rewritten About page can be fetched and used within days. With search off, it answers from parametric knowledge, which was fixed at training time and still holds the old description. The first result shows retrieval is picking up the new page. The second shows memory has not changed and will only change with a new model version trained on data that includes the updated, consistent description. The fix for memory is long-term, consistent presence across many independent sources, not editing one page.
Exercise
You run your 30 test prompts and find that 25 answers contain URLs and 5 do not. Is it safe to conclude that 83% of the answers were grounded in retrieved content? Give two reasons for your answer.
Show answer
No. First, URLs in the answer text are only a heuristic. Some products show sources in a separate panel, so an answer with no URL may still have been retrieved, and a model can write a URL from memory that was never fetched. Second, a cited page does not prove the claim came from that page, so "grounded" in the sense of "supported by the source" needs manual checking of a sample. The figure is better described as "the share of answers that include links", and it is only comparable across runs if you hold the product, settings and prompts constant.