Skip to content

< all problems30 · Level 05, Agents

Fix a LangGraph That Forgets Everything

hard · debug · Agents

This graph gathers evidence from three sources, then summarises. It runs without error, but findings ends up with one entry after three nodes each appended one, and steps reads 1 after three nodes each reported a step.

Fix State so the graph keeps everything it gathered and counts every step. The node functions are already correct, do not change them.

Two facts you need:

  1. LangGraph decides how an update merges into existing state per key, and the default is not the only option.
  2. Nodes reachable from a single edge do not run one after another. They run in the same superstep, concurrently, which changes what "read the current value and add one" means.

The bug is not in what the nodes return. It is in how those returns merge into the state.