GraphRAG Hands-On: Knowledge Graphs for RAG
Why vector RAG fails, what a knowledge graph fixes, how to index and query with Microsoft GraphRAG
01
What changes after this course
- ●Instead of re-chunking every failing RAG question, you tell whether it needs a graph or a better chunk
- ●Instead of proposing GraphRAG on hype, you propose it with a token cost estimate attached
- ●Instead of only reading about GraphRAG, you build and query an index on your own documents
02
Why it matters now
Vector RAG works until the answer lives in the connections between documents: multi-hop, global summary and relation questions. GraphRAG fixes that, at a token cost. This course measures that cost instead of assuming it, and ends with when not to use GraphRAG.
03
What you leave with
- ✓Four notebooks that work with OpenAI or a local Ollama model
- ✓A fictional corpus with planted facts, so you can check every answer by hand
- ✓Your own GraphRAG index and a cost estimate
04
Skills you'll build
- →Name the three question types that make vector RAG fail, and show each failure
- →Build a knowledge graph by hand, then extract entities and relations with an LLM
- →Run Microsoft GraphRAG indexing, use local and global search, and estimate the token cost
Inside the course
Screens from the lectures. The notebooks on screen are the ones you download; Microsoft GraphRAG, NetworkX and the OpenAI or Ollama backends are third-party tools, and this course is independent of them.

notebooks/01_why_graphrag.ipynb
Naive RAG cannot join two facts
The answer needs one fact from the Kwabix chunk and one from the Brensul chunk. Vector search only brings back the first, so the model answers "I do not know."
Lecture 1.3 · failure modes enter graphrag

notebooks/02_knowledge_graph_basics.ipynb
The same facts as a graph you draw by hand
Before any LLM is involved, you build the graph yourself in NetworkX. Facts that sat in separate chunks become labelled edges, such as Talamir Hesh authored On Resonance Frames.
Lecture 2.2 · build a kg by hand

notebooks/02_knowledge_graph_basics.ipynb
An LLM pulls the entities out for you
extract_graph sends the corpus text to the LLM and gets back JSON: each entity with a name, a type such as Person or Organisation, and a description taken from the text.
Lecture 2.3 · llm entity extraction

notebooks/03_ms_graphrag_indexing.ipynb
What the GraphRAG index actually contains
After indexing, you open entities.parquet with pandas: 11 entities from the A Christmas Carol excerpt, each with a type and a description.
Lecture 3.2 · run indexing inspect output

notebooks/03_ms_graphrag_indexing.ipynb
Settings that cut the indexing bill
GraphRAG makes LLM calls per chunk and per community, so cost follows the settings. Larger chunks, bigger clusters and a kept cache/ folder mean fewer calls; max_gleanings is capped at 1, since each glean re-runs extraction.
Lecture 3.3 · visualise graph cost recap

notebooks/04_querying_and_production.ipynb
Local search answers with its sources
A local search on the indexed story answers who Scrooge is and how he relates to Marley, and each paragraph ends with the reports, entities and relationships it used.
Lecture 4.1 · local vs global search

notebooks/04_querying_and_production.ipynb
The two-hop question, answered
Who is the nephew of the man who employs Bob Cratchit? A vector store would have to find and join two facts; on the graph it is two edges, and local search answers Fred.
Lecture 4.2 · multihop python api communities

notebooks/04_querying_and_production.ipynb
When to skip GraphRAG
The course closes with a checklist. Use a graph when questions connect facts or need global summaries; stay with vector search for simple lookups, a corpus that changes all the time, or sub-second latency.
Lecture 4.3 · cost when to use wrapup
What you'll learn
- ✓Recognise the three question types that make vector RAG fail and explain why
- ✓Build and walk a knowledge graph by hand, then extract entities and relations with an LLM
- ✓Configure and run Microsoft GraphRAG indexing and read its outputs
- ✓Use local and global search and answer multi-hop questions
- ✓Estimate the token cost of GraphRAG and decide when it is worth it
About this course
Vector RAG works until the question needs more than one chunk. Multi-hop questions, global summary questions and questions about relations all fail the same way: the right chunk is never retrieved, because the answer lives in the connections between documents. GraphRAG fixes that with a knowledge graph — and this course shows exactly how, on a small fictional corpus with planted facts so you can verify every answer by hand.
Session 1 builds a naive RAG pipeline from scratch and breaks it on purpose on three question types. Session 2 covers knowledge-graph fundamentals: nodes, edges, building a graph by hand with NetworkX, walking it, and LLM-based entity and relation extraction with a prompt you can read. Session 3 is Microsoft GraphRAG hands-on: installation, the settings file line by line, the indexing pipeline, and the entities, relationships and communities it produces. Session 4 covers querying: local versus global search and what each is for, multi-hop reasoning, community visualisation, token cost, and — importantly — when not to use GraphRAG.
Every session is a notebook shown on screen while the narration explains each cell; the notebooks work with OpenAI or with a local Ollama model. Cost is measured, not assumed.
The follow-up course, *GraphRAG in Production*, takes this to real public documents with evaluation, provenance and agents.
**Licensing.** Both corpora are free to use: the Nulmari documents are written for this course (which is also why no model has memorised them), and the *A Christmas Carol* excerpt is public domain. Microsoft GraphRAG is MIT. `Resources/LICENSES.md` sets out the details, including the licences of the optional local Ollama models.
Curriculum5 sections · 17 lectures · 1h 47m
Section 0. Welcome
Free previewSection 1. Why GraphRAG
Free preview- ▶section 1 intro0:06
- ▶evolution of rag and setup8:06
- 🔒build naive rag8:24
- 🔒failure modes enter graphrag8:12
Section 2. Knowledge-Graph Fundamentals
- 🔒section 2 intro0:12
- 🔒what is a knowledge graph8:18
- 🔒build a kg by hand7:54
- 🔒llm entity extraction9:18
Section 3. Microsoft GraphRAG Indexing
- 🔒section 3 intro0:06
- 🔒install init settings11:06
- 🔒run indexing inspect output8:30
- 🔒visualise graph cost recap8:12
Section 4. Querying and Production
- 🔒section 4 intro0:06
- 🔒local vs global search9:06
- 🔒multihop python api communities8:18
- 🔒cost when to use wrapup10:00
Requirements
- · A computer with Python 3.10+ (a free Google Colab account is enough for most sessions)
- · Comfort reading Python code; you do not need to be an expert
- · An OpenAI API key or a local Ollama installation
- · Basic familiarity with LLM APIs and embeddings
Who this is for
- · Developers who have built a RAG chatbot and hit its limits
- · Data and knowledge engineers evaluating knowledge-graph retrieval
- · Teams considering Microsoft GraphRAG and needing a realistic cost picture
- · Anyone who wants to understand retrieval beyond similarity search
Read alongside the course
The voice-over in this course is synthesized with a text-to-speech model from scripts written and reviewed by the instructor, and the on-screen material (notebooks, code, slides) is the instructor's own work.