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

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    Standard Tests
    Text Splitters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Language
    Theme
    Pythonlangchain-classicagentsmrklbaseMRKLChain
    Class●Since v1.0Deprecated

    MRKLChain

    Copy
    MRKLChain()

    Bases

    AgentExecutor

    Methods

    Inherited fromAgentExecutor

    Attributes

    Aagent: BaseSingleActionAgent | BaseMultiActionAgent | Runnable
    —

    The agent to run for creating a plan and determining actions

    Atools: Sequence[BaseTool]
    —

    The valid tools the agent can call.

    Areturn_intermediate_steps: bool
    —

    Whether to return the agent's trajectory of intermediate steps

    View source on GitHub
    A
    max_iterations
    : int | None
    —

    The maximum number of steps to take before ending the execution

    Amax_execution_time: float | None
    —

    The maximum amount of wall clock time to spend in the execution

    Aearly_stopping_method: str
    —

    The method to use for early stopping if the agent never

    Ahandle_parsing_errors: bool | str | Callable[[OutputParserException], str]
    —

    How to handle errors raised by the agent's output parser.

    Atrim_intermediate_steps: int | Callable[[list[tuple[AgentAction, str]]], list[tuple[AgentAction, str]]]
    —

    How to trim the intermediate steps before returning them.

    Ainput_keys: list[str]
    —

    Return the input keys.

    Aoutput_keys: list[str]
    —

    Return the singular output key.

    Methods

    Mfrom_agent_and_tools
    —

    Create from agent and tools.

    Mvalidate_tools
    —

    Validate that tools are compatible with agent.

    Mvalidate_runnable_agent
    —

    Convert runnable to agent if passed in.

    Msave
    —

    Raise error - saving not supported for Agent Executors.

    Msave_agent
    —

    Save the underlying agent.

    Miter
    —

    Enables iteration over steps taken to reach final output.

    Mlookup_tool
    —

    Lookup tool by name.

    Mstream
    —

    Enables streaming over steps taken to reach final output.

    Mastream
    —

    Async enables streaming over steps taken to reach final output.

    Inherited fromChain

    Attributes

    Amemory: BaseMemory | None
    —

    Optional memory object.

    Acallbacks: Callbacks
    —

    Optional list of callback handlers (or callback manager).

    Averbose: bool
    —

    Whether or not run in verbose mode. In verbose mode, some intermediate logs

    Atags: list[str] | None
    —

    Optional list of tags associated with the chain.

    Ametadata: builtins.dict[str, Any] | None
    —

    Optional metadata associated with the chain.

    Acallback_manager: BaseCallbackManager | None
    —

    [DEPRECATED] Use callbacks instead.

    Amodel_configAinput_keys: list[str]
    —

    Keys expected to be in the chain input.

    Aoutput_keys: list[str]
    —

    Keys expected to be in the chain output.

    Methods

    Mget_input_schemaMget_output_schemaMinvokeMainvokeMraise_callback_manager_deprecation
    —

    Raise deprecation warning if callback_manager is used.

    M

    Inherited fromRunnableSerializable(langchain_core)

    Attributes

    AnameAmodel_config

    Methods

    Mto_jsonMconfigurable_fieldsMconfigurable_alternatives

    Inherited fromSerializable(langchain_core)

    Attributes

    Alc_secretsAlc_attributesAmodel_config

    Methods

    Mis_lc_serializableMget_lc_namespaceMlc_idMto_jsonMto_json_not_implemented

    Inherited fromRunnable(langchain_core)

    Attributes

    AnameAInputTypeAOutputTypeAinput_schemaAoutput_schemaAconfig_specs

    Methods

    Mget_nameMget_input_schemaMget_input_jsonschemaMget_output_schemaMget_output_jsonschemaMconfig_schema
    method
    from_chains

    User-friendly way to initialize the MRKL chain.

    This is intended to be an easy way to get up and running with the MRKL chain.

    Chain that implements the MRKL system.

    set_verbose
    —

    Set the chain verbosity.

    Macall
    —

    Asynchronously execute the chain.

    Mprep_outputs
    —

    Validate and prepare chain outputs, and save info about this run to memory.

    Maprep_outputs
    —

    Validate and prepare chain outputs, and save info about this run to memory.

    Mprep_inputs
    —

    Prepare chain inputs, including adding inputs from memory.

    Maprep_inputs
    —

    Prepare chain inputs, including adding inputs from memory.

    Mrun
    —

    Convenience method for executing chain.

    Marun
    —

    Convenience method for executing chain.

    Mdict
    —

    Dictionary representation of chain.

    Msave
    —

    Save the chain.

    Mapply
    —

    Call the chain on all inputs in the list.

    M
    get_config_jsonschema
    Mget_graph
    Mget_prompts
    Mpipe
    Mpick
    Massign
    Minvoke
    Mainvoke
    Mbatch
    Mbatch_as_completed
    Mabatch
    Mabatch_as_completed
    Mstream
    Mastream
    Mastream_log
    Mastream_events
    Mtransform
    Matransform
    Mbind
    Mwith_config
    Mwith_listeners
    Mwith_alisteners
    Mwith_types
    Mwith_retry
    Mmap
    Mwith_fallbacks
    Mas_tool