LangGraph 1 · Building graphs
Add a node
A node is a function that takes the state and returns the parts of it to update.
def chatbot(state: State):
return {"messages": [model.invoke(state["messages"])]}
builder.add_node("chatbot", chatbot)
Official LangGraph 1 documentation