Hi, I’m new to n8n, I’m building a flow to let AI Agent generate SQL commands from 3 inputs: chat, table schema, and metrics define. All are running locally (n8n and Ollama deepseek-1r 1.5b). The AI Agent seems not getting data from the schema when I chat “show all tables from given database”. Below is the screenshot of the AI Agent setting and output chat.
Did I do something wrong? Please help! Thanks for reading.
Hi @kk78952 Welcome to n8n
community 
It looks like your AI Agent node is receiving two separate items—one with the schema data and another with the metrics data—and so it’s only processing the first one by default. You’ll need to combine those two items into one single item so that the AI Agent can see both the schema and the metrics.
One straightforward way is to use a Merge node (in “Combine” mode) or an Aggregate node to bring both inputs together into a single item. Make sure the merged output contains the fields you want the AI Agent to have access to (e.g., schema
, metrics
, etc.). Once you pass that single combined item into the AI Agent, it should have all the context it needs to generate your SQL commands.
Hope that helps…
1 Like