Book — 20 chapters
Knowledge Graphs for Enterprise AI
A practitioner's guide from SQL to knowledge graphs. 15 chapters and 4 capstone projects bridging relational database experience with graph-powered AI systems — GraphRAG, graph-aware agents, knowledge graph construction, and production deployment.
Part 01 Why Graphs Matter Now
The JOIN Wall
Your compliance query spans 12 tables and takes 4 hours. This chapter explains why deep JOINs hit a performance wall, what graph databases do differently with index-free adjacency, and how to decide whether your workload belongs in a relational database or a graph.
How Graphs Actually Work
A ground-up explanation of graph databases for people who already understand tables, rows, columns, and JOINs. Covers the property graph model, maps every concept to its relational equivalent, and compares Neo4j, Amazon Neptune, and FalkorDB.
The AI Connection
Why vector search alone cannot answer relationship questions, how knowledge graphs give AI structured memory, and the three patterns for combining graphs with LLMs: graph-enhanced RAG, graph-aware agents, and graph-based memory.
Part 02 Graph Thinking
Translating Your Data Model
A pattern-by-pattern guide to converting ERD structures into graph models. Covers five common relational patterns — self-referencing tables, many-to-many junctions, polymorphic associations, temporal data, and hierarchical categories — with SQL schemas, graph models, and clear guidance on when the graph version is better.
Cypher for SQL People
A side-by-side translation of 20 common SQL query patterns into Cypher. Covers SELECT, JOIN, WHERE, GROUP BY, subqueries, INSERT, UPDATE, DELETE, and five queries that are painful in SQL but elegant in Cypher. Includes a complete cheatsheet table.
When to Use Graphs (and When Not To)
A decision framework for evaluating whether a graph database belongs in your architecture. Covers six diagnostic questions, five use cases where graphs shine, five where relational is better, hybrid architecture patterns, and a cost comparison of Neo4j Aura, Amazon Neptune, and self-hosted options.
Part 03 Building Knowledge Graphs
Knowledge Graphs from Documents
How to turn thousands of unstructured documents into a searchable knowledge graph. Covers the extraction pipeline from document to graph, LLM-based entity and relationship extraction with Pydantic schemas, entity resolution strategies, and quality challenges including hallucinated entities and duplicate nodes.
Ontology Design Without a PhD
How to design a practical ontology for your knowledge graph without academic overhead. Covers iterative design starting with five node types and five relationship types, common ontology patterns by industry, using LLMs to suggest structure, schema validation, and anti-patterns to avoid.
Data Quality for Knowledge Graphs
How to test and validate a knowledge graph. Covers automated quality checks for orphan nodes, duplicate entities, type violations, and missing relationships. Includes consistency validation, coverage metrics, human review workflows, continuous monitoring, and a complete Python validation pipeline with Neo4j queries.
Part 04 Graph-Powered AI
GraphRAG — Beyond Vector Search
Why vector-only RAG fails for relationship questions, and how GraphRAG solves it. Covers the architecture of hybrid retrieval combining vector search with graph traversal, Microsoft's community summary approach, a step-by-step implementation with LangChain and Neo4j, and a comparison of vector-only vs GraphRAG across ten question types.
Graph-Aware Agents
How to build AI agents that reason over knowledge graphs. Covers tool design for Cypher queries, path finding, impact analysis, and subgraph summarization. Includes agent architecture with LangChain and LangGraph, teaching agents to generate Cypher, guardrails for production safety, and three complete use case implementations.
Multi-Hop Reasoning
How to answer questions that require traversing multiple relationships in a knowledge graph. Covers question decomposition, chain-of-traversal reasoning, combining graph paths with LLM synthesis, a complete multi-hop reasoning agent with step-by-step trace, and performance strategies for deep traversals.
Part 05 Production
Migration Strategy
How to add a graph database alongside your existing relational systems without ripping anything out. Covers the sidecar pattern, CDC pipelines from PostgreSQL to Neo4j, phased migration timelines, dual-write vs CDC vs batch sync trade-offs, team structure, rollback strategies, and a complete CDC pipeline implementation with Debezium.
Testing Graph Systems
How to test graph databases from unit tests through end-to-end validation. Covers the graph test pyramid, Cypher query unit tests with fixtures, integration tests for extraction pipelines, query regression testing, data quality automation in CI/CD, performance benchmarks, and a complete pytest test suite using testcontainers.
Monitoring and Operations
How to keep a graph database running in production. Covers the three things that will break at 3am, key metrics dashboards, alerting rules, backup and disaster recovery, scaling patterns including read replicas and connection pooling, cost management, and a runbook template for common operational issues.
Part 06 Capstones
Capstone 1: Compliance Knowledge Graph
Build a regulatory compliance knowledge graph from real documents. Covers PDF ingestion, LLM-based entity and relationship extraction, Neo4j graph construction, and a GraphRAG query layer that answers questions like "Which regulations affect our payment processing system?"
Capstone 2: Fraud Investigation Agent
Build a graph-powered agent that traces transaction networks to investigate suspicious patterns. Covers graph modeling for financial transactions, agent architecture with Cypher traversal tools, multi-hop money flow tracing, and automated pattern detection for fraud rings, rapid movement, and structuring.
Capstone 3: IT Dependency Mapper
Build an application dependency graph for impact analysis. Covers ingesting CMDB and service catalog data, building a dependency graph, blast radius queries, an impact analysis agent that answers "If the payment gateway goes down, what else breaks?", and automated dependency report generation.
Capstone 4: Customer 360 with GraphRAG
Build a unified customer view combining CRM, support tickets, and product data into a knowledge graph. Covers data modeling for multi-source customer data, ingestion from three systems, graph-based customer journey queries, and a GraphRAG layer that answers "Tell me everything about this customer's journey."