Guide : Retrieval-Augmented Generation (RAG)

How RAG fonctionne — the retrieve-then-generate pattern behind Google AI Overviews, ChatGPT Search, and Perplexity — and Ce que cela signifie pour getting votre content cited.

Première publication : 24 juin 2026 · Dernière mise à jour : 3 août 2026 · Advanced
Langues

RAG (Retrieval-Augmented Generation) is the retrieve-then-generate pattern behind AI search. It runs two phases at requête temps — retrieval (trouver relevant passages from an external index) and augmented generation (feed ceux passages to an LLM to écrire a grounded, cited réponse) — sans ever modification the model's weights. It's how AI réponses cover information au-delà a model's training cutoff. The retrieval phase chains chunking → embeddings → vector search → re-ranking → top-k passages. RAG reduces hallucinations but doesn't eliminate les — and insufficient retrieved context peut faire les worse. Pour le SEO there's aucun separate AI index: being crawlable, indexé, and structured into clair, self-contained passages is the prerequisite pour being retrieved and cited.

Lewis and colleagues’ 2020 system paired sequence generation with dense retrieval from a non-parametric index. Evidence for this claim The original RAG paper combined a pretrained sequence-to-sequence model with a non-parametric dense-vector index retrieved during generation. Scope: Lewis et al.'s 2020 RAG architecture and experiments, not every modern retrieval system. Confidence: high · Verified: Lewis et al.: Retrieval-Augmented Generation Google Cloud’s current overview defines RAG plus broadly as supplying retrieved external knowledge to a model. Evidence for this claim Google Cloud describes RAG as retrieving relevant information from external knowledge sources and providing it to a model to improve generated responses. Scope: General RAG architecture in Google Cloud documentation; quality depends on retrieval, source quality, and generation. Confidence: high · Verified: Google Cloud: RAG overview

TL;DR — RAG is a two-phase, inference-time pattern: retrieval (trouver relevant passages in an external corpus) alors augmented generation (feed ceux passages to an LLM to produce a grounded, cited réponse). The weights jamais modifier — it combines the model’s parametric memory with non-parametric memory retrieved live. The retrieval phase chains chunking → embeddings → vector search → re-ranking → top-k. “Naive” RAG is retrieve-then-generate; avancé RAG adds requête rewriting and re-ranking; agentic RAG adds iterative, multi-hop retrieval. Retrieval peut ground réponses but ne fait pas guarantee correctness; in un Gemma evaluation, insufficient context coincided with plus incorrect réponses. Pour le SEO: there’s aucun separate AI index; crawlability, indexation, and passage-level clarity are the prerequisites pour being retrieved.

The two phases (and pourquoi “inference time” is the whole point)

Retrieval is a pipeline: chunk, embed, search, re-rank, then hand the survivors to the model. Source : /ai-search/how-search-works/rag/

Five stages run left to right at inference time. Chunking splits documents into retrievable passages. Embeddings represent each passage as a dense vector. Vector search retrieves candidates and some systems combine it with BM25 keyword search. Re-ranking re-scores and narrows the candidate set. The top surviving passages enter the model context. The model's weights do not change.

© Patrick Stox LLC · CC BY 4.0 ·

RAG combines trained model memory with retrieved context at query time — without changing the weights. Source : /ai-search/how-search-works/rag/

Two sources feed one generation step. Parametric memory is knowledge encoded in the model weights during training and is limited by the training data and cutoff. Non-parametric memory consists of passages retrieved from an external index at query time. Generation uses both while the weights remain unchanged, producing an answer that can be grounded in and cite the retrieved sources; this does not guarantee correctness.

© Patrick Stox LLC · CC BY 4.0 ·

Break the acronym apart and vous have the model: Retrieval plus Augmented Generation. A requête comes in; the system retrieves the la plupart relevant passages from an external corpus; it injects ceux passages into the LLM’s context window; the LLM generates an réponse grounded in les.

The detail que everyone obtient incorrect: ce se produit at inference temps, and the model’s weights are jamais touched. RAG n’est pas training and it n’est pas fine-tuning. The original 2020 paper from Patrick Lewis and colleagues at Facebook AI Research framed it as combining two kinds of memory — parametric memory (knowledge baked into the weights during training) and non-parametric memory (knowledge retrieved live from an index). RAG uses les deux at une fois. AWS puts the practical cas plainly: retraining a foundation model pour fresh or domain-specific knowledge is expensive, and “RAG is a more cost-effective approach to introducing new data to the LLM.”

(The naming, pour ce que it’s worth, was an accident. Lewis plus tard admitted: “We definitely voudrait have put plus thought into the nom had we connu our fonctionner voudrait become so widespread… We toujours planned to have a nicer sounding nom, but quand it came temps to écrire the paper, aucun un had a meilleur idea.”)

À l’intérieur the retrieval phase

“Retrieve the relevant passages” is doing a lot of fonctionner in que sentence. In a réel system it’s a pipeline:

  1. Chunking. Documents obtenir split into retrievable pieces. Chunk size is a réel tradeoff — aussi petit and a passage loses its context; aussi grand and it floods the token budget with irrelevance. Strategies range from fixed token counts (100/256/512) to recursive/sliding windows to “Small2Big” (retrieve a petit sentence, retourner its parent chunk pour generation).
  2. Embeddings. Chaque chunk is turned into a dense vector — a numeric representation of its meaning — so similarity is computed semantically, pas by keyword match. Ce is pourquoi content à propos de a topic obtient retrieved même quand it doesn’t utiliser the exact requête phrasing.
  3. Vector search. The requête is embedded aussi, and the system trouve the chunks whose vectors sit closest to it. La plupart production stacks run hybrid search — dense vector retrieval plus BM25 keyword search — parce que chaque catches recall the autre misses.
  4. Re-ranking. A separate model re-scores the candidates by relevance to the requête and reorders les, “effectively reducing the overall document pool.” Seulement the top survivors faire it into the context.
  5. Top-k into the prompt. The meilleur passages are concatenated with the user’s requête and handed to the generator.

Chunking is the fragile lien. Anthropic identified que “traditional RAG solutions supprimer context quand encoding information” — a chunk pulled out of its document loses the surrounding context que made it meaningful. Leur Contextual Retrieval technique (prepending chunk-specific context avant indexation) reduced failed retrievals by 49%, and by 67% combined with re-ranking. That’s a strong signal que the chunking problem is réel — and que self-contained, context-rich passages are easier to retrieve correctement.

Naive, avancé, and agentic RAG

The survey literature (Gao et al., 2023) splits RAG into a utile taxonomy:

  • Naive RAG“a traditional traiter que inclut indexation, retrieval, and generation.” Retrieve top-k once, generate once. It “struggles with precision and recall, leading to the selection of misaligned or irrelevant chunks.”
  • Avancé RAG — adds “pre-retrieval and post-retrieval strategies.” Pre-retrieval: requête rewriting and meilleur indexation (notamment HyDE, où the model generates a hypothetical réponse, embeds que, and retrieves documents que regarder comme réponses plutôt que questions). Post-retrieval: re-ranking and context compression.
  • Modular / agentic RAG — the model retrieves, raisons à propos de what’s encore manquant, and retrieves à nouveau, iterating à travers multiple hops. Ce is the current state of AI search. As Michael King put it: “The retrieve-once-then- generate pattern que défini the premier wave is obsolete… Agentic RAG is now the par défaut.”

Ce matters pour le SEO parce que content now has to survive multiple retrieval rounds and contradiction-checking — pas simplement a unique retrieval réussir.

Fait RAG eliminate hallucinations? Aucun.

In one evaluation, Gemma answered incorrectly on 10.2% of questions with no context and 66.1% with insufficient context; this is not a universal model effect. Source : Data: Google Research

Two bars report Gemma's incorrect-answer rate in one Google Research evaluation. With no context, the rate is 10.2 percent. With insufficient context, the rate is 66.1 percent. The comparison comes from Google Research's ICLR 2025 sufficient-context study and should not be generalized to every model, dataset, or retrieval system.

RAG peut ground réponses in retrieved sources, but the LLM peut encore misread or over-interpret ce que it pulled. Google Research (ICLR 2025) documented a counterintuitive result in un evaluation: Gemma produced incorrect réponses on 10,2% of questions with aucun context and 66,1% with insufficient context. The researchers report que models peut “excel with sufficient context but échouer to recognize quand context is insufficient.” Treat que as a model- and evaluation-specific warning, pas proof que retrieval universally causes worse réponses. The practical lesson is narrower: retrieval quality and context sufficiency besoin to be evaluated plutôt que assumed. Google operationalized the finding as an LLM re-ranker in its Vertex AI RAG Engine.

RAG vs. fine-tuning

Ces obtenir conflated constantly, and they’re fundamentally différent:

  • RAG retrieves external information at requête temps. Weights unchanged. Meilleur pour fresh/modification information, citation requirements, and cost. The survey trouvé “RAG consistently outperforms [unsupervised fine-tuning], pour les deux existing knowledge encountered during training and entirely nouveau knowledge.”
  • Fine-tuning modifies the model’s weights in a separate training run. Meilleur pour modification style and behavior, or teaching stable domain knowledge que doesn’t modifier.

You’d reach pour RAG to faire a model know the latest facts; you’d reach pour fine-tuning to modifier how it talks.

RAG in the wild: Google, ChatGPT, Perplexity

  • Google AI Overviews. Google calls RAG “a technique (aussi connu as grounding)… relying on our core Search ranking systems to retrieve relevant, up-to-date web pages from our Search index.” Two choses follow. Premier, là is aucun separate AI index“our generative AI fonctionnalités on Recherche Google are rooted in our core Search ranking and quality systems.” Second, Google runs requête fan-out: “concurrent, related queries generated by the model to request more information.” A unique question peut spawn multiple sub-queries, chaque retrieving différent content — so votre content has to satisfy the implied sub-questions, pas simplement the head requête.
  • ChatGPT Search. Launched (October 2024) with Bing as its données partner, and OpenAI’s propre robot d’exploration documentation confirms OAI-SearchBot fait independent fetching and indexation pour search citations, separate from GPTBot’s training-crawl. OpenAI hasn’t publié the current retrieval mix entre Bing and its propre index, and OpenAI has since positioned ChatGPT Search as a standalone competitor to Bing plutôt que a wrapper autour it — so treat “it’s basically Bing” as a simplification. The documented, actionable lever is narrower and plus durable: don’t block OAI-SearchBot in robots.txt, parce que that’s the robot d’exploration OpenAI itself noms as the un que indexes content pour search citations.
  • Perplexity. Construit on hybrid retrieval (Vespa.ai — BM25 + dense) with custom embedding models and a strict re-ranking threshold: by third-party analysis, seulement the top ~30% of 60-plus retrieved sources survive to the generation stage, and “citations ne sont pas retrofitted post-generation — ils are structurally assigned during context assembly.” Deep Research runs the agentic loop à travers dozens of searches.

Ce que RAG signifie pour le SEO

Strip away the jargon and the playbook is concrete:

  • Being dans l’index is the prerequisite — complet arrêter. Aucun separate AI index signifie the explorer → index → retrieve chain has to be intact. Si une page can’t be crawled and indexé, it can’t be retrieved into an AI réponse. The même is vrai pour the AI engines que construire leur propre pools: AI robots d’exploration comme OAI-SearchBot and PerplexityBot have to be allowed to récupérer vous, or you’re invisible to ceux réponses.
  • Écrire self-contained passages. RAG retrieves fragments, pas whole pages. As iPullRank’s Francine Monahan put it, AI systems examine “fragments of pages plutôt que lune page as a whole” — so craft “stand-out passages and phrases” que réponse a spécifique question on leur propre. Ce is exactly the H2/H3 structure and clair topic sentences bon SEO déjà rewards. Google explicitly dit pas to chop votre content into tiny pieces pour AI — well-structured content chunks bien on its propre.
  • Cover the sub-topics. Requête fan-out signifie un question peut trigger nombreux retrievals. Depth à travers connexe sub-questions beats un page stuffed autour a unique keyword.
  • Authority drives citation plus que rank position. From an 8 000-citation analysis: “Strong organic search presence and broad web visibility leads to AI citations, pas the autre façon autour” — and “highly authoritative content from a lower-ranking page” parfois obtient cited over a moins credible top-ranking un. My propre données lines up (from my AI Overview citation research): mentions on heavily-linked pages are the strongest predictor of AI Overview inclusion (ρ ≈ 0,70), and branded web mentions correlated ~0,66 à travers 75 000 brands.
  • Fresh content has an edge. AI citations skew meaningfully fresher que organic results, so currency matters.

Si vous vouloir the one-sentence version: RAG didn’t replace SEO — it raised the stakes on the parts of SEO que were toujours à propos de being findable and being clair.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.