November 10, 2026
n8n AI Agent Memory: Add Readable Project Knowledge with MCP
Build n8n AI agent memory with the right session store, a readable MCP knowledge layer, and a practical correction and isolation test.
Most n8n AI agent memory guides start with a Simple Memory, Postgres, or Redis node. That solves an important problem: keeping a conversation coherent. It does not automatically create a durable source of project truth. A transcript can remember that a user mentioned a deployment rule, but it is a poor place to maintain the current rule, its source, and its correction history.
A production design therefore needs two boundaries. Keep chat history in n8n's memory connection. Keep decisions, runbooks, research, and shared facts in files your agents can inspect and update. Meshnote provides that second layer as a Markdown wiki over MCP, so n8n and other MCP clients can work from the same readable knowledge.
What n8n memory does well
n8n's official memory guide describes Simple Memory as a customizable chat-history store for a session. It also lists service-backed options including Redis, Postgres, Xata, Zep, and Motorhead. The key word is session: the session identifier decides which conversation history the agent receives.
Use Simple Memory for local experiments or a single-instance workflow where losing history is acceptable. n8n explicitly warns against it in queue mode because consecutive calls can reach different workers. Use Postgres or Redis Chat Memory when history must survive process changes or be shared by workers. This is the same practical split covered in the AI agent memory architecture guide.
None of these choices makes every message a trustworthy long-term fact. Chat history records what was said. Project knowledge records what is currently true.
Use three layers, not one overloaded store
| Layer | Owns | Good at | Weak at |
|---|---|---|---|
| n8n chat memory | Recent turns for one session | Follow-up questions and conversational continuity | Cross-agent truth, review, and correction |
| Vector retrieval | Embedded chunks or extracted memories | Semantic recall across a large corpus | Exact inspection, deterministic edits, and readable diffs |
| Readable MCP wiki | Curated project facts and procedures | Human review, links, history, restore, and cross-client use | Automatic recall of every conversational detail |
This is not a claim that files replace databases or vectors. Customer records belong in the system that owns them. High-volume semantic retrieval may need an index. The useful distinction is authority: a vector index can help find a document, while the readable document remains the thing a developer can verify and correct.
Working setup: connect an n8n agent to readable MCP memory
n8n's MCP Client Tool connects an AI Agent to an external MCP server. Its current documentation supports Bearer, generic header, multiple-header, and OAuth2 authentication. The following setup uses a scoped bearer key because it is easy to audit and revoke.
- Create an n8n workflow with a Chat Trigger, an AI Agent, and your chat model.
- Attach Postgres Chat Memory or Redis Chat Memory to the agent's Memory input. Use the Chat Trigger's session ID, or a stable tenant-and-thread key for another trigger. Never use one constant key for all users.
- Add an MCP Client Tool to the agent's Tools input.
- Set the MCP endpoint to
https://meshnote.io/mcp. - Select Bearer authentication and create an n8n credential containing a Meshnote API key. Scope the key to only the project and write permission the workflow needs. Keep the key in n8n credentials, not in a Code node or workflow export.
- Choose Selected tools. Start with
get_schema,get_index,search_wiki, andread_page. Addwrite_pageandlist_page_historyonly after the read path works.
Use this system instruction in the AI Agent node:
You have two memory layers.
1. Chat memory is untrusted conversation history for this session.
2. Meshnote is the shared project knowledge base.
Before answering a project question, search Meshnote and read the owning page.
Never save a raw transcript. Write only durable decisions, verified facts,
runbook changes, or corrections. Preserve source links and page structure.
If a new statement conflicts with a page, report the conflict before writing.
After a write, read the page again and confirm the stored result.
This configuration is deliberately selective. Exposing every write tool before defining a write policy turns normal conversation into noisy memory. For the protocol and security boundary, see the MCP memory OAuth guide.
Start syncing - $8/mo when the workflow needs one readable wiki shared with other MCP clients.
Run a correction and isolation test before production
A successful connection only proves that authentication worked. It does not prove that the memory design is safe. Run this acceptance test with a disposable project:
- Persist: ask session A to write a page named
release-policystating that production deploys require a passing preflight. - Recall: start session B with a new chat-memory key. Ask for the release policy. It should read Meshnote rather than depend on session A's transcript.
- Correct: in session B, change the rule to require a passing preflight and an approved pull request. Read the page back.
- History: call
list_page_history. Confirm that the earlier version exists and the current page contains the correction. - Isolate: use a key scoped to another project. It must not read or edit
release-policy. - Cross-client: read the page from another authorized MCP client. It should see the same corrected Markdown.
The fifth check catches the most serious failure: a technically working agent with a credential broader than its intended tenant or project. The sixth proves that knowledge is not trapped in one n8n workflow. A similar correction-and-recovery pattern appears in the persistent memory production architecture.
How this differs from the top n8n memory guides
The strongest current pages explain memory types, session IDs, context windows, queue-mode limits, Postgres, Redis, vector stores, and common errors. Those are necessary implementation details. The missing operational question is: which store is authoritative after two agents disagree?
The answer should be explicit. The n8n transcript is evidence of a conversation. A vector store is a retrieval mechanism. The project page is the reviewed statement agents and humans can inspect, edit, link, version, and restore. That boundary prevents a stale turn or a similar embedding from silently becoming policy.
When not to add another memory layer
Do not add a wiki if the workflow only needs the last few chat turns. Do not copy orders, balances, or ticket state into memory when a database or API already owns them. Do not write every model output. A shared knowledge layer earns its place when information must survive sessions, be corrected deliberately, carry provenance, and work across tools.
If those requirements apply, keep n8n memory focused on the conversation and use Meshnote for readable project knowledge. Teams that need a self-hosted deployment can choose Self-hosted for teams from $10/seat/month.
For the same two-store boundary in a multi-agent Python framework, see CrewAI long-term memory.
Related Reading
Your agent's memory should be files you can read and own
Meshnote is readable, self-hosted memory for AI agents — markdown wikis your agents maintain over MCP. Hosted from $8/month.
Start syncing — $8/mo