Home / Function/ abefore_agent() — langchain Function Reference

abefore_agent() — langchain Function Reference

Architecture documentation for the abefore_agent() function in types.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7ddd9a87_00a6_c815_8237_d7a98355df2c["abefore_agent()"]
  949c7cf4_56fe_f3b4_cd89_9631a7e9cb1e["AgentMiddleware"]
  7ddd9a87_00a6_c815_8237_d7a98355df2c -->|defined in| 949c7cf4_56fe_f3b4_cd89_9631a7e9cb1e
  style 7ddd9a87_00a6_c815_8237_d7a98355df2c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/middleware/types.py lines 417–428

    async def abefore_agent(
        self, state: StateT, runtime: Runtime[ContextT]
    ) -> dict[str, Any] | None:
        """Async logic to run before the agent execution starts.

        Args:
            state: The current agent state.
            runtime: The runtime context.

        Returns:
            Agent state updates to apply before agent execution.
        """

Domain

Subdomains

Frequently Asked Questions

What does abefore_agent() do?
abefore_agent() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/types.py.
Where is abefore_agent() defined?
abefore_agent() is defined in libs/langchain_v1/langchain/agents/middleware/types.py at line 417.

Analyze Your Own Codebase

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

Try Supermodel Free