Merges two lists of messages, updating existing messages by ID.
By default, this ensures the state is "append-only", unless the new message has the same ID as an existing message.
Write a message manually to the messages / messages-tuple stream mode.
Will automatically write to the channel specified in the state_key unless state_key is None.
A graph whose nodes communicate by reading and writing to a shared state.
The signature of each node is State -> Partial<State>.
Each state key can optionally be annotated with a reducer function that
will be used to aggregate the values of that key received from multiple nodes.
The signature of a reducer function is (Value, Value) -> Value.
StateGraph is a builder class and cannot be used directly for execution.
You must first call .compile() to create an executable graph that supports
methods like invoke(), stream(), astream(), and ainvoke(). See the
CompiledStateGraph documentation for more details.
A specific LangGraphDeprecationWarning subclass defining functionality deprecated since LangGraph v1.0.0
A StateGraph where every node receives a list of messages as input and returns one or more messages as output.
MessageGraph is a subclass of StateGraph whose entire state is a single, append-only* list of messages.
Each node in a MessageGraph takes a list of messages as input and returns zero or more
messages as output. The add_messages function is used to merge the output messages from each node
into the existing list of messages in the graph's state.