---
title: "Chat agent with chat memory and a calculator"
kind: "Kit"
category: "Productivity"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/b5f278f1-48de-4ece-bd11-fb0fd4c543de"
updated: "2026-11-12"
---

# Chat agent with chat memory and a calculator

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow with a chat window and an AI Agent that remembers the conversation. Each message is read with the earlier ones, and the agent answers through an OpenAI model and can use a Calculator tool.

Chat agent with chat memory and a calculator is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow is a chat agent with a memory. You type in n8n’s chat, and a memory node hands back the earlier messages. An AI Agent reads them with your new message, answers through an OpenAI chat model and can use a Calculator tool. The exchange is then stored for the next turn. Mindket’s copy swaps the retired OpenAI Assistant node for that agent and a model node. Ten working nodes run it, beside five sticky notes.

### Who it suits

Builders who want a small chat agent that holds a conversation, and teams moving an older assistant flow off OpenAI’s retired Assistants API. Skip it if you need an assistant’s files or retrieval, which this copy does not reproduce.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Software | Developers | Start a chat agent they can extend with more tools | A developer adds a lookup tool beside the Calculator and tests it in the chat. |
| Support | Team leads | Try a helper that keeps context before wiring it to a live channel | A lead checks that the agent keeps a customer’s name across five messages. |
| Education | Course builders | Show how chat memory works in n8n | A trainer tells the agent a name, then asks for it a few messages later. |
| Small business | Owners | Keep a private helper for quick sums | An owner asks for a quote total, then a discount on it. |

You need a little n8n: import a file, add an OpenAI credential and write the agent’s instructions.

### Where to use it

Any n8n that can reach OpenAI will run it. The chat opens inside the n8n editor, and with Make Chat Publicly Available on it can also open from its own address.

- n8n Cloud: import the file into a new workflow there
- Your own n8n server: the same file and steps
- The editor’s chat button: the quickest way to test
- A public chat address: the file has it switched on, so add authentication before you share it

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. One OpenAI key covers the model.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| OpenAI | An API key with access to \`gpt-5.6-terra\` |
| Instructions | The text your assistant used to be given, if it had any |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Open `OpenAI Chat Model` and add an OpenAI credential with your key.
3. Open `AI Agent`, choose Add Option, then System Message, and type the instructions the agent should follow.
4. Save and open the chat from the button at the bottom of the canvas.
5. Tell the agent your name, then ask what your name is. Ask for a sum such as `1234 * 5678` to see the Calculator work.

### How to use it

Open the chat and talk to it. Each turn the workflow reads up to 20 earlier interactions from the memory node, adds your new message and sends the whole text to the model. The answer and your message are then stored.

What to change for a different result

| To change | Where |
| --- | --- |
| The model | Model in \`OpenAI Chat Model\` |
| The agent’s instructions | System Message in \`AI Agent\` |
| How much it remembers | Context Window Length in \`Window Buffer Memory\`, 20 as it stands |
| More tools | Connect other tool nodes to \`AI Agent\`, beside \`Calculator\` |
| Who can chat | Make Chat Publicly Available in \`Chat Trigger\` |

### Example

A shop owner types “My name is Dana and I sell tea.” The agent greets her. A few messages later she asks for the cost of 18 boxes at 23.5 each, less 10%, and then asks what her name was.

The agent works the sum with the Calculator and gives the total. It also answers with Dana, because the stored messages come back into every prompt. `Edit Fields` returns each answer as `output` for the chat window.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. Here the agent sits in the middle with its model and Calculator plugged in underneath. The boxes before and after it read and write the conversation. Send two messages, then open the run and read the prompt the agent received.

**For experts.** The history is pasted into the agent’s text by an expression, so the agent node itself has no memory attached.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Chat Memory Manager\` | Reads the stored messages from \`Window Buffer Memory\` | Version 1 returns one item for each exchange, with \`human\` and \`ai\` |
| \`Aggregate\` | Folds those items into one \`messages\` list | \`AI Agent\` builds its “Our Previous Conversation” from it |
| \`AI Agent\` | Tools Agent 1.8 with \`OpenAI Chat Model\` and \`Calculator\` | \`promptType\` is \`define\`, with the text built by an expression |
| \`Chat Memory Manager1\` | Adds your message and the answer to the memory | Version 1 returns every stored message as an item |
| \`Limit\` | Keeps one item | The chat then gets one answer, not one for each stored message |

### Good to know

The OpenAI Assistants API is gone, and this copy no longer uses it.

- The API: OpenAI’s deprecations page, read on 12 November 2026, lists the Assistants API as shut down on 26 August 2026, with the Responses API and the Conversations API as its replacement. Mindket’s copy swaps the \`OpenAI Assistant\` node for an \`AI Agent\` with an \`OpenAI Chat Model\`
- The assistant: its ID is gone. Instructions, files and tools kept on OpenAI’s side do not carry over, so put the instructions in System Message
- The model: the file sets \`gpt-5.6-terra\`. The same page gives 11 December 2026 as the shutdown of \`gpt-5-mini\`, the model this node version picks when none is set
- Open chat: Make Chat Publicly Available is on, so once the workflow is active anyone with the chat address can use your key
- Memory: \`Simple Memory\` lives in n8n’s own memory, which its node says does not suit queue mode, and its code clears a session after an hour without a message
- First message: the memory is empty, so the history in the prompt reads \`undefined\`
- Billing: OpenAI bills each model call, and a sum with the Calculator adds one
- Your data: your messages and the stored history go to OpenAI
- Credentials: the JSON holds none

## README

```markdown
# Chat agent with chat memory and a calculator

An n8n workflow with a chat window and an AI Agent that remembers the conversation. Each message is read together with the
earlier ones, the agent can use a Calculator tool, and its answer and your message are stored for the next turn.

## What is inside

- `workflow.json`: the workflow as n8n exports it, ten working nodes and five sticky notes. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- The original called an OpenAI assistant through n8n's OpenAI Assistant node, which uses OpenAI's Assistants API. OpenAI's
  deprecations page, read on 12 November 2026, lists that API as shut down on 26 August 2026, with the Responses API and the
  Conversations API as its replacement. The node is now an `AI Agent` (the Tools Agent, version 1.8) with an
  `OpenAI Chat Model` node (`gpt-5.6-terra`) and the same Calculator tool. The prompt it receives, with the earlier messages
  and the new one, is unchanged.
- The assistant's ID is gone. What the assistant held on OpenAI's side (its instructions, files and its own tools) does not
  carry over: put the instructions in the agent's System Message option.
- `Edit Fields` read the answer from the old node's name. It now reads `AI Agent`.
- Two sticky notes talked about choosing an assistant. They now describe the AI Agent.
- The credential links and the Chat Trigger's webhook ID are gone.
- Nothing else. The file has no Code node.

## Before you start

- An n8n instance, on n8n Cloud or your own server.
- An OpenAI API key with access to `gpt-5.6-terra`.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Open `OpenAI Chat Model` and add an OpenAI credential with your key. Change the model there if you want another.
3. Open `AI Agent`, and under Add Option choose System Message. Type what your assistant used to be told.
4. Save and open the chat from the button at the bottom of the canvas.
5. Test the memory: in a first message, tell the agent your name. In a second, ask what your name is. Then ask it to work out
   something like `1234 * 5678` to see the Calculator.

## How a run goes

1. `Chat Trigger` takes the message. Make Chat Publicly Available is on, and Load Previous Session is set to From Memory,
   so the chat window can show earlier messages.
2. `Chat Memory Manager` reads the stored messages from `Window Buffer Memory`. `Aggregate` puts them into one `messages`
   list.
3. `AI Agent` gets a text made of that history under "Our Previous Conversation" and the new message under "Current
   message". It answers with `OpenAI Chat Model`, and may call `Calculator`.
4. `Chat Memory Manager1` adds your message and the agent's answer to the memory.
5. `Limit` keeps one item. `Edit Fields` sets `output` to the agent's answer, which the chat window shows.

`Window Buffer Memory` (Simple Memory 1.1) keeps the last 20 interactions. Its key is the chat's session ID with `123` added.

## Change the look

- The model: Model in `OpenAI Chat Model`.
- The agent's instructions: System Message in `AI Agent`.
- How much it remembers: Context Window Length in `Window Buffer Memory`, 20 as it stands.
- More tools: connect other tool nodes to `AI Agent`, beside `Calculator`.
- Who can chat: switch Make Chat Publicly Available off in `Chat Trigger`.

## Good to know

- The Assistants API is gone from OpenAI. Mindket's copy uses the agent and chat model nodes instead, so the old
  `OpenAI Assistant` node and its assistant ID are not part of it.
- OpenAI's page, read on 12 November 2026, also gives 11 December 2026 as the shutdown of `gpt-5-mini`, which an
  OpenAI Chat Model node of this version picks when no model is set. The file sets `gpt-5.6-terra`.
- Make Chat Publicly Available is on. Once the workflow is active, anyone with the chat address can talk to the agent on your key.
- `Simple Memory` stores in n8n's own memory. n8n's node says it does not suit queue mode or several main instances, and its
  code clears a session after an hour without a message.
- On a session's first message the memory is empty, so the history in the prompt reads `undefined` for both sides.
- `Chat Memory Manager1` is version 1, which returns every stored message as an item. `Limit` is there so the chat gets one
  reply.
- Each message is sent to OpenAI together with up to 20 earlier interactions.
```

## What is in it

3 files, 13 KB, downloaded as a zip.

```text
NOTICE.md  630 B
README.md  4 KB
workflow.json  8 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 7 steps, starting on a chat message
- AI: 1 step calls an AI model: AI Agent
- Sign-ins: Signs in to: OpenAI
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 6 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/b5f278f1-48de-4ece-bd11-fb0fd4c543de)
- [Its page on Mindket](https://mindket.com/p/b5f278f1-48de-4ece-bd11-fb0fd4c543de)
