Give Your AI Agent a Memory That Sticks
Build a chat agent in n8n, add a memory store, and watch it remember your name.
Introduction
30 Second Summary
You tell a chatbot your name, and two messages later it has no idea who you are. That blank stare is the default behaviour of every AI model, because nothing carries over between calls.
In this project, you will build a chat agent in n8n and watch it forget you. Then you will bolt on a memory store and control exactly how much of the conversation your agent gets to keep.
What You'll Build
You will type your name into a chat box, ask for it back, and watch the same agent go from clueless to remembering it even after you restart the whole thing.
By the end of this project, you'll have:
- A chat agent you can talk to in the browser, that answers a question about something you told it three messages ago.
- A before and after you can screenshot, where the exact same two messages fail without memory and work with it.
- A window limit you can shrink to two turns, then watch your oldest messages vanish from the prompt in the execution log.
- Secret Mission: Give two people separate conversations with the same agent by setting the session key, so their chats never bleed into each other.
Are there any prerequisites?
You need a laptop, an n8n instance you can open in a browser, and one model API key. No GPU and no prior n8n experience required.
Before We Start
This project is about giving an AI agent a memory that survives from one message to the next.
You'll build that agent in n8n, a workflow tool you run on your own machine. Before any of it, n8n needs to be up and running in front of you.
In this step, get ready to:
- Check that your machine runs a Node.js version n8n supports.
- Start n8n locally and open it in your browser.
- Create the blank workflow you'll build in.
Check your Node.js version
n8n runs on Node.js, and it only supports a specific band of versions. A version outside that band fails in ways that look like n8n bugs.
- Press Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
- Type Terminal (macOS) or PowerShell (Windows) and press Enter to open it.
- Find out which Node.js version you have by running this command:
node --version
✔️ I see a version between 20.19 and 24
n8n supports every Node.js version from 20.19 up to and including 24. Yours is in range, so carry straight on to starting n8n.
ⓧ I see a version outside that range
A version below 20.19 or above 24 is unsupported, so n8n can fail on start or misbehave later.
- Open the official Node.js downloads page.
- Download the installer for a version inside the supported range, then run it.
- Close your terminal window and open a fresh one, so it picks up the new version.
- Confirm the change by running node --version again.
If you need to keep your current version for other work, install a Node version manager and switch to a supported version before you start n8n.
ⓧ Command not found
Node.js isn't installed on this machine yet. n8n can't run without it.
- Open the official Node.js downloads page.
- Download the installer for a version inside the supported range, then run it.
- Close your terminal window and open a fresh one.
- Confirm the install by running node --version again.
Start n8n on your machine
The community edition of n8n runs on your own hardware, so the workflows you build and the conversations they store never leave your laptop. One command downloads it and starts it.
- Start n8n by running this command:
npx n8n
What happens when you run this?
- The command downloads n8n the first time you run it, so the first start takes a few minutes.
- You'll be asked to confirm the download before it begins. Accept it to carry on.
- n8n then keeps running in that terminal window and prints its logs there. Leave the window open for the rest of the project.
- Press Ctrl+C in that window when you want to stop n8n.
- Wait until the terminal stops scrolling and reports that n8n is ready.
- Open http://localhost:5678 in your browser.
- Fill in the local owner account n8n asks you to create the first time you open it.
The n8n editor loads in your browser. That editor is talking to the process in your terminal, not to a server somewhere else.
n8n didn't come up?
- If the terminal says the port is already taken, n8n is already running in another window. Open http://localhost:5678 and use that one.
- If the browser page stays blank, the download is probably still finishing. Wait for the terminal to settle, then refresh.
- If the command errors straight away, recheck your Node.js version against the supported range above.
Still stuck? Why won't n8n start on my machine?
Prefer to run n8n in Docker?
n8n also ships as a Docker image, which keeps the runtime and its dependencies inside a container. Follow the official Docker install guide and rejoin the project once the editor loads.
Open a blank workflow
A workflow in n8n is a canvas of nodes wired together. Everything in this project gets built on one canvas, so you need an empty one to start from.
Before you make it, what do you think a brand new n8n workflow puts on the canvas?
- Select Start from Scratch if n8n greets you with a welcome window.
- Select Create Workflow in the upper right corner if n8n shows you the Overview page instead.
The canvas opens empty, with a single Add first step placeholder sitting in the middle. That placeholder is the socket your chat trigger drops into.
Can't find either button?
- The welcome window only shows up on a brand new instance. If you've opened n8n before, look for the Overview page instead.
- Press Cmd+Alt+N (macOS) or Ctrl+Alt+N (Windows) to create a new workflow from anywhere in the editor.
Somewhere else entirely? Help me find the new workflow button in n8n
n8n is running and your canvas is blank. Next up, you'll drop in a chat trigger and an AI agent node, then send your first message and watch a reply come back.
Build a Chat Agent and Send Your First Message
Every agent you have ever chatted with rests on two pieces: something that receives your message, and something that decides what to say back. Before you can test whether an agent remembers anything, you need that pipeline running end to end.
In n8n, those two pieces are a Chat Trigger node and an AI Agent node. You'll wire them together, hand the agent a model to think with, and push one message through.
In this step, get ready to:
- Add a Chat Trigger node and an AI Agent node to your workflow.
- Add a model credential and connect it to the AI Agent node.
- Send your first message and read the reply that comes back.
Add a chat trigger to your workflow
A workflow does nothing until something kicks it off. The Chat Trigger gives you a chat window, and every message you send through it starts a fresh run.
- Return to the empty workflow already open in your n8n editor.
- Click the + on the canvas to open the node search panel.
- Type chat trigger into the search field.
- Select the chat trigger node from the results to add it to your canvas.
- Close the node's settings panel to return to the canvas.
- Check that the trigger now sits on the canvas as the first node in your workflow.
What does a trigger do?
A trigger is the entry point of a workflow. It listens for an event, then hands whatever it received to the nodes connected after it.
Here the event is you typing a message. Each message becomes one run of the workflow, which is exactly why memory turns out to be a problem later.
Connect an agent and give it a model
Your trigger passes messages on, but nothing is listening on the other side yet. The AI Agent node takes the message, works out what to say, and sends a reply back to the chat.
- Click the + on the right edge of the chat trigger node.
- Type AI Agent into the search field.
- Select the AI Agent node to drop it onto the canvas.
- Check that a line now joins the chat trigger to the AI Agent node.
Why the agent needs a model underneath it
The AI Agent node is wiring, not intelligence. It decides what gets sent where, and it needs a chat model attached before it can generate a single word.
That model runs on someone else's hardware, so your API key is how the agent gets in. Nothing is downloaded to your laptop.
- Click the + under the chat model connector on the AI Agent node.
- Select the model provider you hold an API key for.
- Open the credential dropdown, then choose to create a new credential.
- Paste your API key into the key field, replacing the your-api-key-here style placeholder.
- Save the credential.
- Close the settings panel and confirm the model now hangs below your AI Agent node.
Credential won't save?
Check for a stray space at the start or end of the key you pasted. Keys copied from a provider dashboard often pick one up.
Also confirm the key belongs to the same provider you picked in the dropdown. A key from one provider will never validate against another.
My model credential won't save in n8n.
Send your first message and read the reply
Trigger, agent, model. Time to find out whether a message can travel all the way through the chain.
Before you open the chat, do you expect a reply, an error, or nothing at all?
- Open the chat panel from the bottom of the canvas.
- Type Hi, can you introduce yourself in one sentence? into the message box.
- Press Enter to send it.
A one sentence reply lands in the chat panel within a few seconds. That reply is proof your trigger, your agent, and your model are all talking to each other.
No reply coming back?
Look at the canvas while the message runs. If the AI Agent node shows an error, the problem is the model credential rather than the wiring.
If nothing lights up at all, the chat trigger is probably not connected to the AI Agent node. Drag a line between them and send the message again.
My n8n chat sent the message but no reply came back.
You have a working agent that answers when spoken to. Next up, you'll tell it something about yourself and find out whether it holds on to it.
Watch the Agent Forget Your Name
In the last step you got your first reply out of the agent, which proves your chat trigger, your model credential and your AI Agent node in n8n are all talking to each other.
A working reply is not the same thing as a working conversation. The interesting question is what happens on the second message.
So this step is a two-message test. You'll tell the agent your name, then ask for it straight back and watch how it handles the question.
In this step, get ready to:
- Send the agent a message that tells it your name.
- Ask the agent for your name in a second message.
- Capture the reply as proof of what your agent can recall.
Tell the agent your name
Every conversation test needs a fact the agent can only know because you told it. Your name is perfect, because the model has no other way to guess it.
- Return to the chat panel you used at the end of the last step.
- Type My name is Sam. Please remember it for later. into the chat box, using your own name instead of Sam.
- Press Enter to send the message.
The agent answers within a second or two, usually with a friendly greeting that uses your name back. So far the conversation looks completely normal.
No reply coming back?
Check that the chat panel is still attached to the same workflow you built in the last step, and that the workflow tab is open rather than a fresh blank canvas.
A red badge on the AI Agent node points at the model credential rather than your message.Why is my n8n AI Agent node not replying to my chat message?
Ask the agent for your name
You just handed the agent a fact, and it answered as though it took the fact on board. Now ask for that fact back.
Before you send the next message, make a call: does the agent come back with your name, or not? Give yourself a reason for your answer.
- Type What is my name? into the same chat box.
- Press Enter to send the second message.
The agent has no idea. It replies that it does not know your name, or it asks you to tell it, seconds after you did exactly that.
Why the agent went blank
An LLM holds nothing between requests. Every message you send is a brand new HTTP call to a model that keeps no record of the last one.
The chat panel shows you a scrolling conversation, so it feels like one continuous thread. That thread lives in your browser, not in the model.
Anything the model should know has to be sent again with every single call. That resending job is exactly what a memory store does for you.
Did the agent answer with your name?
Check that you sent two separate messages. Typing your name and the question in one message hands the model both facts in a single call, so it answers correctly and hides the gap.
Check the canvas for a memory node sitting under the AI Agent node. Your workflow should have nothing but a Chat Trigger and an AI Agent at this point.Why does my n8n agent still remember my name without a memory node?
Capture the proof
This blank answer is the before shot for the whole project. You'll run the identical two-message test again later, so it pays to have the failure on record.
- Scroll the chat panel so both of your messages and both replies are visible at once.
- Press Cmd+Shift+4 (macOS) or Windows+Shift+S (Windows) to start a screen capture.
- Drag a box around the chat panel to save the screenshot.
- Open the saved screenshot and confirm you can read your name in the first message and the agent's blank answer in the last one.
You've now seen the exact problem this project exists to fix. Next up, you'll add a memory node to the agent and run this same two-message test again.
Add Memory and Get the Agent to Remember
Last step ended with your agent drawing a blank. You told it your name, asked for it one message later, and it had no idea.
That blank is the model's normal behaviour. Each call arrives carrying only the message you just sent, with nothing before it.
A memory store closes that gap by holding the conversation and replaying it into every call. In this step you'll attach one to your agent and run the exact same test that just failed.
In this step, get ready to:
- Add a Simple Memory node to your workflow.
- Connect that node to your AI Agent node.
- Re-run the two-message test and watch your name come back.
Add a memory node to your agent
In n8n, an AI Agent is a cluster of parts. The model hangs off it, tools hang off it, and so does memory.
Your agent has a model attached and nothing else. The Memory connector underneath it is still empty.
- Switch back to the workflow you already have open in the n8n editor.
- Click the + on the Memory connector underneath your AI Agent node.
- Select Simple Memory from the list of memory nodes.
- Close the node's parameters panel to get back to the canvas.
What is Simple Memory?
Simple Memory keeps the chat history for the current session inside your n8n instance. On every run, n8n pulls that history back out and sends it to the model alongside your newest message.
It has two parameters. Session Key decides which conversation a message belongs to, and Context Window Length caps how many past interactions get replayed.
Leave both on their defaults for now. You'll bend the window out of shape later on purpose.
- Look at the canvas for a new Simple Memory node sitting below your AI Agent node.
A line runs from the memory node up into the Memory connector on the agent. That line is the whole point. A memory node with no line does nothing at all.
Memory node floating on its own?
- Dragging the node in from the nodes panel drops it on the canvas unconnected. Delete it and click the + on the agent's connector instead.
- You can also drag from the connector dot on top of the memory node up to the Memory connector on the agent to wire it by hand.
Why won't my Simple Memory node connect to my AI Agent node?
Send the same two messages again
Before you type anything, make a call. Do you think the agent gets your name right this time, and what would have to be true for it to work?
- Return to the chat panel you used in the last step.
- Send a first message telling the agent your name: My name is enter your name.
- Send What is my name? as your second message, without reloading the page in between.
This time the reply comes back with your name in it.
Why the answer changed
The model learned nothing between your two messages. It is as forgetful as it was five minutes ago.
What changed is the package n8n sends. It read the stored history out of Simple Memory and put your earlier message in front of your question, so the name was sitting right there in the prompt.
Still getting a blank answer?
- Check the canvas for the line between the memory node and the agent's Memory connector. No line means no memory.
- Reloading the page between messages can start a fresh chat session, so the two messages land under different session keys. Send them both again in one session.
Why does my n8n agent still not remember my name?
Your agent remembers, and you've seen the before and after side by side. Next up, you'll open the execution log for that run and read the exact conversation n8n handed to the model.
Inspect the Stored Conversation in the Execution Log
Adding the memory node worked. The agent handed your name straight back to you, and you never touched the model settings to make that happen.
The model itself still forgets everything between calls. Something has to quietly re-send your earlier messages on every single turn.
Every run gets saved in n8n as an execution you can reopen. That log holds the exact conversation your agent handed to the model.
In this step, get ready to:
- Open the execution record for the run where the agent recalled your name.
- Read what the agent node actually received as input.
- Find your earlier turns sitting inside the memory node.
Open the execution for your successful run
Every run n8n finishes gets saved as an execution you can reopen and inspect afterwards.
- Return to your workflow in the editor.
- Select the Executions tab in the top menu.
- Select the execution at the top of the list, which is the run where the agent knew your name.
n8n opens a read-only copy of your canvas showing that exact run. Every node on it is holding the data it saw at the time.
Executions list looks empty?
Check you are on the workflow you have been building, not a second workflow you opened along the way.
Runs you start yourself in the editor are only kept when Save manual executions is switched on in your workflow Settings.
My n8n Executions list is empty even though my workflow just ran successfully. What could be causing that?
Read what the agent node received
The reply had your name in it, so the earlier turns must have reached the model somehow. The agent node is the obvious suspect.
Before you open it, do you expect the agent node's input to hold both of your messages, or only the second one?
- Double-click the AI Agent node on the execution canvas.
- Read the Input panel on the left.
- Read the Output panel on the right.
The output holds the reply with your name in it. The input holds only the single message you typed, which means the earlier turns arrived from somewhere else.
Why the model gets the whole conversation every time
A model call is a single HTTP request. Nothing about your last request is still sitting on the model's side when the next one lands.
So the memory node replays the earlier turns into the prompt on every call. The model is not remembering anything, it is re-reading a transcript you keep handing it.
That transcript costs you tokens on every single turn. A long conversation quietly gets more expensive with each message.
Open the memory node to see the stored turns
The memory node hanging underneath the agent is the piece holding the transcript. This run recorded exactly what it handed over.
Before you open it, do you expect to find only your latest message stored in there, or the whole conversation so far?
- Close the node panel to return to the execution canvas.
- Double-click the memory node connected underneath the AI Agent node.
- Read the messages listed in the panel that opens.
You should see the whole conversation, not just your last message. The turn where you told the agent your name is sitting right there in the list, paired with the reply it gave you at the time.
That list is the memory. Everything the agent appears to know about you is text it keeps re-sending.
Memory node showing nothing?
Check the execution you opened is a run from after you connected the memory node. Older runs in the list have no memory data to show.
Check you double-clicked the memory node itself rather than the model node, since both sit underneath the agent.
Why is my memory node showing no stored messages in the execution log?
You can now see exactly what your agent hands the model on every turn. Next up, you'll find out whether that transcript survives a restart.
Make Memory Survive a Restart
Last step you opened the execution log and read the stored conversation exactly as it was handed to the model. The memory is real, and you can point at it.
There is a catch hiding inside that memory. It lives in the running n8n process, and processes do not run forever.
In this step you'll hit that catch on purpose, then move the conversation somewhere it can outlive the process that created it.
In this step, get ready to:
- Restart n8n and watch your Simple Memory store forget everything.
- Run a Postgres database and point the memory node at it.
- Restart n8n a second time and confirm the conversation survived.
Restart n8n and watch the conversation vanish
The Simple Memory node holds your conversation inside the running n8n process. Restarting is the fastest way to find out what that actually means.
Before you restart, make a prediction. Will the agent still know your name on the other side?
- Switch back to the terminal where n8n is running.
- Press Ctrl+C to stop it.
- Start n8n again with the same command you used earlier.
- Reload the n8n editor in your browser once it is back up.
- Open the chat panel the same way you did earlier.
- Send What's my name? in the chat.
The agent has no idea. The conversation you were reading a minute ago is gone, and you changed nothing in the workflow.
Why Simple Memory forgets
Simple Memory keeps the chat history in the memory of the n8n process itself. Nothing is written to disk.
When the process ends, that history ends with it. This reads like a bug the first time you meet it, and it is actually the documented behaviour of the node.
n8n won't start back up?
- Give the old process a couple of seconds to release its port before you run the start command again.
- Make sure you are in the same terminal folder you started n8n from the first time.
- Still stuck? Why won't my n8n instance start again after I stopped it?
Give the conversation a database to live in
A persistent memory store keeps the conversation outside n8n, in a database that carries on existing when n8n stops. You'll use Postgres, because n8n ships a memory node built for it.
- Check whether Docker is already installed by running this command:
docker --version
✔️ I see a version number
Docker is ready. Carry on with the next command below.
ⓧ Command not found
Docker isn't installed yet. Docker Desktop bundles everything you need.
- Open Docker's download page in your browser.
- Download the installer for your operating system.
- Run the installer and follow its prompts.
- Press Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
- Type Docker Desktop and press Enter to open it.
- Wait for Docker Desktop to report that the engine is running.
- Run docker --version again in your terminal to confirm you now get a version number.
- Start a Postgres database in the background by running this command:
docker run --name n8n-memory-db -e POSTGRES_PASSWORD=n8nmemory -p 5432:5432 -d postgres
What does this command do?
- --name n8n-memory-db gives the container a name you can refer to later.
- -e POSTGRES_PASSWORD=n8nmemory sets the database password. This one is a throwaway for a database only your own machine can reach.
- -p 5432:5432 opens the database port so n8n can connect to it.
- -d runs it in the background so you get your terminal back.
- Confirm the database is up by running this command:
docker ps
You should see a row for n8n-memory-db with a status that starts with Up.
No row, or a port error?
- A message about the port being allocated means something else is already using 5432. Stop that service, or map a different local port and use it in the credential below.
- A message about the name being in use means you already have a container called n8n-memory-db. Start the existing one instead of creating a new one.
- Need a hand? Help me read this Docker error and get my Postgres container running.
Point the memory node at Postgres and restart again
The Simple Memory node has to go. In its place goes the Postgres Chat Memory node, wired into the same Memory connector on your AI Agent.
- In the n8n editor, click your Simple Memory node once to select it.
- Press Delete to remove it.
The Memory connector under your AI Agent node is empty again, just as it was before you added memory at all.
- Click the + on the Memory connector under your AI Agent node.
- Search for Postgres Chat Memory and select it.
The node lands on the canvas carrying a warning marker. It has nowhere to connect to yet.
- In the node's credential dropdown, choose to create a new Postgres credential.
- Enter localhost in the Host field.
- Enter postgres in the Database field.
- Enter postgres in the User field.
- Enter n8nmemory in the Password field.
- Select Disable in the SSL field.
- Leave the Port field at 5432.
- Save the credential.
n8n tests the connection as it saves. It tells you straight away whether it reached your database.
Where the conversation lives now
Postgres Chat Memory writes every turn into a table inside your database rather than into n8n's own memory. It creates that table for you the first time it needs it.
The Session Key still decides which conversation a message belongs to. The difference is that the store answering that key now sits outside the n8n process.
- Leave Session Key and Table Name at their defaults.
- Save the workflow.
- Open the chat panel and send My name is followed by your name.
- Send What's my name? and read the reply.
It answers correctly. That proves the new node is wired up, and it proves nothing yet about surviving a restart.
So predict again before you touch the terminal. Does the answer change this time?
- Switch back to the terminal running n8n.
- Press Ctrl+C to stop it.
- Start n8n again with the same command you used earlier.
- Reload the editor and open the chat panel.
- Send What's my name? one more time.
Your name comes back. The process that held the conversation died and restarted, and the conversation was sitting in Postgres the whole time.
Agent still forgetting after the restart?
- Run docker ps and check n8n-memory-db is still listed. If the container stopped, the history stopped with it.
- Check the Postgres Chat Memory node is still joined to the Memory connector on your AI Agent, not sitting loose on the canvas.
- Confirm you saved the workflow before restarting, otherwise n8n reloaded the old Simple Memory version.
- Still blank? My n8n agent forgets everything even though I switched to Postgres Chat Memory.
Your conversation now outlives the process that created it. Next up, you'll shrink the window on purpose and watch the oldest turns drop out of the prompt.
Shrink the Memory Window and Watch Turns Fall Out
Your agent survived a restart and still knew your name. Memory works, so now it is worth looking at what memory costs you.
Every stored turn gets replayed to the model on the next message. A hundred-turn conversation means a hundred turns of text travelling with every single request.
The Memory node has one number that decides how much of that history goes along for the ride. You turn that number down to two and watch the oldest turns drop off the edge.
In this step, get ready to:
- Set the Memory node's context window to two interactions.
- Send five messages and watch the agent lose the earliest one.
- Reopen the execution log and confirm only the last two turns reached the model.
Shrink the memory window to two turns
Your Memory node is storing every turn, and the whole stored history is what gets sent back to the model. One field decides how much of it travels.
- In your n8n workflow, double-click the Memory node to open its settings.
- Find the Context Window Length field in the node's parameters.
- Change its value to 2.
- Close the node panel to return to the canvas.
What does Context Window Length control?
It is the number of previous interactions the memory node considers for context. At 2, only the two most recent exchanges get handed to the model.
Older turns are still sitting in your persistent store. They just stop being included in what the agent gets to read.
Send five messages and lose the thread
You are about to tell the agent four separate facts, then ask about the first one. Before you start, which of those facts do you think it will still be able to answer?
- Return to the chat panel you have been using for this workflow.
- Send My favourite colour is green. as your first message.
- Send I live in Lisbon. as your second message.
- Send My dog is called Rocket. as your third message.
- Send I drink my coffee black. as your fourth message.
- Send What is my favourite colour? as your fifth message.
The agent cannot tell you. It replies that it does not know your favourite colour, or it asks you to tell it again.
Why green disappeared
By the time you asked the question, the colour message was four interactions back. A window of two only carries the coffee and the dog.
This is the same blankness you saw before you added memory at all. The difference is that this time you chose it.
Agent still knows your colour?
- Reopen the Memory node and check the value actually saved as 2 rather than reverting when you closed the panel.
- Count your messages. If you sent fewer than five, the colour is still inside the two-turn window.
My agent still recalls an old message after I set the window to two
Read the trimmed conversation in the execution log
The chat reply tells you the agent forgot. The execution log tells you exactly what it was given.
Before you open it, how many of your five messages do you expect to find in what was sent to the model?
- Return to the execution log for this workflow.
- Select the most recent execution in the list.
- Open the AI Agent node in that execution to see the conversation it received.
Only the two most recent interactions appear in the prompt. Your colour, your city and your dog are nowhere in it.
What the window is really buying you
Every turn inside the window is text you pay to send on every single message. A wide window buys recall and quietly inflates tokens on each turn.
Two is deliberately brutal so the effect is visible in one screen. Real agents usually sit somewhere between ten and thirty.
Still seeing all five turns in the log?
- Check you opened the newest execution. An older run in the list still carries the wider window.
- Confirm you are reading the input the AI Agent node received, not the full stored history on the Memory node.
Help me read what my n8n execution log is actually showing me
You now hold the dial between an agent that remembers enough and one that pays to reread its whole life on every message. That same field takes any number you want.
Secret mission
Give Two Conversations Their Own Memory
Every message you have sent so far lands under one session key. Point the same agent at two different keys and watch each conversation stay sealed off from the other. Then switch back and find the first one exactly where you left it.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely. Everything here runs on your own machine, so the only cost was the few cents of model calls you already made.
Resources you used:
- Your n8n workflow, holding the Chat Trigger node, the AI Agent node and the Memory Node.
- The model credential saved in n8n.
- The local n8n instance running on your machine.
Keep everything running
No action needed. Choose this if you're still actively building on top of this agent.
- Leave your local n8n instance running in its terminal window.
- Leave the model credential saved in n8n so your next workflow can reuse it.
Keep the window limit small
Your Memory Node still sends only the two most recent turns to the model. That keeps every future message cheap while you keep experimenting.
Pause - I'll come back to this later
Shut down the running process to free up memory. Your workflow and its stored conversation stay exactly where they are.
- Switch back to the terminal running your local n8n instance.
- Press Ctrl+C to stop it.
- Leave the workflow and the model credential saved so they load again next time you start n8n.
Your conversation survives the shutdown
You already proved this when you restarted n8n and the agent still knew your name. The persistent store keeps the conversation on disk, so stopping the process loses nothing.
Delete - I don't want to use this again
Remove all project resources and start fresh. Save a copy of the workflow first so you can rebuild the same agent whenever you want it.
- Open your workflow in the n8n editor.
- Download the workflow as JSON from the workflow's options menu in the top right of the editor.
- Delete the workflow from the workflow list in the n8n editor, using the options menu on its row.
- Delete the model credential from the credentials list in the n8n editor, using the options menu on its row.
- Switch back to the terminal running your local n8n instance.
- Press Ctrl+C to stop it.
Was your model key shared with someone else?
Deleting the credential removes the key from n8n, but the key itself still works wherever it is stored. If the key came from a shared account, rotate or revoke it in your model provider's dashboard as well.
Nice Work!
Nice Work!
Nice work! You've built an AI agent in n8n that remembers what you tell it. You also know exactly how much of the conversation it carries into each reply.
You've learned how to:
- Wire a Chat Trigger into an AI Agent node, add a model credential, and hold a live conversation with it.
- Prove what a Memory Node actually buys you. The same two messages failed before you connected it and worked after.
- Read the execution log to see the exact conversation sent to the model. Shrinking the window limit pushed the oldest turns straight out of it.
- Secret Mission: You took on an optional challenge to push your agent further.
Ready to quiz yourself?