Skip to content

The agent engineering platform.

chore(langchain): update state schema doc (#33524)

Sydney Runkle2209878f480a
diff --git a/libs/langchain_v1/langchain/agents/factory.py b/libs/langchain_v1/langchain/agents/factory.py
index 875e81ab4a..5c0d34529e 100644
--- a/libs/langchain_v1/langchain/agents/factory.py
+++ b/libs/langchain_v1/langchain/agents/factory.py
@@ -554,6 +554,8 @@ def create_agent( # noqa: PLR0915
When provided, this schema is used instead of `AgentState` as the base
schema for merging with middleware state schemas. This allows users to
add custom state fields without needing to create custom middleware.
+ Generally, it's recommended to use state_schema extensions via middleware
+ to keep relevant extensions scoped to corresponding hooks / tools.
The schema must be a subclass of `AgentState[ResponseT]`.
context_schema: An optional schema for runtime context.
checkpointer: An optional checkpoint saver object. This is used for persisting