RAG and Knowledge Graphs
Prerequisites: llm-mechanics
LLMs are powerful but do not inherently know your enterprise’s data. Retrieval-Augmented Generation (RAG) and Knowledge Graphs are the two most common ways to ground an agent’s answers in trustworthy, up-to-date information.
What you will learn
- The RAG loop: retrieve, augment, generate.
- When a knowledge graph adds value over plain vector retrieval.
- How grounding reduces hallucination and improves auditability.
The RAG loop
- Retrieve relevant documents for the user’s query (often via vector similarity search).
- Augment the prompt by inserting those documents as context.
- Generate an answer that cites or relies on the retrieved context.
Because retrieved context consumes the context window (see the previous lesson), retrieval quality matters more than retrieval quantity.
Grounding improves trust
Knowledge Graphs
A knowledge graph models entities and the relationships between them. Compared to flat document retrieval, a graph lets an agent traverse explicit relationships (for example, “which policies apply to this agent?”), which improves precision for connected, structured domains.
Use a knowledge graph when relationships are first-class; use vector RAG when you mostly need semantic recall over unstructured text. Many real systems combine both.
Why this matters in MAF
Grounding is the foundation for the four MAF capabilities you will meet next: you cannot Govern or Observe what you cannot trace. Reliable retrieval underpins reliable agents.
Next steps
Continue to Model Context Protocol (MCP) essentials to see how agents connect to tools and data through an open protocol.