langchain
langchain copied to clipboard
Don't try tools that have already been invalidated in the current run
If you reproduce the agents example in https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html but remove the "serpapi" parameter, the agent gets into an infinite loop with respect to trying actions with tools in which it has already observed the tool is not a valid tool.
A proposed fix is to maintain a set of all visited tools and do a check before having the agent settle on using that tool. I haven't seen the source code to validate this viability, but this outcome definitely seems not ideal.
![Screenshot 2023-01-23 at 12 01 45 PM](https://user-images.githubusercontent.com/3188413/214102958-eec3ef46-4fa9-42cc-a43a-213966332fdd.png)
Hey @hwchase17, I'm a research engineer working on language modelling and I'm interested in contributing to langchain. I'm happy investigate this and try to fix it? Do you have any advice or thoughts on the best way to proceed?
Hi, @drshrey. I'm helping the LangChain team manage their backlog and I wanted to let you know that we are marking this issue as stale.
From what I understand, the issue is that the agents example gets stuck in an infinite loop when running without the "serpapi" parameter. It seems that a proposed fix has been suggested, which involves maintaining a set of visited tools and checking before settling on using a tool. @jackapbutler, a research engineer, has expressed interest in investigating and fixing the issue.
Before we proceed, we would like to confirm if this issue 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 and contribution to the LangChain project.