Home / Class/ ReActChain Class — langchain Architecture

ReActChain Class — langchain Architecture

Architecture documentation for the ReActChain class in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  fc22e61a_e71c_3c3f_5846_cd3fe3d0d65a["ReActChain"]
  ec1d7866_e6a8_7cbe_b150_f82463cf2c7f["AgentExecutor"]
  fc22e61a_e71c_3c3f_5846_cd3fe3d0d65a -->|extends| ec1d7866_e6a8_7cbe_b150_f82463cf2c7f
  ad80ef00_f3ce_f433_8c88_7c6f97a4bc56["base.py"]
  fc22e61a_e71c_3c3f_5846_cd3fe3d0d65a -->|defined in| ad80ef00_f3ce_f433_8c88_7c6f97a4bc56
  bf44782a_0b6e_885e_840f_983c24d235da["__init__()"]
  fc22e61a_e71c_3c3f_5846_cd3fe3d0d65a -->|method| bf44782a_0b6e_885e_840f_983c24d235da

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/react/base.py lines 170–189

class ReActChain(AgentExecutor):
    """[Deprecated] Chain that implements the ReAct paper."""

    def __init__(self, llm: BaseLanguageModel, docstore: Docstore, **kwargs: Any):
        """Initialize with the LLM and a docstore."""
        docstore_explorer = DocstoreExplorer(docstore)
        tools = [
            Tool(
                name="Search",
                func=docstore_explorer.search,
                description="Search for a term in the docstore.",
            ),
            Tool(
                name="Lookup",
                func=docstore_explorer.lookup,
                description="Lookup a term in the docstore.",
            ),
        ]
        agent = ReActDocstoreAgent.from_llm_and_tools(llm, tools)
        super().__init__(agent=agent, tools=tools, **kwargs)

Extends

Frequently Asked Questions

What is the ReActChain class?
ReActChain is a class in the langchain codebase, defined in libs/langchain/langchain_classic/agents/react/base.py.
Where is ReActChain defined?
ReActChain is defined in libs/langchain/langchain_classic/agents/react/base.py at line 170.
What does ReActChain extend?
ReActChain extends AgentExecutor.

Analyze Your Own Codebase

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

Try Supermodel Free