Pick the right LangGraph stream_mode for showing tokens vs node updates
Three real modes: messages for LLM tokens, updates for per-node state deltas, values for the full state after each node, there is no tokens or nodes mode.
Picture a relay race where each runner writes a note on a clipboard between laps. With messages you watch each runner whispering syllables as they run, the play by play. With updates you only see what each runner added to the clipboard when they handed it off, a tidy diff per leg. With values you photograph the whole clipboard after each runner finishes, complete but heavy. Three views of the same race, picked by what your UI needs to show.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6 to 8 min: three real modes and what each emits + UI mapping per mode + the multi-mode list pattern + when to prefer astream_events v2 + bandwidth tradeoffs of values mode.
Real products, models, and research that use this idea.
- LangGraph chat templates wire stream_mode messages to the chat surface and stream_mode updates to a status pill in the same UI.
- Replit's coding agent streams messages for the editor diff preview and updates for the build progress timeline.
- Klarna's customer-service agent uses values mode in its internal debug console while production traffic uses messages plus updates.
- LangSmith trace replays consume values events to reconstruct each step's full state for forensic debugging.
- Vercel AI SDK adapters for LangGraph subscribe to messages mode and translate AIMessageChunks into AI SDK text-delta stream parts.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you wire both messages and updates to a single chat UI?
QWhat is the relationship between stream_mode='messages' and astream_events v2?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Picking 'tokens' or 'nodes' as a mode name. They sound right but do not exist; the real names are messages and updates.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.