Stuck with SQL Agent

I see people using SQL Agent but when i do the exact same thing, it’s not working ! I’m pretty mad after 2 days on basic topic, thus i’m looking for help. I have an idea of the problem but don’t know ho to solve it.

I can’t make a standard SQL Agent work. I get the error :
Could not parse LLM output: I don’t know. Troubleshooting URL: OUTPUT_PARSING_FAILURE | 🦜️🔗 Langchain

The execution is of the node gets this result:
Question: Give me the name of product 103
Thought: I should look at the tables in the database to see what I can query.
Action: [[“list-tables-sql”]]
Action Input: “”
Observation: [[“list-tables-sql”]] is not a valid tool, try another one.

I think the problem is in the prompt

  • The suspected line in my prompt: Action: the action to take, should be one of [[“query-sql”,“info-sql”,“list-tables-sql”,“query-checker”]]
  • The same line in printscreen from other people: Action: the action to take, should be one of [query-sql,info-sql,list-tables-sql,query-checker]
    Do you know how to change it ?

I tried MySql and PostgreSQL databases and same results. Both databases are accessible correctly using a node.
I tried to modify the prompt in many ways, including giving the database schema but i failed to solve the problem.

Please share your workflow

image

Information on your n8n setup

  • **n8n version: 1.69
  • **Database (default: SQLite): Postgre or Mysql
  • **n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • **Operating system: Windows10
1 Like

I managed to do it work but that’s strange.

In the prefix prompt I added:
in the prompt do not consider: [[“query-sql”,“info-sql”,“list-tables-sql”,“query-checker”]], instead use [query-sql,info-sql,list-tables-sql,query-checker]

Maybe it will be useful to someone

2 Likes

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