LangGraph Nodes, Edges, and Shared State: Core Building Blocks (SOLVED)
**Nodes** Each node is a Python/JS function (or runnable) that accepts the current graph state and returns a partial update — not necessarily the full state. LangGraph merges updates using reducers defined on the state schema (e.g., append to a list, overwrite a scalar). Nodes should stay focused: one node might call the LLM, another might invoke tools, another might format output.
TL;DR — Quick Answer
Nodes are functions that receive and return partial state updates; edges connect nodes (fixed or conditional); shared state is a typed schema merged after each node — enabling cyclic agent workflows unlike linear chains.
The Interview Question
Explain how LangGraph models workflows using nodes, edges, and shared state. How does state flow and get updated across the graph?
Deep Explanation
Nodes Each node is a Python/JS function (or runnable) that accepts the current graph state and returns a partial update — not necessarily the full state. LangGraph merges updates using reducers defined on the state schema (e.g., append to a list, overwrite a scalar). Nodes should stay focused: one node might call the LLM, another might invoke tools, another might format output.
Sign in to unlock full answer
Get deep explanations, PDF export & all LangGraph questions
- 8 more sections of deep explanation
- Real-world examples
- Common mistakes
- Interviewer expectations
- Follow-up questions