Agile Snowglobe

Retrieval Augmented Generation Explained With a Cafe Example

By Callince · Nov 24, 2026 · ~9 min read

A worker packs parcels into cardboard boxes at a wooden bench beneath a skylight in a stockroom.

Overview

Retrieval augmented generation is a method where an AI system first searches specific documents for relevant passages, then writes an answer from those passages. This article explains how the method works in plain terms. It follows a hypothetical café that uses it to answer customer questions about its menu, allergens and daily specials, and it shows what to do when an answer goes wrong.

Retrieval augmented generation is a way to answer from your own content

Retrieval augmented generation, or RAG, is a method where a language model answers from documents you choose, not from what it absorbed during training. The system retrieves the passages most likely to hold the answer, then the model writes a reply using those passages. The idea is simple. The model gets the right material at the moment someone asks.

A language model knows a lot about the world in general. It knows nothing about your shop. You may have information it has not seen. Asked about it, the model will still produce a fluent answer, and that answer may be wrong. RAG narrows that gap by giving the model your content first, though it does not guarantee a correct answer.

The system retrieves, then it generates. If the retrieval step finds the wrong passage, the answer goes wrong too. If it finds a relevant passage that is misread, the answer can still be wrong. This is why the first step matters, and why answers still need grounding checks and human review. You need to ensure the system has the right information.

What makes RAG different from a standard language model

A standard model answers from memory. A RAG system answers from fetched passages. The first may invent a plausible price. The second is built to work from a passage it found, but a passage can be misread, so a shop should still check answers. For a shop, that difference is what gives customers a better chance of trusted information.

How would a small café use RAG for customer service?

It is simple. You can point a RAG system at your menu files. This includes daily specials and allergen sheets. If you have a short menu that changes each week, the content is the source of truth. You should only repeat what you have written.

Loading the café's content into the knowledge base

The café gathers its material first. That might be a PDF menu, a plaintext list of ingredients, a spreadsheet of allergens and a page for opening hours. The system reads each file and splits it into passages, called chunks. A chunk might be one menu section or one allergen table.

Chunk size matters. Too large, and a passage mixes unrelated facts. Too small, and it loses the context that gives it meaning. We recommend keeping each chunk to one topic, such as a single dish or a single policy. Our knowledge page shows the content preview for each passage, so you can check what the assistant will see.

How a customer's question triggers retrieval

When a customer asks, "Is the banana bread nut free?", many systems turn the question into a numeric form, called an embedding, that represents its meaning. They then compare that form with the stored passages. Retrieval methods and ranking vary between systems, so the exact steps depend on the platform. In this example, the café's allergen record for the banana bread should be among the passages retrieved.

The system locates the record. It does not decide if the item is safe. The answer repeats what the record says. If the record says the banana bread contains no nuts, the reply can say so. If the record is missing or unclear, the reply should say you are not certain.

Question wording does not need to match the document word for word. Matching by meaning means "nut free" can find a passage that says "contains almonds" when the meaning overlaps closely enough. That is why clear, specific content helps, and why the café should check that its allergen records do not contradict each other.

How does RAG produce an answer for the café?

This instruction helps. The generation stage takes the retrieved passages and writes the reply. We give the model the passages and an instruction to answer only from them. If the passages do not cover the question, the model should say so, rather than guess, which helps keep the answer tied to the source.

Writing the answer from retrieved passages

The model receives the question, the retrieved passages and the instruction. It then writes a short reply. For the banana bread question, a good answer repeats what the allergen record states. If the record is silent or uncertain, the right reply is to say the café does not have that information and offer to pass the question to staff.

Pulling live prices and stock from the till

Menu wording changes slowly. Prices and stock can change often. You can use live data when the platform connects to a store. TalkTill reads live price and stock when connected to WooCommerce. The knowledge base holds the menu, and the store holds the price and stock, which are read at the moment of the question.

The how it works page explains the stages. Keeping the two sources separate helps stop a customer from being quoted a price that no longer applies, provided the connection to the store is set up.

What should the café do when the assistant gets an answer wrong?

A cafe manager in a grey jumper lifts a stack of paper cups from wooden shelving.
Checking the source records is the first step when an answer looks wrong.

When a RAG answer is wrong, a trace can show which stage failed. A trace may list the candidate passages, their scores and which ones the system used. The café can then tell if the right content was never retrieved or was retrieved and misread. Each cause needs a different fix.

Finding out whether retrieval failed

Start by checking the candidates. If the allergen sheet never appeared in the list, retrieval failed. Common causes are a missing file, a file the system could not read or a passage too vague to match well. The fix is to add or rewrite the content, then test again.

If the right passage appeared but scored below the cut-off, the cut-off or the wording needs tuning. Our guide on choosing a similarity threshold explains how to test the setting on your own content.

Finding out whether generation went wrong

If the right passage was used and the answer is still wrong, the problem sits in how the reply was written. Look at the instruction and the wording of the passage. A passage that says "usually nut free" may lead the model to state the item is nut free without a caveat. A tighter sentence in the source helps fix that.

Errors like this can be small and quick to fix once the trace shows them. Without a trace, the café would only see a wrong answer and have to guess the cause.

Handling missing or conflicting allergen records

Allergen questions expose a particular risk. If the café has two sheets that disagree, or no sheet for a new item, the assistant may still produce a confident reply. The café should audit its allergen records, remove duplicates and fill gaps before customers rely on the answers. Where a record is missing or conflicting, the assistant should defer to staff rather than choose one version.

What general lessons does the café's RAG experience hold?

It is clear. Three lessons come out of the café example. Content quality sets the ceiling for every answer. Monitoring shows where the gaps are. Transparency lets you fix problems with more confidence, instead of guessing, which helps you improve the system over time.

Why content structure decides answer quality

Pages that answer one question each are easier to retrieve. A heading that asks "Is the banana bread nut free?" with the answer in its first sentence works better than a long page with the answer buried. A plain table for allergens is easier to use than an image of a table. The assistant reads content in a way that favours clear, skimmable writing.

Why transparency in AI answers matters

Many platforms show only the question and the reply. The step between them stays hidden. That leaves an owner unable to tell a missing page from a misread page. We think a system should show its working. Our note on why we built an assistant that shows its work explains the reasoning behind that choice.

Key takeaways

  • Retrieval augmented generation answers from documents you supply, not from general training data.
  • Passages should cover one topic each, with clear headings, so retrieval can find them.
  • Live prices and stock depend on the platform and its store connection, so keep them separate from the static knowledge base.
  • A trace separates retrieval failures from generation errors, so each gets the right fix.
  • Content quality and monitoring matter more than the model choice for most small businesses.

Conclusion

Retrieval augmented generation gives a language model relevant material at the moment of the question. It answers from your content rather than memory, which can keep answers closer to the source, but it does not guarantee correctness. The café example shows how structured content, careful handling of live data and a clear trace work together, with human review where accuracy matters most. For readers who want to try this in practice, our step-by-step RAG chatbot build guide is optional further reading.

FAQ

Frequently asked questions

What is the difference between RAG and a standard LLM?

A standard language model answers from what it learned during training. A RAG system first fetches passages from documents you supply and writes the answer from those passages. The second is better suited to questions about your own prices, policies and stock, though it still needs checking.

How does RAG improve the accuracy of AI chatbots?

RAG limits the model to the content you provide, so it has less room to invent details. When the content does not cover a question, a well-set system can say so instead of guessing. Accuracy still depends on how well the content is written and on reviewing answers.

What kind of data can be used with a RAG system?

RAG does not train the model on your data in the usual sense. Instead, it indexes your files, such as PDFs, text, spreadsheets and web pages, so the system can retrieve them. Clean, single-topic files work best.

Can RAG systems handle multiple languages?

Yes, many can, though quality depends on the language model and the content. Test answers in each language your customers use. Check the trace for any language where retrieval scores run lower than expected.

How often should the knowledge base for a RAG system be updated?

Update it whenever the underlying content changes, such as a new menu or a revised policy. Stable content may need only occasional review. Live data like prices and stock should come from a live source rather than wait for a scheduled update.

What are the main challenges in implementing a RAG system?

The biggest challenges are preparing clean content, setting the retrieval threshold and checking answers over time. Gaps in content cause missed questions, and vague passages cause weak matches. A trace helps find each problem.

Also mentioned in

↗ Chatbot for Lead Generation: Which Type Suits Your Business?