In Deep Agents 0.6.0 the agent’s messages state is checkpointed with delta channels by default.
For langchain will the create_agent functions AgentStatemessages property move to that same delta-style checkpointing by default, or is the expectation that we wire it up ourselves if we want that behavior?
I see that the DeltaChannel is currently in beta, so the expectation is that it won’t be used by default in langchain until it’s out of beta? Is there a way to opt into using it, similar to how we have different versions for streaming like v2 and v3?
DeltaChannel is opt-in for create_agent, by deliberate design
Current state of AgentState.messages:
class AgentState(TypedDict, Generic[ResponseT]):
"""State schema for the agent."""
messages: Required[Annotated[list[AnyMessage], add_messages]]
jump_to: NotRequired[Annotated[JumpTo | None, EphemeralValue, PrivateStateAttr]]
structured_response: NotRequired[Annotated[ResponseT, OmitFromInput]]
The messages field is annotated with add_messages, which is LangGraph’s BinaryOperatorAggregate reducer, notDeltaChannel. This is the default today and the comment in factory.py makes the intent explicit:
base_state = state_schema if state_schema is not None else AgentState
# Build an ordered list: middleware schemas first (in registration order),
# base_state last so it wins any field conflict. This lets the caller's
# explicit state_schema override middleware annotations — e.g. passing
# a DeltaChannel-annotated schema wins over BinaryOperatorAggregate from
# AgentState without requiring a post-compilation patch.
state_schemas: list[type] = [*(m.state_schema for m in middleware), base_state]
What this tells us
DeltaChannel is NOT the default and is not planned to become the default (at least until it leaves beta in LangGraph). The AgentState base class will keep add_messages.
You can opt in today via the state_schema parameter to create_agent. Because base_state (your custom schema) is placed last in the merge order, its field annotations win over any middleware schemas. Here’s how:
from typing import Annotated
from typing_extensions import Required, TypedDict
from langchain_core.messages import AnyMessage
from langgraph.channels.delta import DeltaChannel
from langgraph.graph.message import _messages_delta_reducer
from langchain.agents import create_agent
from langchain.agents.middleware.types import AgentState, ResponseT
class MyState(AgentState[ResponseT]):
messages: Required[Annotated[list[AnyMessage], DeltaChannel(_messages_delta_reducer)]] #_messages_delta_reducer is a private/internal function (prefixed with _). It is stable in practice for this use case, but be aware it could change without a deprecation notice.
agent = create_agent(
model="openai:gpt-4o",
tools=[...],
state_schema=MyState,
)
Short answer
DeltaChannel will stay opt-in until it graduates from beta in LangGraph, at which point it may be reconsidered for making it the default. For now, use state_schema= on create_agent to wire it up yourself, exactly as described above.