kmail.at
01 / 15

slide 01 of 15

Welcome: Knowledge Graphs for AI

GraphRAG in Python: Agentic AI with Knowledge Graphs

Welcome. This is a deep, hands-on course on one of the most promising ideas in applied AI: Retrieval-Augmented Generation (RAG) powered by knowledge graphs. You will not just read about it — you will build a working agent that reasons over connected data, then trace exactly how it thinks.

What you will build

By the end you will have a LangChain agent backed by a Neo4j graph that answers questions no plain vector search can — questions that hop from one entity to another, like:

Where does the guy live who created the operating system that someone I know uses?

That question needs to walk a chain of relationships. A vector store retrieves similar chunks; a knowledge graph lets the agent traverse the structure.

Why this matters now

Plain RAG is powerful but has a well-documented blind spot. Microsoft’s GraphRAG paper (arXiv:2404.16130) shows that naive retrieval “struggles to connect the dots” — it fails when an answer requires combining disparate pieces of information, and it performs poorly at holistic understanding of a large corpus. Knowledge graphs address exactly this.

  • Grounded answers tied to real entities and relationships, not just similar text.
  • Multi-hop reasoning — follow chains of relationships, not a single lookup.
  • Explainable — graph paths are easy to trace, so you can show why the agent answered as it did.

Course map

  1. RAG fundamentals and why grounding matters
  2. Knowledge graphs 101: triples, RDF, and the property graph model
  3. GraphRAG theory: the Microsoft two-tier architecture
  4. Setting up Neo4j with Docker
  5. Cypher, the query language, deep-dive
  6. Environment and Python dependencies
  7. Building the knowledge graph in code
  8. The retriever: Text2CypherRetriever
  9. Wiring the agent and streaming its reasoning
  10. A multi-hop question workshop
  11. Hybrid RAG: combining vector + graph
  12. Scaling and production
  13. Real-world use cases
  14. Anti-patterns and when NOT to use a graph

Let’s begin with the foundation: what RAG actually is, and where it runs out of road.