Intermediate2h4m

Knowledge Graphs for RAG

Instructor: Andreas Kollegger

Neo4j logo

Earn an accomplishment with PRO · Updated Oct 7, 2025

  • Intermediate
  • 2h4m
  • 9 Video Lessons
  • 6 Code Examples
  • 1 Graded Assignment PRO
  • Earn an accomplishment with PRO
  • Updated Oct 7, 2025
  • Instructor: Andreas Kollegger
  • Neo4jNeo4j
  • Learn more aboutMembership PRO Plan

What you'll learn

  • Use Neo4j’s query language Cypher to manage and retrieve data stored in knowledge graphs.

  • Write knowledge graph queries that find and format text data to provide more relevant context to LLMs for Retrieval Augmented Generation.

  • Build a question-answering system using Neo4j and LangChain to chat with a knowledge graph of structured text documents.

Course recap

PRO

This course teaches how to use knowledge graphs (specifically Neo4j) to improve retrieval-augmented generation applications. Taught by Andreas Kollegger from Neo4j, it builds a complete knowledge graph from SEC financial filings (Form 10-K and Form 13), demonstrating how graph relationships enable richer context retrieval than pure vector similarity search.

Concept map

Concepts in Knowledge Graphs for RAG and the courses that connect to themKnowledge Graphs for RAGKnowledge GraphsEmbeddingsRetrieval-Augmented GenerationRetrieval-Augmented Gener…ChunkingKnowledge Graphs for AI Agent API DiscoveryKnowledge Graphs for AI A…LangChain for LLM Application DevelopmentLangChain for LLM Applica…Large Language Models with Semantic SearchLarge Language Models wit…Agentic Knowledge Graph ConstructionAgentic Knowledge Graph C…Advanced Retrieval for AIAI Code ReviewAgent Memory: Building Memory-Aware AgentsAgent Memory: Building Me…Building Multimodal Data PipelinesBuilding Multimodal Data…Concepts in Knowledge Graphs for RAG and the courses that connect to themKnowledge Graphs for RAGKnowledge Graph…Knowledge GraphsEmbeddingsRetrieval-Augmented GenerationRetrieval-Augme…Chunking

Key concepts

  • Knowledge GraphsGraph databases storing information in nodes (with labels and properties) and relationships (with types, directions, and properties), queried with Cypher
  • EmbeddingsVector representations of text chunks stored in Neo4j vector indexes for semantic similarity search
  • Retrieval-Augmented GenerationRetrieval-augmented generation enhanced by graph traversal to expand context beyond what vector search alone retrieves
  • ChunkingSplitting large documents into smaller pieces for embedding, stored as linked lists in the graph to enable chunk window retrieval

Lesson highlights

  1. 1.Introduction — Overview of knowledge graphs for RAG and the SEC financial data use case
  2. 2.Knowledge Graph Fundamentals — Nodes, relationships, labels, properties, and the Cypher query language basics
  3. 3.Querying Knowledge Graphs — Hands-on Cypher with a movies dataset: pattern matching, filtering, creating/deleting data
  4. 4.Preparing Text for RAG — Creating vector indexes in Neo4j, computing OpenAI embeddings, and performing similarity search
  5. 5.Constructing a Knowledge Graph from Text Documents — Building a graph from SEC Form 10-K with text chunking, vector indexing, and basic RAG with LangChain
  6. 6.Adding Relationships to the SEC Knowledge Graph — Creating linked-list chunk relationships, form nodes, section connections, and chunk window queries
  7. 7.Expanding the SEC Knowledge Graph — Adding Form 13 investment data, connecting companies to managers, and graph-enhanced RAG
  8. 8.Chatting with the Knowledge Graph — Geospatial queries, full-text search, LLM-generated Cypher via few-shot learning, and combining graph traversal with QA
  9. 9.Conclusion — Summary and next steps with Neo4j resources

About this course

Knowledge graphs are used in development to structure complex data relationships, drive intelligent search functionality, and build powerful AI applications that can reason over different data types. Knowledge graphs can connect data from both structured and unstructured sources (databases, documents, etc.), providing an intuitive and flexible way to model complex, real-world scenarios.

Unlike tables or simple lists, knowledge graphs can capture the meaning and context behind the data, allowing you to uncover insights and connections that would be difficult to find with conventional databases. This rich, structured context is ideal for improving the output of large language models (LLMs), because you can build more relevant context for the model than with semantic search alone.

This course will teach you how to leverage knowledge graphs within retrieval augmented generation (RAG) applications. You’ll learn to:

  • Understand the basics of how knowledge graphs store data by using nodes to represent entities and edges to represent relationships between nodes.
  • Use Neo4j’s query language, Cypher, to retrieve information from a fun graph of movie and actor data.
  • Add a vector index to a knowledge graph to represent unstructured text data and find relevant texts using vector similarity search.
  • Build a knowledge graph of text documents from scratch, using publicly available financial and investment documents as the demo use case
  • Explore advanced techniques for connecting multiple knowledge graphs and using complex queries for comprehensive data retrieval.
  • Write advanced Cypher queries to retrieve relevant information from the graph and format it for inclusion in your prompt to an LLM.

After course completion, you’ll be well-equipped to use knowledge graphs to uncover deeper insights in your data, and enhance the performance of LLMs with structured, relevant context.

Who should join?

Anyone who wants to understand how knowledge graphs work, how to build with them, and create better RAG applications. We recommend familiarity with LangChain or taking LangChain: Chat with Your Data prior to this course.

Course Outline

9 Lessons・6 Code Examples
Unlock certificates

Elevate your learning experience with Pro

Upgrade to Pro and gain unlimited accomplishments on your resume

Learn More

Instructor

Andreas Kollegger

Andreas Kollegger

Lead for GenAI Innovation at Neo4j

Course access is free for a limited time during the DeepLearning.AI learning platform beta!

Want to learn more about Generative AI?

Keep learning with updates on curated AI news, courses, and events, as well as Andrew’s thoughts from DeepLearning.AI!