# What is state in LangGraph?

State is the shared data a LangGraph graph's nodes read and update. You define it as a `TypedDict`, a `dataclass`, or a Pydantic `BaseModel`, and every node works against that one object instead of passing values to the next node directly.

A node doesn't return the full state. It returns a partial update, and LangGraph applies it key by key through that key's reducer. Without a reducer the default replaces the old value, so a node that writes `messages` overwrites `messages` and leaves every other key alone. Attach a reducer such as an append function with `Annotated`, and the update merges into the old value instead.

That is why state is the thing to grade. Each node's output is a diff against a shared object, so a wrong value can sit untouched in a key for several steps before a later node reads it. A final answer alone won't show you which step wrote it, and [a trace of the run](/answers/instrumentation/how-do-i-trace-an-ai-agent) is what lets you find that step.

One limit: a node can write to any channel in the graph state, including keys outside its declared input schema, so a node's inputs don't bound what it can change.

---

Published: 2026-11-04

Sources:
- LangGraph docs: Graph API: https://docs.langchain.com/oss/python/langgraph/graph-api (fetched 2026-11-04)

Source: https://tessary.ai/answers/langgraph-evals/what-is-state-in-langgraph
More on LangGraph evals: https://tessary.ai/answers/langgraph-evals
From Tessary, agent reliability for AI agents in production: https://tessary.ai
