liveBook · Manning

Agent state

As explained in Knowledge Graphs and LLMs in Action

Agent state is a structured record containing the information exchanged and accumulated by agents during a workflow.

Agent state is a structured record that carries information between agents and accumulates intermediate results throughout a LangGraph question-answering workflow. section 15.1.5

The state coordinates a staged pipeline by storing:

  • Visualization intent, including output type and the reason for selecting a table, graph, or map. section 15.1.5
  • Knowledge-graph schema information, generated Cypher, query reasoning, and serialized query messages. section 15.1.5
  • Execution results, errors, retry counts, routing information, summaries, and summary reasoning. section 15.1.5

State-driven QA pipeline

Intent detection enriches the record, schema extraction adds a Neo4j schema, text-to-Cypher generates a query, and query execution records errors and increments retries. Routing then retries failed queries up to three runs, summarizes graph or map results, or ends directly for other output types. section 15.1.5

Figure 15.7 LangGraph implementation of the knowledge expert-emulating graph-querying pipeline
figure

Trace how agents connect and how state information progresses from the user’s question to the final answer. section 15.1.5

How Knowledge Graphs and LLMs in Action covers it

How deep it goes
Explains state fields through agent implementations and routing logic, but does not specify the complete AgentState type declaration.
Examples
Uses visualization intent, schema extraction, text-to-Cypher generation, query execution, retries, and summary generation as concrete state updates.
What it assumes
Assumes a LangGraph pipeline with specialized agents, prompts, and a configured Neo4j schema.
What you can do after
Build it via LangGraph by defining agent nodes that read state and return incremental field updates.
How it connects
Connects LangGraph, agents, knowledge graphs, LLMs, Neo4j schemas, Cypher queries, and conditional routing.

This explainer was generated by Manning's knowledge graph from the text of Knowledge Graphs and LLMs in Action. The section links point to the parts of the book it draws on.