Knowledge Graphs for RAG

Instructor: Andreas Kollegger · Partner: Neo4j
Source course: https://www.deeplearning.ai/short-courses/knowledge-graphs-rag/
Course existence verified:

Study notes on DLAI's Knowledge Graphs for RAG (Andreas Kollegger, in partnership with Neo4j). Graph data modelling (nodes / relationships / properties / labels), Cypher querying, preparing text for RAG with vector indexes, constructing and expanding a knowledge graph from SEC filings, and chatting with the graph via LLM-generated Cypher — with applied practice questions, a glossary, and spaced-recall flashcards.

Chapters

  1. Knowledge Graph Fundamentals

    The graph data model — nodes, relationships, properties, labels — and how it maps to graph theory; why graph traversal complements vector similarity search for RAG; "identity through relationships"; knowledge graphs vs tabular storage; and a first taste of Cypher text notation.

  2. Querying Knowledge Graphs

    A working Cypher tutorial — MATCH patterns with label/property filters and WHERE, one-hop and multi-hop relationship traversal (co-actors), modifying the graph with CREATE/MERGE/DELETE (and why MERGE is the idempotent default), connecting from Python via the LangChain Neo4j Graph class, and the parse → plan → execute → project execution model.

  3. Preparing Text for RAG

    Adding vector search to the graph — creating a vector index (dimensions + similarity function), generating embeddings with genai.vector.encode and storing them as node properties, top-K similarity search with db.index.vector.queryNodes, parameterised queries for security, Neo4j as a co-located vector store, and how to read similarity scores.

  4. Constructing a Knowledge Graph from Text

    Building a knowledge graph from SEC Form 10-K filings: extracting sections (Item 1/1A/7/7A), chunking text with LangChain's CharacterTextSplitter, designing chunk metadata, idempotent node creation with uniqueness constraints and MERGE, wiring a Neo4jVector + retrieval-QA RAG chain, and preventing hallucination — ending with why a pure vector store still needs the relationships added in Module 5.

  5. Adding Relationships to the Knowledge Graph

    Turning the flat chunk collection into a navigable knowledge graph: a Form node per filing, a NEXT linked list of chunks (section-filtered), PART_OF and SECTION connections, variable-length paths (*0..1) for boundary handling, and chunk-window retrieval that expands RAG context by combining vector search with graph traversal.

  6. Expanding the Knowledge Graph

    Widening the graph's scope with a second dataset — SEC Form 13 investment holdings: Company and Manager nodes, the CUSIP bridge that links them to existing forms, FILED and OWNS_STOCK_IN relationships, full-text indexes alongside vector search, multi-hop traversal from chunk to manager, graph-to-text context, and when investment-enhanced RAG actually helps.

  7. Chatting with the Knowledge Graph

    The capstone: the Extract-Enhance-Expand pattern for growing graphs, Address nodes with geospatial points and point.distance() search, teaching an LLM to generate Cypher with few-shot prompts, the GraphCypherQAChain for end-to-end natural-language querying, schema-hallucination guards, and the four retrieval paradigms (vector, full-text, traversal, geospatial) the finished graph unites.

Compliance

This book complies with DLAI's Community Code of Conduct:

  • Non-commercial (CC-BY-NC-4.0 on prose, MIT on code)
  • DLAI cited; instructor Andreas Kollegger named
  • No quizzes / graded assignments / lab solutions / verbatim transcripts

Takedown requests: brandon.m.behring@gmail.com (48-hour response).