langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Allow agent to choose its toolset

Open jasondotparse opened this issue 2 years ago • 1 comments

Currently we provide agents with a predefined list of tools that we would like to place at its disposal before it embarks on its effort to complete the task at hand.

It might be preferable to allow the Agent to query the langchain hub / Huggingface hub repeatedly and traverse the directory of agents / tools until it finds all the tools and agents it needs to complete its mission, and then dynamically pull them in as needed.

In the future I can imagine we have more specialized agents, perhaps some that are medical experts, business consultants, or software engineers. If we allow our "manager" agent the ability to pull in their expertise and place them on their "team" or "toolbelt" before it sets out to accomplish a task, we can leverage the LLMs ability to understand what resources will be required to accomplish some abstract task, and allow it to get what it needs before any attempt is made.

jasondotparse avatar Apr 04 '23 04:04 jasondotparse

@jasondotparse I was trying to find a way to inject tools dynamically into agents and given the current architecture of agents in langchain it would be a bit complicated to achieve wihout chaning a bit the current implementation of agents.

The problem lies in the fact that once and agent instance is created, the prompt including the toolset is hardcoded inside the agents' instance and adding tools does not modify the prompt.

I started a small prototype which I might propose as a PR which could allow dynamically injecting tools into agent instances.

In the meantime the only solution is to regenerate the agent with the new toolset and restore the history/memory but this way seems way convuluted for this simple task.

blob42 avatar May 18 '23 10:05 blob42

Hi, @jasondotparse! I'm Dosu, and I'm here to help 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 allowing agents to dynamically choose their tools from a directory of agents and tools, instead of being provided with a predefined list. There has been some discussion about the current implementation of agents and the possibility of dynamically injecting tools into agent instances. A prototype has been proposed as a potential solution, but currently, the issue remains unresolved.

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 and contribution to the LangChain project!

dosubot[bot] avatar Sep 04 '23 16:09 dosubot[bot]

is there a solution for this now?

refeed avatar Jun 03 '24 11:06 refeed