LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicagentsinitialize
    Module●Since v1.0

    initialize

    Load agent.

    Attributes

    attribute
    AGENT_DEPRECATION_WARNING: str
    attribute
    AGENT_TO_CLASS: dict[AgentType, AGENT_TYPE]

    Functions

    deprecatedfunction
    load_agent

    Unified method for loading an agent from LangChainHub or local fs.

    deprecatedfunction
    initialize_agent

    Load an agent executor given tools and LLM.

    Warning

    This function is no deprecated in favor of create_agent from the langchain package, which provides a more flexible agent factory with middleware support, structured output, and integration with LangGraph.

    For migration guidance, see Migrating to langchain v1 and Migrating from AgentExecutor.

    Classes

    class
    AgentExecutor

    Agent that is using tools.

    deprecatedclass
    AgentType

    An enum for agent types.

    View source on GitHub