Chapter 1: Knowledge graphs and LLMs: A killer combination
The chapter introduces why knowledge graphs and large language models complement each other in domain-specific, data-driven applications.
After this chapter you will be able to
- LLM Limitations in Critical Domains. Explain why generative AI alone can fall short when applications need domain knowledge, high accuracy, and explainability.
- Knowledge Graph Contextual Representation. Describe what knowledge graphs represent and what they contribute to an application.
- Complementary KG and LLM Roles. Explain how LLMs and KGs compensate for each other’s weaknesses and what their combination enables.
- Knowledge graph building blocks. Explain how nodes, relationships, and properties represent entities, meaningful connections, and context in a knowledge graph, and why that explicit structure supports reasoning and inference.
- Knowledge graph construction challenges. Distinguish the work of mapping structured or semistructured sources into a common graph schema from the harder task of extracting entities and connections from unstructured text. Describe some language features that make text extraction difficult.
- Knowledge graph access barriers. Explain why storing interconnected knowledge does not by itself make a knowledge graph easy to use, including the demands of graph querying and the limits of predefined queries.
- Transfer learning across tasks. Explain how LLMs reuse patterns learned on a general language task for a specific task, reducing the need to train a separate model from scratch for each task.
- Scale and language model performance. Describe what makes a pretrained language model an LLM and identify the factors the section connects to its performance: model size, training-corpus size and quality, and next-token prediction.
- Data-centric model development. Distinguish the section’s data-centric emphasis from a model-centric approach, and explain why both the quantity and quality of training data matter.
- LLM assistance with KGs. Describe how LLMs help build KGs from unstructured data, support querying them, and summarize extracted information in text.
- KG grounding and freshness. Explain how KGs can reduce plausible but incorrect LLM answers and give LLMs access to more current information.
- Traceable KG explanations. Explain how KGs and LLMs complement each other in making results understandable and checkable.
- Connected knowledge paradigm. Explain why knowledge graphs offer an alternative to purpose-built systems in complex domains: they represent connections across heterogeneous data and support relationship discovery through graph pattern matching and traversal.
- Domain-specific knowledge graph definition. Describe a knowledge graph as an evolving graph of typed entities, attributes, and meaningful named relationships that integrates structured and unstructured domain data for humans and machines.
- Evolving graph structure. Explain how a KG can continuously take in and unify information while extending its graph structure as needs change, without a complete overhaul.
- Explicit data semantics. Explain how typed entities and meaningful relationships make data's meaning explicit and provide context that supports explanation and reasoning.
- Meaning-based data integration. Explain how a KG acts as a central reference for structured and unstructured domain data, connecting multiple sources through their meaning despite differences in format or provenance.
- Insights and inferred knowledge. Describe how people can analyze, visualize, and query a KG for insights, while inference rules and machine learning can derive information not explicitly encoded in it.
- Healthcare as a recurring example. Explain why the book frequently uses healthcare examples: its challenges and requirements transfer to other domains, and its abundant public data supports realistic examples.
- Drug discovery knowledge graphs. Explain why drug development needs accurate, contextualized integration of data and how a KG connects genes, diseases, and drugs through typed relationships that support inference.
- LLM contributions to drug discovery. Describe how LLMs process unstructured drug-development sources, expand KGs with potential relationships, and support the search for new therapeutics.
- Need for conversational grounding. Explain why fluent language generation alone may not make a personalized assistant useful, and what kind of knowledge support the section says it needs.
- KG and LLM combination. Describe how knowledge graphs and LLMs contribute to a customer support conversation when used together.
- Knowledge graph suitability signals. Describe the needs that make a knowledge graph worth considering, including connecting disparate data and working with relationships across that data.
- LLM support suitability signals. Explain which needs point toward adding LLMs to a KG-based solution: extracting knowledge from unstructured data, interpreting queries, providing conversation, or summarizing results.
- RDF and LPG representations. Distinguish how RDF and labeled property graphs (LPGs) represent knowledge graphs, including how they treat relationships.
- Complementary paradigm strengths. Explain when the section presents RDF or LPG as advantageous, and why the paradigms can be complementary rather than interchangeable in every use case.
- Taxonomy and ontology roles. Distinguish a taxonomy’s broader–narrower category hierarchy from an ontology’s ability to express more complex conceptual relationships, using the section’s examples.
- Just enough semantic modeling. Explain why modern KGs may use a focused, partial ontology rather than impose a rigid, complete one.
Section by section
Introduction
The chapter introduces why knowledge graphs and large language models complement each other in domain-specific, data-driven applications.
- LLM Limitations in Critical Domains: Explain why generative AI alone can fall short when applications need domain knowledge, high accuracy, and explainability.
Why it matters: These limitations explain why the chapter brings knowledge graphs into the picture. - Knowledge Graph Contextual Representation: Describe what knowledge graphs represent and what they contribute to an application.
Why it matters: A graph’s entities and connections are the source of the context it can contribute. - Complementary KG and LLM Roles: Explain how LLMs and KGs compensate for each other’s weaknesses and what their combination enables.
Why it matters: The combination gives each technology a role that addresses limitations of the other.
Key terms: generative AI, LLMs, hallucinations, domain-specific grounding, knowledge graphs, entities, connections, context, entity extraction, relationships
1.1 Knowledge graphs
This section explains how knowledge graphs represent connected knowledge and why building and using them can be difficult.
- Knowledge graph building blocks: Explain how nodes, relationships, and properties represent entities, meaningful connections, and context in a knowledge graph, and why that explicit structure supports reasoning and inference.
Why it matters: These building blocks explain what makes a knowledge graph useful to an intelligent system. - Knowledge graph construction challenges: Distinguish the work of mapping structured or semistructured sources into a common graph schema from the harder task of extracting entities and connections from unstructured text. Describe some language features that make text extraction difficult.
Why it matters: The source data determines how difficult it is to turn information into a usable graph. - Knowledge graph access barriers: Explain why storing interconnected knowledge does not by itself make a knowledge graph easy to use, including the demands of graph querying and the limits of predefined queries.
Why it matters: Useful knowledge still needs an accessible way to ask questions and understand the answers.
Key terms: nodes, relationships, properties, reasoning, inference, heterogeneous data sources, structured data, semistructured data, unstructured data, common graph schema
1.2 Large language models
The section explains how transfer learning, large-scale training, and attention to training data make LLMs useful across natural-language tasks.
- Transfer learning across tasks: Explain how LLMs reuse patterns learned on a general language task for a specific task, reducing the need to train a separate model from scratch for each task.
Why it matters: It explains why one language model can support several applications rather than requiring a new model for every task. - Scale and language model performance: Describe what makes a pretrained language model an LLM and identify the factors the section connects to its performance: model size, training-corpus size and quality, and next-token prediction.
Why it matters: These factors explain the section’s account of why large pretrained models perform well on varied language tasks. - Data-centric model development: Distinguish the section’s data-centric emphasis from a model-centric approach, and explain why both the quantity and quality of training data matter.
Why it matters: It keeps attention on the training data, not just model architecture, when explaining LLM results.
Key terms: transfer learning, generic tasks, relation extraction, pretrained language models, large language model, parameters, training corpus, next token prediction, model-centric paradigm, data-centric paradigm
1.3 KGs and LLMs: Stronger together
This section explains how LLMs help build and use knowledge graphs, while knowledge graphs make LLM-supported systems more accurate, current, and explainable.
- LLM assistance with KGs: Describe how LLMs help build KGs from unstructured data, support querying them, and summarize extracted information in text.
Why it matters: It shows where language models make graph-based applications easier to build and use. - KG grounding and freshness: Explain how KGs can reduce plausible but incorrect LLM answers and give LLMs access to more current information.
Why it matters: An updatable source of verified knowledge addresses two important limits of an LLM on its own. - Traceable KG explanations: Explain how KGs and LLMs complement each other in making results understandable and checkable.
Why it matters: A readable answer is more trustworthy when someone can also trace and validate where it came from.
Key terms: building KGs, unstructured data, querying KGs, summarizing, hallucinations, stale information, structured, verified knowledge, GraphRAG, explainability, transparent information paths
1.4 The paradigm shift in data-driven applications
This section contrasts purpose-built, homogeneous data systems with knowledge graphs as connected, reusable knowledge sources for complex, heterogeneous domains.
- Connected knowledge paradigm: Explain why knowledge graphs offer an alternative to purpose-built systems in complex domains: they represent connections across heterogeneous data and support relationship discovery through graph pattern matching and traversal.
Why it matters: This contrast explains why connected knowledge can serve applications that outgrow a single-purpose database. - Reduced data fragmentation: Describe how KGs address siloed data by creating knowledge sources that lower barriers to data access and enhance governance.
Why it matters: The benefit of connected data extends beyond finding relationships to making fragmented data more usable.
Key terms: knowledge graphs, graph pattern matching, traversal, source of truth, data fragmentation, siloed data, data access, governance
1.4.1 The four pillars of knowledge graphs
The section defines a knowledge graph and explains its four pillars: evolution, semantics, integration, and learning.
- Domain-specific knowledge graph definition: Describe a knowledge graph as an evolving graph of typed entities, attributes, and meaningful named relationships that integrates structured and unstructured domain data for humans and machines.
Why it matters: This definition establishes what the four pillars describe. - Evolving graph structure: Explain how a KG can continuously take in and unify information while extending its graph structure as needs change, without a complete overhaul.
Why it matters: A KG can keep pace with changing information and analytical needs. - Explicit data semantics: Explain how typed entities and meaningful relationships make data's meaning explicit and provide context that supports explanation and reasoning.
Why it matters: Explicit meaning makes graph connections useful as context, not merely as links. - Meaning-based data integration: Explain how a KG acts as a central reference for structured and unstructured domain data, connecting multiple sources through their meaning despite differences in format or provenance.
Why it matters: Meaning provides a way to bring varied domain sources into a connected picture. - Insights and inferred knowledge: Describe how people can analyze, visualize, and query a KG for insights, while inference rules and machine learning can derive information not explicitly encoded in it.
Why it matters: The graph is useful not only for storing information but also for discovering insights and inferring more.
Key terms: knowledge graph, typed entities, attributes, meaningful named relationships, evolution, ingest, integrate, unify, semantics, meaningful relationships
1.5 Building data-driven applications using KGs and LLMs
Introduces application examples and explains why healthcare is a recurring example for KG and LLM use cases.
- Healthcare as a recurring example: Explain why the book frequently uses healthcare examples: its challenges and requirements transfer to other domains, and its abundant public data supports realistic examples.
Why it matters: It explains why healthcare examples can illustrate ideas relevant beyond healthcare.
Key terms: healthcare, publicly available data
1.5.1 Example use case: Drug discovery and development
This section uses drug discovery to show how knowledge graphs integrate biomedical data and how LLMs can expand those graphs from unstructured sources.
- Drug discovery knowledge graphs: Explain why drug development needs accurate, contextualized integration of data and how a KG connects genes, diseases, and drugs through typed relationships that support inference.
Why it matters: It explains why connecting data is not enough: the connections must carry biological meaning. - LLM contributions to drug discovery: Describe how LLMs process unstructured drug-development sources, expand KGs with potential relationships, and support the search for new therapeutics.
Why it matters: It shows how information in research text can contribute to a KG and help guide drug-development research.
Key terms: data integrity, typed relationships, transitive bonds, inference, unstructured data, scientific publications, clinical reports, hypothesis generation, text mining
1.5.2 Example use case: Conversational AI for customer support
This section explains how knowledge graphs can ground LLM-powered customer support conversations so responses are more useful and contextually relevant.
- Need for conversational grounding: Explain why fluent language generation alone may not make a personalized assistant useful, and what kind of knowledge support the section says it needs.
Why it matters: A coherent-sounding answer is not necessarily a useful answer to a customer's specific question. - KG and LLM combination: Describe how knowledge graphs and LLMs contribute to a customer support conversation when used together.
Why it matters: The combination gives the assistant both conversational fluency and relevant background knowledge.
Key terms: contextual grounding, entities and relationships, structured knowledge, KGs, LLMs, graph-based background context, conversational flow
1.5.3 Deciding whether to use a KG
The section offers questions for deciding when a knowledge graph is useful and when LLMs should support a KG-based solution.
- Knowledge graph suitability signals: Describe the needs that make a knowledge graph worth considering, including connecting disparate data and working with relationships across that data.
Why it matters: These questions help you judge whether a KG fits the problem rather than choosing one by default. - LLM support suitability signals: Explain which needs point toward adding LLMs to a KG-based solution: extracting knowledge from unstructured data, interpreting queries, providing conversation, or summarizing results.
Why it matters: It distinguishes the needs that call for LLM support from those that point toward using a KG.
Key terms: KGs, data silos, provenance, relational nature of data, LLMs, entities and relationships, unstructured data, conversational interfaces
1.6 Knowledge graph technologies
Introduces RDF and labeled property graphs as distinct but complementary ways to represent and query knowledge graphs.
- RDF and LPG representations: Distinguish how RDF and labeled property graphs (LPGs) represent knowledge graphs, including how they treat relationships.
Why it matters: The representation determines how relationships and their properties are expressed in a KG. - Complementary paradigm strengths: Explain when the section presents RDF or LPG as advantageous, and why the paradigms can be complementary rather than interchangeable in every use case.
Why it matters: Choosing a KG approach depends on whether the application most needs shared semantics or property-rich traversal.
Key terms: RDF, LPG, statements or triplets, predicates, nodes, edges, data interoperability, semantic consistency, ontologies, pathfinding
1.6.1 Taxonomies and ontologies
This section explains how taxonomies and ontologies add meaning to knowledge graphs and why modern KGs often use only the semantics they need.
- Semantics beyond graph structure: Explain why a graph’s structural information alone does not fully express the relationships in its data, and how taxonomies and ontologies add semantics.
Why it matters: This explains why representing data as a graph is not, by itself, enough to express its meaning. - Taxonomy and ontology roles: Distinguish a taxonomy’s broader–narrower category hierarchy from an ontology’s ability to express more complex conceptual relationships, using the section’s examples.
Why it matters: The distinction helps you identify what kind of meaning each tool contributes to a KG. - Just enough semantic modeling: Explain why modern KGs may use a focused, partial ontology rather than impose a rigid, complete one.
Why it matters: A focused ontology can provide useful meaning now without making the KG too rigid to evolve.
Key terms: semantics, taxonomies, ontologies, KGs, broader–narrower relationships, disjointness, just enough semantics, partial ontologies, ontology features
1.7 How do we teach KGs and LLMs?
The section outlines the skills the book will teach and says it will use practical examples.
1.8 Summary
Where this is used later
- Building a knowledge graph (chapter 3) · Building a knowledge graph uses the entities and connections introduced here.
- Key concepts of knowledge extraction (chapter 5) · Knowledge extraction from text addresses the unstructured-data challenge introduced here.
- Enabling domain experts with knowledge graphs (chapter 14) · Enabling domain experts to use knowledge graphs addresses the access barrier described here.
- Using LLMs (chapter 5) · Provides context for using LLMs on domain-specific knowledge-extraction tasks.
- Building KGs with large language models (chapter 5) · Develops the use of LLMs to build KGs.
- Thinking in queries: From text to Cypher (chapter 14) · Develops the use of LLMs to turn questions into graph queries.
- (chapter intro) (chapter 2) · The earlier discussion of KGs and LLMs working together provides context for this hybrid approach.
- What is intelligence? (chapter 2) · The earlier introduction to combining KGs and LLMs.
Concepts explained in this chapter
- knowledge graphA knowledge graph is an evolving graph data structure of typed entities, attributes, and meaningful named relationships that integrates structured and unstructured domain data.
- language modelA large language model is a neural language model trained on very large text corpora to understand and generate natural-language content.
- graphA graph structure is a data representation consisting of interconnected vertices and edges.
- edgeA relationship, or edge, is a graph connection representing a meaningful association between nodes.
- schemaA schema is a formal specification of the structure, types, and relationships permitted in a data representation.
- semanticsSemantics is the explicit representation of the meaning of data through typed entities and meaningful relationships.
- data integrationThe process of combining data from multiple sources into a coherent and consistent representation.
- hallucinationA language-model failure in which generated content is plausible but factually unsupported or incorrect.
- ontologyAn ontology is a formal model of concepts, relationships, and constraints in a domain that supports shared interpretation and inference.
- RDFRDF (Resource Description Framework) is a W3C-standard graph data model that represents knowledge as subject-predicate-object triples.
- property graphA labeled property graph is a graph data model in which nodes and edges have labels and properties and represent relationships.
- data-centric paradigmA machine-learning development approach that prioritizes improving the quality and quantity of training data.
- transfer learningTransfer learning is a machine-learning technique that reuses patterns learned from one task or domain to improve performance on another task or domain.
- GraphRAGGraphRAG is a retrieval-augmented generation approach that uses graph-structured knowledge to ground language-model outputs.
- knowledge graph constructionKnowledge graph construction is the process of creating a knowledge graph by defining its scope, understanding its domain, and integrating information from multiple sources.
- domain knowledgeSpecialized knowledge and contextual understanding of a particular scientific or professional domain.
- graph neural networkA graph neural network is a neural network architecture that learns representations by propagating information among nodes and edges of a graph.
- unstructured dataUnstructured data is information lacking a fixed tabular or schema-constrained organization, such as free-form documents.
- coreference resolutionCoreference resolution is the technique of determining which entity or expression a referring phrase, such as a pronoun or shortened name, denotes.
- multi-step reasoningReasoning is the process of analyzing information, applying rules, and drawing conclusions from evidence or premises.
- interpretabilityThe provision of understandable evidence or reasoning that allows people to inspect and validate an artificial intelligence system's outputs.
- source of truthA source of truth is an authoritative repository or representation from which consistent information is derived.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
