Skip to content
Sign in to your account ES·EN
Start free
Glossary

What is RAG? Checking the paperwork before answering

RAG stands for retrieval-augmented generation: the AI first searches a set of documents, then writes its answer using what it found, instead of answering from memory. If you saw the acronym in a proposal and wondered “what is RAG?”, that’s the short version: look it up before you speak.

What is RAG in AI, in simple terms

At Sole & Welt, a Milwaukee shoe store with a repair bench in the back, a customer asks how long a resole takes. Whoever’s at the counter doesn’t guess: they check the repair shop’s turnaround sheet and answer with it in front of them. RAG asks an AI to do the same.

Why it exists: an AI doesn’t know your company

A generative AI learned from a huge amount of public text, and your turnaround times and prices aren’t in it. Ask about them without giving it anything and it either admits it doesn’t know or fills the gap with something plausible: a hallucination. RAG fixes that the sensible way. It puts the fact in front of the AI.

How retrieval-augmented generation works, in three steps

  1. Retrieve. It pulls the passages from your documents that relate to the question.
  2. Augment. It hands the AI the question along with those passages.
  3. Generate. The AI writes with them, and the product can show where they came from.

The search can go by keywords or by meaning. The second kind relies on embeddings.

RAG vs. fine-tuning

The two get confused a lot. Retraining the model, called fine-tuning, changes how the AI behaves, and you have to redo it whenever a fact changes. With RAG you swap the document. For what a company knows, which changes every month, the second is almost always the right call: the guide to training AI on your own data explains why.

What to ask a vendor

  • Does it show the sources for each answer?
  • When it finds nothing, does it say so or improvise?
  • If I replace a document, when does it notice?

One caution: RAG reduces made-up answers. It doesn’t eliminate them. If the document is wrong or the search brings back the wrong passage, the answer comes out wrong, and just as confident.

In Flipa

Flipa searches what it knows about your company, its knowledge base, before stating anything specific to it, and shows the sources it checked under each answer. Today it searches by keywords, not by meaning. The whole path is in how it works.

See inside

Search first, then write

What happens between the question and the answer, using the shoe store’s repair paperwork. Go step by step, then try something that isn’t written down anywhere.

  1. 1The question comes in

    How long does a resole take?

  2. 2It searches the documents

    • Repairs: turnaround times“Resole: five business days.”Relevant
    • Repair price list“Leather soles: special order. Two more days.”Relevant
    • Fall catalog“Ankle boots, loafers and lace-ups.”Not used

    Two passages talk about soles. The catalog doesn’t, so it’s left out.

  3. 3It writes with what it found

    A resole takes five business days. Leather soles have to be ordered: allow two more days.

    2 sources checkedRepairs: turnaround times · Repair price list

The difference

From memory, or looked up first?

What’s comparedFrom memoryLooked up first (RAG)
Where the answer comes fromWhat the AI learned back when it was trained.Your documents, searched on the spot.
If the fact changesIt keeps giving the old one.You change the document and the answer changes.
Whether you can check itThere’s nowhere to look.Yes, when the product shows its sources.
FAQ

RAG, in four questions

What is RAG in AI?

A way of building an assistant so it looks things up before answering. For each question it finds the related document passages and hands them to the AI, which writes with them. That way it answers with your facts, not only with what it learned in training.

What is RAG good for in a business?

Getting the AI to answer with your own material: prices, turnaround times, terms, procedures. It also leaves a trail: you can tell which document each answer came from.

What does RAG stand for?

Retrieval-augmented generation. “Retrieval” is finding the documents and “generation” is writing the answer. The name comes from a 2020 research paper.

Does RAG eliminate made-up answers?

No. It reduces them, because the AI writes with the fact in view, but it can misread a passage or be handed the wrong one. That’s why it pays to see the sources and treat every answer as a draft.

RAG fits in three verbs

  • It searches your documents
  • It writes with what it finds
  • It shows where it got it
Start free