after_agent() — langchain Function Reference
Architecture documentation for the after_agent() function in types.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 20e9268c_1ce4_5e5b_e0bf_32f0d2aa7f8e["after_agent()"] 949c7cf4_56fe_f3b4_cd89_9631a7e9cb1e["AgentMiddleware"] 20e9268c_1ce4_5e5b_e0bf_32f0d2aa7f8e -->|defined in| 949c7cf4_56fe_f3b4_cd89_9631a7e9cb1e f5377bf2_2aeb_e96b_eea2_47b6e1c332d1["after_agent()"] f5377bf2_2aeb_e96b_eea2_47b6e1c332d1 -->|calls| 20e9268c_1ce4_5e5b_e0bf_32f0d2aa7f8e f5377bf2_2aeb_e96b_eea2_47b6e1c332d1["after_agent()"] 20e9268c_1ce4_5e5b_e0bf_32f0d2aa7f8e -->|calls| f5377bf2_2aeb_e96b_eea2_47b6e1c332d1 style 20e9268c_1ce4_5e5b_e0bf_32f0d2aa7f8e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/langchain/agents/middleware/types.py lines 625–634
def after_agent(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:
"""Logic to run after the agent execution completes.
Args:
state: The current agent state.
runtime: The runtime context.
Returns:
Agent state updates to apply after agent execution.
"""
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does after_agent() do?
after_agent() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/types.py.
Where is after_agent() defined?
after_agent() is defined in libs/langchain_v1/langchain/agents/middleware/types.py at line 625.
What does after_agent() call?
after_agent() calls 1 function(s): after_agent.
What calls after_agent()?
after_agent() is called by 1 function(s): after_agent.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free