Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReAct vs MRKL #2284

Closed
clayoneil opened this issue Apr 1, 2023 · 5 comments
Closed

ReAct vs MRKL #2284

clayoneil opened this issue Apr 1, 2023 · 5 comments

Comments

@clayoneil
Copy link

Sorry if this is a dumb question:

Why is the ZeroShotAgent called "zero-shot-react-description" instead of "zero-shot-mrkl-description" or something like that? It is implemented to follow the MRKL design, not the reAct design. I am misunderstanding something?

Here is the code:

AGENT_TO_CLASS = {
    "zero-shot-react-description": ZeroShotAgent,
    "react-docstore": ReActDocstoreAgent,
    "self-ask-with-search": SelfAskWithSearchAgent,
    "conversational-react-description": ConversationalAgent,
    "chat-zero-shot-react-description": ChatAgent,
    "chat-conversational-react-description": ConversationalChatAgent,
}

permalink: https://github.com/hwchase17/langchain/blob/acfda4d1d8b3cd98de381ff58ba7fd6b91c6c204/langchain/agents/loading.py#L21

@yousefamar
Copy link

I'm not an expert on this, but isn't ReAct a kind of MRKL system that is able to reason? ZeroShotAgent looks quite ReAct-y to me, with thoughts, observations, etc. Is there something there that indicates otherwise?

@zuojie
Copy link

zuojie commented Apr 28, 2023

check this out:
**Agent Types
Agents use an LLM to determine which actions to take and in what order. An action can either be using a tool and observing its output, or returning a response to the user. Here are the agents available in LangChain.

zero-shot-react-description
This agent uses the ReAct framework to determine which tool to use based solely on the tool’s description. Any number of tools can be provided. This agent requires that a description is provided for each tool.

react-docstore
This agent uses the ReAct framework to interact with a docstore. Two tools must be provided: a Search tool and a Lookup tool (they must be named exactly as so). The Search tool should search for a document, while the Lookup tool should lookup a term in the most recently found document. This agent is equivalent to the original ReAct paper, specifically the Wikipedia example.**

According to my understanding, MRKL is implemented by using ReAct framework in langchain ,which is called zero-shot-react-description. The original ReAct is been implemented in react-docstore agent type.
ps. MRKL is published at 1 May 2022, earlier than ReAct, which is published at 6 Oct 2022.

@g-votte
Copy link
Contributor

g-votte commented Jun 12, 2023

I suspect that the gap between LangChain's MRKL implementation (zero-shot-react-description) and what is outlined in the original MRKL paper is causing some confusion. To elaborate, the original MRKL paper is quite abstract and does not provide detailed implementation information. As such, the "MRKL system” is open to a wide range of interpretations, and ReAct could be associated as one instance of MRKL.

In my understanding, MRKL itself is not a zero-shot version of ReAct but is rather "implemented by using ReAct framework in langchain," as mentioned by @zuojie in a previous comment.

If those points are correct, I think it would be beneficial to specify them somewhere under langchain.agents.mrkl or in other documentation. It appears that some people are confused about the relationship between MRKL and ReAct.

@LangDaoAI
Copy link

I am also confused about the relationship between MRKL and ReAct.

@dosubot
Copy link

dosubot bot commented Sep 22, 2023

Hi, @clayoneil. I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, the issue is about the naming of the ZeroShotAgent in the repository. You questioned why it is named "zero-shot-react-description" instead of "zero-shot-mrkl-description" since it follows the MRKL design. In the comments, there is some discussion about the relationship between MRKL and ReAct, with one user suggesting that MRKL is implemented using the ReAct framework in LangChain. However, there seems to be confusion among users about the exact relationship between MRKL and ReAct.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your understanding.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 22, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants