← Retour au plan
AI Essentials: Understand Generative AI in 20 Minutes · Leçon 4 sur 8

4. Grounding: Documents, Search and Tools

Discover how grounding techniques — knowledge bases, web search and tools — reduce hallucinations by giving the model verified material to work from.

When you ask a generative AI model a question, it doesn't look anything up — it predicts the most plausible next piece of text based on its training data. If the information it needs isn't in that training data (or if the data is outdated past its knowledge cutoff), it fills the gap with something that sounds right. This is called a hallucination: a confident-sounding answer that is partially or entirely false. Hallucinations aren't a bug you can fix with a setting; they're a built-in property of how these models work. That's why grounding matters.

Grounding means giving the model verified material to work from instead of letting it rely solely on its internal memory. There are three main grounding techniques:

  1. Knowledge bases (documents) — You upload your own files (policies, reports, product specs). When you ask a question, the system retrieves the relevant passages and injects them into the model's context window so it can answer based on your actual content.

  2. Web search — The model queries the live web to pull in current information, which is essential for anything after its knowledge cutoff date.

  3. Tools — The model calls external services or databases that return real, structured data (e.g., a calculator, a CRM lookup, a code interpreter).

Grounded answers can cite where a claim comes from; ungrounded answers cannot.

Why does grounding work? Remember that the context window is the model's entire working memory for a single request — your message, the conversation history, any attached documents, and behind-the-scenes instructions. When you ground a request, you're placing verified facts directly into that window. The model then predicts its answer based on that material rather than guessing. The key insight: the model doesn't "know" your documents permanently. It only sees what's placed in the window for that specific request, which is why a well-organized knowledge base matters — it ensures the right passages are retrieved every time.

Astuce

Whenever accuracy matters, ground your request. For factual questions, prefer attaching a knowledge base or enabling web search over relying on the model's memory alone. And attach only the documents the task actually needs — extra material fills the context window without helping.

Astuce

Even with grounding, keep the human-validation rule: the AI proposes, you validate. Grounding dramatically reduces hallucinations, but it doesn't eliminate them entirely. The depth of your checking should match the stakes — a casual summary needs a glance; a legal statement needs careful review.

À vous de jouer

Open the Knowledge Bases section in OUPI. Upload a short document you know well (a policy, a FAQ, a product sheet). Then ask the assistant a question that the document answers. Compare the grounded response — with citations — to what you'd get without the document attached.

Suivre ce cours dans OUPI → Cet exercice se fait dans la plateforme OUPI.
À retenir

Models predict text — they don't verify facts, which is why hallucinations happen. Grounding fixes this by injecting verified material into the model's context window via three channels: your documents (knowledge bases), live web search, and tools that return real data. Grounded answers can point to their sources; ungrounded ones cannot. Use grounding whenever accuracy matters, and always apply human judgment proportional to the stakes.