AI Folks
  • Courses
  • Web Of AI
  • Pricing
  • Enterprise
Log in
PreviousWhat an agent isNextAgents in Langflow

Vibe Coder · Unit 16: AI Agents · Lesson 2 of 9

An agent in n8n

Build a working agent without code: the AI Agent node, a chat model, memory, and tools made from the nodes and workflows you already have.

Read the short notes and pictures.Do everything inside a blue frame.

The shortest path to a real agent

You do not need to write a loop to build an agent. n8n has a node that is one: the AI Agent node. You plug a model, a memory and some tools into it, and n8n runs the loop. Because the tools can be your own workflows, everything you built in the last unit becomes something the agent can use.

What plugs into the agent

Chat Model

The model that does the deciding. n8n has chat model nodes for OpenAI, Anthropic, Groq and Ollama, among others.

Memory

Simple Memory keeps the recent conversation for the session. Postgres Chat Memory stores it in a database so it survives restarts.

Tools

What the agent may call: built-in ones such as Calculator, the MCP Client Tool for any MCP server, and your own workflows.

Chat Trigger

Starts the workflow when a chat message arrives, and gives you a chat window for testing.

A woven mat, hand-drawn. The AI Agent node with three tools plugged in underneath: Calculator, MCP Client Tool and your own workflow.
Tools attach to the agent. One of them can be a workflow you built.

Build it

  1. 1

    New workflow, Chat Trigger first

    So you can test by typing.

  2. 2

    Add the AI Agent node

    Paste the instructions you wrote in the last lesson into its system message.

  3. 3

    Attach a chat model

    Create the credential for the provider. Start with a mid-sized model.

  4. 4

    Attach Simple Memory

    So follow-up questions work.

  5. 5

    Attach one tool

    Start with a single read-only tool, such as a workflow that looks up one record.

  6. 6

    Chat with it

    Ask a question that needs the tool. Open the run and see which tool it called and with what input.

  7. 7

    Add the next tool

    One at a time, testing after each.

Describing a tool well

The agent chooses tools by reading their names and descriptions. A vague description is the most common reason an agent ignores a tool or uses the wrong one.

Vague

Name: lookup
Description: gets data

Clear

Name: get_invoice
Description: Look up one invoice by
its number. Returns client, amount,
due date and status. Use this before
answering any question about a
specific invoice.
Say what it does, what it needs, what it returns and when to use it.
A woven mat, hand-drawn. A chat: the question, a tool call to look up the invoice, then the answer.
In the editor you can watch each tool call.

Start read-only

Give your first agent only tools that read. Add a tool that writes, sends or spends only after you have watched it handle twenty real questions well, and put an approval step in front of it.

ActivityYour turnWrite it yourself first, then compare.

Your agent answers invoice questions from memory and invents amounts instead of calling the lookup tool. Name two changes that would fix it.

ActivityBuild stepAn agent that works for your product

Build your agent in n8n

Build the agent you designed: Chat Trigger, AI Agent, a chat model, memory and at least two read-only tools, one of which is a workflow of your own. Test it with ten real questions and note where it goes wrong.

Done when

Export the workflow JSON. Your ten questions become your test set in the last lesson of this unit.

Keep these

  • The AI Agent node runs the loop for you.
  • Attach a chat model, memory and tools.
  • Clear tool descriptions decide whether tools get used.
Previous lessonWhat an agent isNext lessonAgents in Langflow