For the complete documentation index, see llms.txt. Every page on this site is also served as Markdown: append `.md` to any URL, or send `Accept: text/markdown`.
Skip to content

Glossary term

RAG (retrieval-augmented generation)

RAG, retrieval-augmented generation, is how most AI answers that cite pages are built: the system retrieves relevant documents, puts the best passages in the model's context, and has the model write from them. ChatGPT search, Perplexity and AI Overviews work this way, so a page can be quoted the day it is retrieved.

7 days free · card required

Answer · Perplexityasked

Question: how does AI pick which sources to cite

Perplexity answered: AI sources are selected via retrieval-augmented generation: the system searches, retrieves relevant pages, and attaches citations to specific, verifiable claims. Selection emphasizes relevance, credibility, timeliness, and extractable, checkable passages.

Sources cited

  1. 1airops.com
  2. 2truescreen.io
  3. 3cite.solutions
  4. 4contextbolt.com
  5. 5aipogeo.com
  6. 6wellows.com
  7. +3 more

Not namedAttensira is missing from this Perplexity answer.

Analyst agentAnalyst · reads this workspace's answersattensira.com workspace, read over the Attensira MCP · · 1 stored answer, Perplexity, 2026-10-03
Karl-Gustav KallasmaaKarl-Gustav Kallasmaa, Founder & CEO

Last updated

Key facts

Ask ChatGPT a question with search on and watch the sources panel fill before the answer appears. That is retrieval-augmented generation: the system looks things up, and the model writes from what it found. Almost every AI answer that cites a web page is built this way, which makes RAG the mechanism behind AI visibility.

How does a RAG pipeline work?

Five stages, and a page can be lost at each one:

  1. Query. The question is turned into one or more search queries. Engines often split a question into several.
  2. Retrieve. Each query runs against an index, by keywords, by meaning through vector search, or both. This returns candidates, often dozens.
  3. Rerank. A second, more careful model scores the candidates against the question and keeps the best few. See reranking.
  4. Fill the context. The winning passages, not whole pages, go into the model's context window alongside the question.
  5. Generate. The model writes the answer from those passages and attaches the pages it used.

The unit that moves through the pipeline is the passage. A page with one paragraph that answers the question on its own competes better than a page whose answer is spread across three sections.

What does retrieval look like in real answers?

Take one question from our own tracking: "how does AI pick which sources to cite", asked of ChatGPT and Perplexity every day. Perplexity's reply of 3 October 2026 opened: "AI sources are selected via retrieval-augmented generation". In the 30 days to 4 October 2026, read over the Attensira MCP, ChatGPT gave 57 answers carrying 1,204 citations and Perplexity 42 answers carrying 397; on ChatGPT, help.openai.com took 31.0% of the citations and openai.com 18.9%, while Perplexity's top domain, aisearch.similarweb.com, took 10.3%.

Same question, two retrieval systems, two different bodies of evidence. ChatGPT answers a question about how AI cites sources mostly from OpenAI's own help and product pages, 31.0% of its citations to help.openai.com alone. Perplexity spreads its evidence across third-party marketing and research sites, with fewer links per answer. Neither engine cited our pages for this question.

That is the practical meaning of RAG for a brand: there is no single "AI" to optimise for. Each engine's retriever decides what its model is allowed to read, and the answer can only be as good as, and only as favourable as, what was retrieved.

Does every engine retrieve the same evidence?

No. One question we track, asked of two engines for 30 days, drew on two different bodies of evidence. ChatGPT read OpenAI's own help pages and linked about 21 sources per answer; Perplexity spread fewer links across third-party sites. Neither cited attensira.com.

Citations behind "how does AI pick which sources to cite", 30 days to 4 Oct 2026
  • ChatGPT

    Answers
    57
    Citations
    1,204
    Most-cited domains
    help.openai.com 31.0%, openai.com 18.9%
  • Perplexity

    Answers
    42
    Citations
    397
    Most-cited domains
    aisearch.similarweb.com 10.3%, cite.solutions 8.3%
Analyst agentAnalyst · reads this workspace's answersattensira.com workspace, read over the Attensira MCP · · 99 answers, 1,601 citations

Why does RAG matter more than training for most brands?

Because it is the path you can act on. Training data is collected on the operator's schedule and used in a model you cannot inspect. Retrieval happens every time a question is asked, reads the page as it is today, and shows its work in the citations. Fix a page and the next retrieval can use the fixed version.

It also explains a common surprise: a brand can be named often and cited rarely, or the other way round. The model may know you from training and never retrieve your pages, or retrieve your page for a fact and recommend someone else.

What does a page need to survive the pipeline?

  • Be fetchable. The engine's search crawler must be allowed and must get the text in HTML, without running JavaScript.
  • Be retrievable for the question. Use the words buyers use, and cover the question directly, so both keyword and meaning-based retrieval find it.
  • Have a passage that stands alone. Put the answer in the first lines under a heading that asks the question.
  • Agree with other sources. A claim several pages make is safer for the model to use.

What do people get wrong about RAG?

  • Thinking ranking first in Google is enough. Engines retrieve with their own queries and indexes.
  • Optimising whole pages. The model reads passages.
  • Treating a citation as proof of accuracy. Retrieval and writing fail separately.
  • Assuming a big context window removes competition. Something still chooses what goes in.

How does Attensira work with RAG?

It reads the output of each engine's pipeline, every day: the full answer and every citation in order. From that it ranks the pages that decide each question by citation share and position, marks whether you are on each one, and the crew proposes the next move: fix your own page so it has the passage the engine needs, or earn a place on the third-party page it already reads. See win this answer for how the deciding pages are ranked.

Questions about RAG (retrieval-augmented generation)

What is RAG in simple terms?
Look it up, then answer. Instead of answering only from what it memorised in training, the system searches a collection of documents or the web, picks the passages that fit the question, gives them to the model, and the model writes an answer from them, usually with links to where each part came from.
Where does the term RAG come from?
From a 2020 paper, Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, by Patrick Lewis and colleagues at Facebook AI Research, University College London and New York University. It combined a language model with a searchable index of Wikipedia passages.
How is RAG different from training a model on my content?
Training changes the model's weights once and leaves no record of which page taught it what. RAG reads your page at answer time, so the passage it used exists, can be cited, and changes when you edit the page. Training takes a new model release; retrieval can reflect a change within days.
Does a bigger context window make RAG unnecessary?
No. A context window is finite and the web is not, so something still has to choose which passages go in. Putting more text in also makes it harder for the model to use the right part, so selection stays the step that decides what gets quoted.
Why does a RAG answer sometimes cite a page it misread?
Because retrieval and writing are separate steps that fail separately. The right page can be retrieved and then summarised wrongly, or a passage can be quoted without the qualifier that sat two paragraphs away. That is why answers and their citations should be read together.

Where do these facts come from?

2 sources, 3 statements: each statement with the page it came from and the day it was checked.

  1. For the prompt 'how does AI pick which sources to cite' in Attensira's own workspace, read over the Attensira MCP on 4 October 2026, ChatGPT's 57 answers in the 30 days to 4 October 2026 carried 1,204 citations, 31.0% to help.openai.com and 18.9% to openai.com, while Perplexity's 42 answers carried 397, led by aisearch.similarweb.com at 10.3% and cite.solutions at 8.3%: 1,601 citations across 99 answers in all.

    attensira.com workspace, read over the Attensira MCP on

  2. In Attensira's own workspace, read over the Attensira MCP on 4 October 2026, Perplexity's stored answer of 3 October 2026 to 'how does AI pick which sources to cite' said sources are selected via retrieval-augmented generation and cited 9 domains, none of them attensira.com; attensira.com was cited in 0 of the 99 answers to that question in the 30 days to 4 October 2026.

    attensira.com workspace, read over the Attensira MCP on

  3. The 2020 paper Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks by Lewis et al. introduced models combining a pre-trained parametric memory with a non-parametric memory, a dense vector index of Wikipedia.

    arxiv.org · retrieved

Want whatever it takes to win the answer?

7 days free · card required