--- title: "n8n AI agent memory beyond chat history" description: "n8n's memory nodes store chat history per session. How to give n8n AI agents durable, temporal memory with two HTTP Request nodes and no custom code." canonical: https://past.dev/integrations/n8n last-updated: 2026-10-15 --- # Memory for n8n AI agents Source: https://past.dev/integrations/n8n n8n AI agent memory nodes store chat history. Simple Memory keeps recent turns in RAM. The Postgres, Redis and MongoDB variants persist transcripts by session. Two HTTP Request nodes can connect an n8n agent to past.dev for timestamped ingestion and grouped recall documents with dated source excerpts. ## What n8n's memory nodes actually store The [Simple Memory node](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorybufferwindow/) keeps a window of recent messages in instance memory, cleared on restart. The database-backed variants persist the same thing durably: message history, keyed by session. That is the right tool for follow-up questions inside one conversation. - History is scoped to one session. A new session has no access to a previous session's transcript unless the workflow loads it. - Raw transcripts grow without structure: no facts, no entities, no dates beyond message order. - Two workflows cannot share what they learned; each keeps its own transcript. ## The two-node integration 1. **Remember.** After the agent node, add an HTTP Request node: POST to `https://api.past.dev/api/v1/ingest` with JSON body `{"content": , "timestamp": , "identity": }` and an `Authorization: Bearer` header from your credential. 2. **Recall.** Before the agent node, add an HTTP Request node: POST to `https://api.past.dev/api/v1/recall` with `{"query": , "identity": }`. Map the response into the agent's prompt as context. Set `identity` with an expression that reads the user id your application sends to the workflow's trigger. Alternatively, attach an HTTP Request node to the agent as a tool, so the agent decides when to query it ([HTTP Request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/)). Let the model fill in `query` only, and set `identity` with the same expression ([let the model fill in a parameter](https://docs.n8n.io/advanced-ai/examples/using-the-fromai-function/)). Both designs keep the existing chat-memory node for conversational context and store durable facts through the API. > **Identity** > > The application sets the identity. The model never chooses it. Recall returns what the identity in the request may read, so take the identity from the signed-in user in code, and keep it out of every value that the model fills. Recall returns ranked documents with dates and source excerpts. The application decides whether those documents support an answer, contain a disagreement, or are insufficient; HTTP failures are handled separately. ## Or connect the MCP server The **MCP Client Tool** node gives an AI Agent node the tools of a remote MCP server ([MCP Client Tool](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolmcp/)). The project's end-user MCP server then gives the agent `recall`, `answer` and `who_am_i`, plus `remember` while the project's write toggle is on, with no tool code to write. 1. Turn on the project's end-user MCP server on **Build › MCP server** in the console. 2. Mint an access link there, or with the account server's `create_mcp_access_link` tool. The link has the form `https://api.past.dev/mcp//link/`. It is one URL that is one identity, and the server answers it with no sign-in step. 3. Keep the link out of shared documents, tickets and chat. The secret in its path is the credential. In the node, set **Endpoint** to the access link, **Server Transport** to **HTTP Streamable** and **Authentication** to **None**, because the secret in the link is the credential. Every execution of the workflow then acts as the link's identity. Anyone who can open the workflow can read the link, so limit who can open it. Every call through the link runs as its identity, with that identity's audiences. Mint one link per install, so that a revoked link stops one agent only. When the agent serves several people, mint one link per end user, and connect each request with the link of the user who makes it. Never share one link between users. `remember` writes to the identity's own private audience, and only that identity recalls it. Send data that the whole project must recall through the ingest call. The [end-user server documentation](/docs/mcp/serving-your-own-users) describes the tools, the links and revocation. ## What this makes possible in n8n - A support workflow that recognizes a returning customer and recalls every promise ever made to them, with dates. - Separate workflows, email triage and chat support, reading and writing one shared memory. - Client-scoped memory for agencies: one project key per client keeps each client's facts isolated. - Backfills: ingest a year of tickets with their original timestamps to preserve event dates. ## Routing workflows by recall results An IF node can inspect `results` and route according to application policy. It can proceed when source excerpts support an answer, escalate when returned documents disagree, or return an insufficient-evidence response. See the [quickstart](/docs/memory-api/quickstart) for setup and [benchmarks](/benchmarks) for recall evaluation. ## Frequently asked questions ### Do I remove the Postgres chat memory node? Keep it. Chat memory gives the agent conversational flow; past.dev keeps the durable facts. They do different jobs and work well together. ### Can non-developers set this up? Yes. Both calls are standard HTTP Request nodes with a JSON body and a bearer credential, the same pattern as any API integration in n8n. ## Related - [Memory for LangChain](https://past.dev/integrations/langchain) - [Memory for the Claude Agent SDK](https://past.dev/integrations/claude-agent-sdk) - [Memory for productivity tools](https://past.dev/use-cases/productivity) - [Memory for Dify](https://past.dev/integrations/dify) - [What is agent memory?](https://past.dev/what-is-agent-memory) - [Quickstart](https://past.dev/docs/memory-api/quickstart)