LangChain Agent - Not Sending an Input to Tool

I’m using the new BETA version of n8n, which features the exciting new LangChain nodes. I’ve created a Conversational Agent which is using gpt-3.5-turbo and a Slack Messages tool, which is a link to another workflow that queries a vector database.

I have created multiple agents connected to different tools and experimented with modifying the human and system messages as well. I have also tried with GPT 4. No matter what I try, I can’t get the agent to send an input to the workflow. You can see it calling the correct tool, but the input is empty and so the tool can’t output useful data.

In the debug it shows this:

Here is the code:

Would love any ideas on how to get it to provide the input.

Hi @James_Pardoe :wave:

Can you give an example of the workflow that the Slack Messages tool is calling, and also maybe some sample data that’s in your database? That would help me test this one!

@James_Pardoe Seems like GPT is getting confused about the Slack Messages tool description. Can you try to change it to:
Call this tool to ask for information about Slack messages. The input should be stringified object which contains "query" property

Or simple Call this tool to ask for information about Slack messages. The input should be query to search for. should also work

1 Like

Hi guys!

I can’t believe it’s been 24 days since I last looked at this!

Thanks for your suggestions. @oleg I tried the first one and it worked the first time I ran the agent. Then I made a small tweak to the Agent Text (see below) in order to specify the client parameter as well, and you can see that it stopped working. It is correctly calling the Slack Messages workflow, but the input is empty. It seems to try multiple times, but every time it sends an empty input:

1 Like

I think the problem might be that Agent is struggeling if there’s more than one parameter to the tool. You can modify the prompt to to ask it to pass the parameters as a single object. But either way, it would help to see the full workflow for further debugging :slight_smile:

1 Like

Hey guys,

Sorry I’ve been booted off the BETA as my trial expired. I am waiting for the LangChain features to be added to the main cloud version and then get back to you on this!

Surprisingly, I posted almost identical question yesterday. I was able to pass multiple perameters as a query message, not as a JSON. I’ll post here ince again when the working example is ready.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.