18One call

Retrieval-augmented generation

One retrieval step before the call: add passages relevant to the query to the prompt.

Also called RAG

Lewis et al., Xu et al., Anthropic, Amazon Web Services, Microsoft

appendsQueryCodeRetrieveToolKnowledge baseContextPromptModel callModelResponse
How to read this

The problem

The model needs knowledge it was not trained on, or that is newer than its training data.

For an AI model to be useful in specific contexts, it often needs access to background knowledge.
AnthropicContextual retrieval in AI systemsSep 19, 2024
LLM training data is static and introduces a cut-off date on the knowledge it has.
Amazon Web ServicesWhat is RAG? - Retrieval-Augmented Generation AI Explained

Therefore

RAG is a method that retrieves relevant information from a knowledge base and appends it to the user's prompt, significantly enhancing the model's response.
AnthropicContextual retrieval in AI systemsSep 19, 2024
Retrieval-augmented generation (RAG) is a pattern that extends LLM capabilities by grounding responses in your proprietary content.
MicrosoftRetrieval-augmented generation (RAG) in Azure AI Search
We explore RAG models, which use the input sequence x to retrieve text documents z and use them as additional context when generating the target sequence y
Lewis et al.Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks

In use

Claude Projects

As you add more files and information to your projects, Claude automatically switches to a faster mode (powered by RAG) that keeps response times quick while maintaining quality responses.
AnthropicRetrieval augmented generation (RAG) for projects

LinkedIn customer service

Our method has been deployed within LinkedIn’s customer service team for approximately six months and has reduced the median per-issue resolution time by 28.6%.
Xu et al.Retrieval-Augmented Generation with Knowledge Graphs for Customer Service Question Answering

Where it breaks

Encoding text for retrieval strips its context, so retrieval can miss the passage that answers.

The problem is that traditional RAG solutions remove context when encoding information, which often results in the system failing to retrieve the relevant information from the knowledge base.
AnthropicContextual retrieval in AI systemsSep 19, 2024

Sources

  1. Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, Douwe Kiela, Lewis et al.
  2. Retrieval-Augmented Generation with Knowledge Graphs for Customer Service Question AnsweringZhentao Xu, Mark Jerome Cruz, Matthew Guevara, Tie Wang, Manasi Deshpande, Xiaofeng Wang, Zheng Li, Xu et al.
  3. Contextual retrieval in AI systemsAnthropic, Sep 19, 2024
  4. What is RAG? - Retrieval-Augmented Generation AI ExplainedAmazon Web Services
  5. Retrieval-augmented generation (RAG) in Azure AI SearchMicrosoft
  6. Retrieval augmented generation (RAG) for projectsAnthropic

Added Nov 14, 2026