liveBook · Manning

Knowledge graph

As explained in Essential GraphRAG

A knowledge graph is a structured representation of entities, attributes, and relationships that supports semantic connections among information.

A knowledge graph represents entities and concepts as nodes, then connects them with relationships. In retrieval-augmented generation (RAG), it links structured records with unstructured content so retrieval can preserve context and answer precise, interconnected questions. section 1.0 section 1.4

Use a knowledge graph when retrieval must combine semantic context with explicit structure:

  • Store structured facts such as employees, tasks, dates, statuses, reporting lines, and company hierarchies. section 1.4
  • Attach unstructured material such as articles or contract text to the entities and relationships it describes. section 1.4
  • Query explicit relationships for filtering, counting, aggregation, and interconnected answers that text embeddings alone may miss. section 1.4 section 6.1

A practical construction workflow starts with raw documents, uses an LLM to extract parties, dates, terms, and other fields, serializes the result as JSON, and imports it into Neo4j. The resulting graph supports reliable retrieval for domain-specific questions. section 6.0 section 6.1

Legal-contract retrieval

For a legal chatbot, extract involved parties, contract dates, payment terms, and agreement status from contract documents. Store those facts and their relationships in Neo4j so questions about payment terms or counts of active agreements use structured data rather than only similar text chunks. section 6.1

Figure 1.14 A knowledge graph can store complex structured and unstructured data in a single database system.
figure

Use the figure to inspect how structured records and unstructured article content coexist in one connected graph. section 1.4

How Essential GraphRAG covers it

How deep it goes
Explains nodes, relationships, mixed data, extraction, JSON output, and graph import, without detailing a complete graph schema.
Examples
Uses employee hierarchies, tasks, articles, legal contracts, payment terms, and active-agreement counts as retrieval examples.
What it assumes
Assumes familiarity with document chunking, embeddings, and retrieval while teaching graph construction from unstructured text.
What you can do after
Build it from scratch by extracting structured facts from text, modeling relationships, importing JSON into Neo4j, and supporting precise retrieval.
How it connects
Connects RAG, graph databases, structured data extraction, text embeddings, vector retrieval, and LLMs.

Also explained in

Compare how 12 books explain knowledge graph →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Essential GraphRAG. The section links point to the parts of the book it draws on.