You add the AI Agent node, type a question and… the agent doesn't remember the previous message, and instead of using data from your system it makes up an answer. An agent in n8n isn't a single node, it's a set of building blocks. Here's what each one does.
- Chat Model: the only required block. You connect a model (e.g. OpenAI Chat Model) with your own credential. It's the “brain” that decides what to do next.
- System Message (in Options): the role and the rules, e.g. “Answer only based on data from your tools. If there's none, say you don't know.” This is where you set the tone, language, and boundaries.
- Memory: without it, every message is a new conversation. Simple Memory keeps the last few exchanges within one session (Session ID). With Chat Trigger the session is picked up automatically; with a Webhook you provide it yourself, e.g.
{{ $json.body.sessionId }}. - Tools: they let the agent reach real data, e.g. HTTP Request Tool for an API or Call n8n Workflow Tool for your own sub-workflow (episode 08 of Series 01). Describe each tool in one specific sentence — the agent uses that description to decide when to call it.
- Output for the next nodes: the agent's answer lands in the output field, i.e.
{{ $json.output }}. Need a fixed JSON structure? Turn on Require Specific Output Format and connect a Structured Output Parser.
Watch out for:
- A vague tool description (“gets data”) means guesswork. The agent will pick the wrong tool or none at all.
- One Session ID for all users mixes conversations together. Every person needs their own identifier.
- The agent can call tools several times in a single answer, and every model call costs money. Set Max Iterations in Options and check the run in Executions.
Rule of thumb: start with Chat Model and System Message, add one tool with a good description, and add memory only when the conversation needs to continue.
Upcoming meetups and workshops are listed in the Events section.