liveBook · Manning

Node

As explained in Build Python Web Apps with Streamlit

A graph node is a vertex in a graph that represents an entity, state, or executable step in a workflow.

A node is a vertex in a graph. In a LangGraph workflow, it represents one action: it receives the current state, changes selected values, and returns those updates. section 10.2.2 section 10.7

A LangGraph node works with the surrounding graph in several specific ways:

  • Reads the graph state, which contains named attributes and values. section 10.2.2
  • Returns only the state keys it needs to modify rather than the entire state. section 10.4.2
  • Passes its output to another node through a directed edge, establishing execution order. section 10.2.2
  • Can preserve existing fields while replacing or appending values according to each field’s update behavior. section 10.4.2

A base-context node

A support agent can define a base_context node that returns {"sys_msg_text": BASE_SYS_MSG}. The node adds or replaces the system-message text while leaving the existing messages field unchanged, then an edge sends the updated state to an assistant node. section 10.4.2

Figure 10.4 In LangGraph, nodes take in the graph state and modify it.

Use the diagram to see how a node receives graph state and returns modified state. section 10.2.2

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains graph meaning, state updates, directed execution, and a static-method implementation, but defers broader node internals.
Examples
Demonstrates social-network vertices, a sum-of-squares graph, and a base-context node for a support agent.
What it assumes
Teaches graph terminology from zero while assuming familiarity with basic functions, classes, and application state.
What you can do after
Build it from scratch by defining state-transforming functions and connecting them with directed LangGraph edges.
How it connects
Connects nodes to graphs, edges, state, workflows, system messages, and assistant actions.

Also explained in

Compare how 19 books explain node →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.