liveBook · Manning

Structured extraction

As explained in Essential GraphRAG

Structured data extraction is the process of converting information from unstructured sources into machine-readable data organized by explicit fields and relationships.

Structured extraction converts unstructured text into a predetermined format such as fields, records, tables, or key–value pairs. It addresses a limitation of text embeddings: semantic similarity supports retrieval, but not reliable filtering, sorting, counting, or aggregation. LLMs can identify required information and produce structured data for analysis, retrieval, or knowledge graph construction. section 6.0 section 6.1

A practical extraction workflow typically follows these steps:

  • Define the target schema, including field names, types, descriptions, required values, nested objects, and permitted enum values. section 6.1.1
  • Process source documents with an LLM and request output that conforms to the schema through function calling or schema definitions. section 6.1 section 6.1.1
  • Store the resulting structured records in a graph database such as Neo4j, where entities and relationships support more precise queries. section 6.1 section 6.2.3
  • Preserve useful source context by combining extracted structure with unstructured data; for legal documents, split text by clauses rather than only by token or word count. section 6.2.3

Extracting contract records

A contract schema can represent the contract type, parties, effective date, term, and scope. Each party can be a nested organization object containing its name, location, and role. An enum can constrain contract types to values such as Service Agreement, Licensing Agreement, Non-Disclosure Agreement, Partnership Agreement, or Lease Agreement. The extracted JSON can then populate a legal knowledge graph for filtering contracts, relating organizations, and answering multihop questions. section 6.2.3

How Essential GraphRAG covers it

How deep it goes
Explains schema design, prompting guidance, nested objects, enums, graph import, and clause-based chunking without detailing extraction evaluation.
Examples
Demonstrates calendar events, legal contracts, organizations, locations, JSON records, enums, and clause-based document chunks.
What it assumes
Assumes familiarity with document chunking, embeddings, and retrieval while teaching schema-guided extraction and graph construction.
What you can do after
Build it from scratch by defining schemas, prompting LLMs, extracting records, and importing results into a graph database.
How it connects
Connects embeddings, retrieval, RAG, knowledge graphs, graph databases, entity resolution, and unstructured data.

Also explained in

Compare how 4 books explain structured extraction →

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.