Explore / Build the product / AI agents

AI agents · How Founders Use AI

What is RAG in AI?

Checked 17 November 2026

RAG, retrieval-augmented generation, means the AI first looks up passages from documents you choose and then answers from them, instead of relying only on what it learned in training. It is how a support bot or an internal assistant answers from your current policies and can cite them.

On the AI map, 29 October 2026 Frontier modelsOpen-weight modelsDecision models

By case

  • If all your documents together are only a few hundred pages

    Put them all in the prompt and skip RAG.

    Anthropic's own guidance is that a knowledge base this small does not need retrieval.

  • If you want RAG without building the pipeline

    Use a hosted file search, such as OpenAI's file search tool in its API.

    It chunks, indexes and retrieves for you.

    OpenAI API: Per million tokens, input and output: GPT-6.2 Astra $8 and $40, GPT-6.2 Sol $2 and $10, GPT-6 Astra $10 and $50, GPT-6.1 Terra $1 and $5, GPT-6 Luna $0.10 and $0.50, read from developers.openai.com on 25 November 2026

  • If answers miss facts that are in your documents

    Fix retrieval first: add context to each chunk and rerank the results.

    When RAG fails, the right passage usually never reached the model.

  • If your documents change every week

    Use RAG rather than fine-tuning.

    Updating an index is cheap; retraining a model is not.

The steps5 steps

  1. Split your documents into chunks of a few paragraphs, keeping headings with them.

    The official page on aws.amazon.com

  2. Store the chunks in a search index, usually as embeddings in a vector store, often with keyword search beside it.

    The official page on cloud.google.com

  3. For each question, retrieve the chunks closest to it.

    The official page on anthropic.com

  4. Pass those chunks to the model with the question, and ask it to answer only from them and cite them.

    The official page on developers.openai.com

  5. Test it on real questions and check whether the right chunk came back before judging the answer.

    The official page on anthropic.com

The figuresEach with where it was read

What goes wrong

  • Cutting chunks so small that each one loses the context that gives it meaning.

  • Letting the model answer when nothing relevant was retrieved, instead of saying it does not know.

  • Never re-indexing, so the bot answers from last quarter's policy.

  • Judging the system by its answers alone without checking what was retrieved.

Go deeper6 sources