About Me

My photo
PLANO, Texas, United States

Monday, August 4, 2025

Retrieval Augmented Generation

Retrieval augmented generation (RAG) is a popular way to ground prompt requests to large language models (LLMs). Grounding adds domain-specific knowledge or customer information to the prompt, giving the LLM context to respond more accurately to a question or task.

A diagram of a process

AI-generated content may be incorrect.

 To break it down, RAG:

  • Retrieves relevant information from a knowledge store containing structured and unstructured content.
  • Augments the prompt by combining this information with the original prompt.
  • With the augmented prompt, the LLM generates a response.

Many LLMs are trained generally across the Internet on static and publicly available content. RAG adds domain-specific information to help LLMs give you better responses to your prompts. With RAG, you can extract valuable information from all sorts of content, such as service replies, cases, knowledge articles, conversation transcripts, RFP (request for proposal) responses, emails, meeting notes, frequently asked questions (FAQs), and more.

AI grounding

Grounding refers to the process of connecting an AI model’s output, particularly from generative AI models like Large Language Models (LLMs), to verifiable and real-world sources of information. AI models are born generalists. To get smarter responses and the ability to complete complex tasks, you need to provide your AI model with the right information. Grounding gives ‌LLM domain-specific knowledge and customer information. Without grounding, AI is like someone who has memorized a dictionary but never experienced the real world. With grounding, AI can:

  • Recognize objects in photos
  • Understand human instructions better
  • Interact in real-life situations (like a robot)

Example- Without Grounding, AI guesses “dog” as an animal, just based on text, but with grounding, AI sees images of dogs and understands what they look like.

A diagram of a machine

AI-generated content may be incorrect.

 

Why is AI grounding critical?

  • Reducing Hallucinations - Hallucinations occur when an AI model generates the output that sound correct but is actually false or not based on real data. For example, you ask, who is the president of Mars? And if AI replies like “John is the current president of Mars” this is called Hallucinations as it made a fake outcome. AI grounding reduce “Hallucinations”.
  • Enhancing Accuracy and Relevance: Grounded AI models can provide more accurate, relevant and contextually appropriate response.
  • Providing a auditability and trust: Grounding allows for greater transparency and auditability. When an AI response is grounded, it can often provide links or references to the sources it used, enabling users to verify the information and building trust in the AI's outputs.
  • Customization and Specialization: For businesses and specific applications, grounding is essential for tailoring AI responses to unique datasets. For example, a customer support chatbot can be grounded in a company's knowledge base to provide accurate product details or troubleshooting steps specific to that company.

How is AI Grounding Achieved (Common Techniques)?

  • Retrieval-Augmented Generation (RAG): This is a popular technique where the AI model retrieves relevant information from a curated database or external knowledge base before generating a response. This retrieved information then "grounds" the model's output.
  • Connecting to Search Engines: Grounding can involve giving AI models access to real-time information from the web through search APIs (like Google Search).
  • Integrating with Proprietary Databases: For enterprise applications, AI models can be grounded by connecting them to internal company data, documents, or knowledge graphs.
  • Sensorimotor Grounding (Embodied AI): In robotics and embodied AI, grounding involves connecting language understanding with real-world sensory inputs (e.g., cameras, microphones) and physical actions. This helps robots understand and interact with their environment.
  • In-context learning: Feeding relevant data directly into the prompt can also serve as a form of grounding, guiding the LLM's response based on the provided context.