After this lesson, you will be able to: Connect an LLM node to tool nodes in n8n's AI Agent loop and build a working agent that answers real-world queries.
Now we make it intelligent. The n8n AI Agent node accepts a chat input, an LLM, memory, and a list of tools, it runs the ReAct loop for you. We'll wire one up with a web search tool and a calculator, and watch it reason through real questions.
1. New workflow. Add a 'Chat Trigger' node, this gives you a chat UI to test in.
2. Add an 'AI Agent' node. Connect the trigger to it.
3. Below the AI Agent: connect a 'Chat Model' (sub-node). Pick Anthropic or OpenAI Chat Model. Add your credential.
4. Below the AI Agent: connect a 'Memory' sub-node. Pick 'Window Buffer Memory'.
5. Below the AI Agent: connect a 'Tool' sub-node. Add 'SerpAPI' (or 'Wikipedia', free, no key).
6. Add another tool: 'Calculator'.
7. Open chat (button on Chat Trigger). Ask: 'What's the population of Japan times the population of Canada?'
The agent saw your question, decided it needed Wikipedia (population of Japan), called the tool, observed the result, called Wikipedia again (Canada), called the calculator with both numbers, and answered. Click 'Logs' on the AI Agent node, you can see every reasoning step.
Diagram coming soon!
n8n canvas with Chat Trigger → AI Agent, with Chat Model, Memory, Wikipedia, Calculator hanging below the AI Agent as sub-nodes
1. Add an 'HTTP Request' tool. Configure it to hit a real API (e.g., https://api.coingecko.com/api/v3/simple/price).
2. Give it a name and description: 'getCryptoPrice, fetches the current price of a cryptocurrency. Input: the crypto id (e.g. bitcoin).'
3. The agent reads that description and decides when to use the tool.
4. Ask: 'What's bitcoin's price right now in dollars?'
Sign in and purchase access to unlock this lesson.