Context Graph: How Organizations Use LLMs Cost-Effectively
Large organizations want to use large language models (LLMs) to answer questions and generate accurate content, but the models themselves know nothing about the organization. The missing piece is context — the right slice of enterprise knowledge, delivered into the prompt at the right moment, in the fewest tokens.
This book is about context graphs: enterprise graph data structures designed to assemble that compact, high-value context. Context graphs are structured, persistent records of product data, customer data, ontologies, and decision traces — capturing not just what happened inside an enterprise, but why it happened, who approved it, and which precedents justified it.
The focus throughout the book is token efficiency and quality of content returned from an LLM. Every modeling decision, retrieval pattern, and architectural choice is evaluated against that pair of constraints.
This textbook is written for three overlapping groups:
Enterprise architects and senior engineers designing AI-powered systems who need a principled approach to organizational memory and context management.
AI/ML practitioners and data engineers building LLM-powered applications and struggling with hallucinations, missing context, and poor decision quality in agent workflows.
Technical product managers and founders building or evaluating products in the enterprise AI space who want a framework for where context graphs create durable competitive advantage.
The book assumes comfort reading technical content and some exposure to software systems. It does not require a deep background in machine learning or graph databases — knowledge graphs, labeled property graphs, and formal ontologies are all introduced from first principles.
The most expensive problem in enterprise AI is no longer the model — it is the context the model is given. Large language models can summarize, reason, and draft fluent text, but only when they are handed the right organizational knowledge at the right moment.
Today most organizations solve that problem one prompt at a time, stuffing whatever they can fit into a context window and hoping for the best. There is no canonical reference for the discipline that should sit underneath those prompts. This book exists to define that discipline and to give practitioners a working blueprint.
The opportunity is genuinely large:
McKinsey estimates generative AI could add $2.6 to $4.4 trillion in value annually across industries — but the majority of enterprise deployments remain stuck in pilot stages, blocked by hallucinations, missing context, and brittle integrations.
Foundation Capital's analysis of the AI market frames the trillion-dollar enterprise opportunity not as building better foundation models, but as solving the context problem — giving models the right organizational knowledge at the moment of decision.
Gartner predicts that over 40% of agentic AI projects will be cancelled by the end of 2027, citing escalating costs, unclear business value, and inadequate risk controls — failure modes that largely trace back to missing or unreliable context.
The Stanford AI Index reports that enterprise generative AI adoption has crossed a majority threshold, yet only a small fraction of organizations report consistent, production-grade results — a gap that reflects the missing layer of persistent, structured context.
The literature gap is the reason for this book:
Context graphs as a discipline sit between three mature fields — knowledge graphs, retrieval-augmented generation (RAG), and process mining — but no widely available textbook treats them as a unified practice. Practitioners building this layer today usually stitch together blog posts, vendor documentation, and trial-and-error.
Context graphs deserve a foundational text, and this book aims to become a pillar reference that future books, courses, and products build on.
What makes this book different:
Most books on enterprise AI stop at architectural sketches or vendor walkthroughs. This one is built on a validated learning graph of 496 interconnected concepts organized into 12 taxonomy categories, introduced across 22 chapters in strict prerequisite order so the ideas compound rather than collide.
It pairs an extensive background on graph fundamentals, semantic layers, metadata standards, and decision traces with precise, queryable graph models — schemas you can implement and query directly, not just diagrams to admire.
The entire textbook is open source and free — no paywalls, no access codes, no subscription — because a foundational discipline needs an accessible foundational reference.
By Dan McCreary
dmccreary.github.io/context-…
--
Connected Data London 2026 | 11–12 November | Leonardo Royal Hotel London Tower Bridge
🎤 Share your work with the world's most passionate data community. The Call for Submissions is open.
connected-data.london/2026-c…
🎟 Tickets on sale now. Early bird discounts up to 30%.
2026.connected-data.london?u…
📺 Sponsorship opportunities available. Contact info@connected-data.london for details.
#KnowledgeGraph #GraphRAG #Ontology #Graph #AI #DataScience #GraphDB #SemTech