liveBook · Manning

Chapter 6: Building knowledge graphs with large language models

What you will learn in chapter 6 of Knowledge Graphs and LLMs in Action

The introduction recalls what the Rockefeller Archive Center documents contain and sets up the move from extracted text to a knowledge graph.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction recalls what the Rockefeller Archive Center documents contain and sets up the move from extracted text to a knowledge graph.

Key terms: Rockefeller Archive Center, Rockefeller Foundation, program officers

6.1 Transforming an archive to a KG

This section explains the archive’s main extraction challenges and why LLM-assisted knowledge graph building is promising for addressing them.

Key terms: optical character recognition (OCR), named entity recognition (NER), disambiguation, entity resolution, Occupations, relation extraction (RE) schema, KG normalization, cleansing, GPT, prompts

6.1.1 Graph modeling

This section introduces the RAC graph’s three-layer schema and explains why LLM-extracted entities need further processing before becoming a knowledge graph.

Key terms: document-level layer, metagraph layer, KG layer, File node, Page node, Entity nodes, LLM, normalization, entity resolution, schema

6.1.2 Creating a metagraph

The section explains how to build a page-based metagraph that keeps entity mentions and relations tied to their source text before creating the final knowledge graph.

Key terms: chunking strategy, max tokens limit, splitting by page, metagraph, entity mentions, Entity, RELATED_TO_ENTITY, normalization, entity resolution, final KG

6.1.3 Normalization and cleansing

The section shows how metagraph statistics reveal opportunities to normalize extracted entities before linking them into the knowledge graph.

Key terms: metagraph, top entities per class, top relation classes, normalization, cleansing, name_normalized, Occupations

6.1.4 Graph-based entity resolution

This section explains how to resolve entity mentions across documents by combining name similarity with graph relationships, then grouping matching mentions into final KG entities.

Key terms: entity resolution, entity disambiguation, coreference resolution, metagraph layer, META_SIMILAR, WORKS_FOR, string similarity, stopword list, WORKS_ON, Occupations

6.2 Intellectual network analysis: The value of graphs

The section uses an LLM-built knowledge graph to explore scientists’ influence networks, find useful connections, and show why graph findings need human validation.

Key terms: intellectual network, betweenness centrality, bridges, few-hop query, two-hop distance, PageRank centrality, RE task, feedback loop, validate or invalidate, WORKS_FOR

6.3 Next steps in the Rockefeller Archive Center project

The section identifies what the Rockefeller Archive Center knowledge graph would need to move from a 150-page demonstration toward a production-quality project.

Key terms: prompt engineering, fine-tuning, token limit, diary entries, Occupations, entity resolution, embeddings, agglomerative hierarchical clustering, Conversation nodes, follow-up chains

6.4 The value of knowledge graphs in the LLM era

This section explains why building a knowledge graph from data can be more useful than asking an LLM questions about that data directly.

Key terms: Explainability, Demystification, de-black-boxing, conflicting sources of information, Democratization, downstream tasks and analyses, batch updates, Explorability, Advanced analytics, global views

6.5 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 5: Extracting domain-specific knowledge from unstructured data Chapter 7: Named entity disambiguation →

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.