Home / Class/ AgentState Class — langchain Architecture

AgentState Class — langchain Architecture

Architecture documentation for the AgentState class in types.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  ce29547b_52a7_efd4_4e55_92320a5dfa56["AgentState"]
  fb1284e2_76fc_661f_c16d_e084e8c2b175["types.py"]
  ce29547b_52a7_efd4_4e55_92320a5dfa56 -->|defined in| fb1284e2_76fc_661f_c16d_e084e8c2b175

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/middleware/types.py lines 350–355

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]]

Frequently Asked Questions

What is the AgentState class?
AgentState is a class in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/types.py.
Where is AgentState defined?
AgentState is defined in libs/langchain_v1/langchain/agents/middleware/types.py at line 350.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free