How to Build a Second Brain With n8n AI Agents and Memory
Build it as three n8n workflows: capture channels such as Telegram or email, an ingestion workflow that extracts metadata, embeds each note into a vector store and keeps a readable copy, and a chat workflow where the AI Agent node uses a memory sub-node for the conversation and the vector store as its search tool.
Two kinds of memory, and why a second brain needs both
The most common mistake in an n8n second brain is expecting the agent's memory sub-node to hold your knowledge. It does not. n8n's memory sub-nodes, such as Simple Memory, Postgres Chat Memory, Redis Chat Memory and MongoDB Chat Memory, store recent chat messages for a session so a conversation can continue without resending context. Each takes a Session Key and a Context Window Length, the number of previous interactions to keep. Per n8n's docs, AI Agent nodes can use memory and chains cannot.
The notes, links, quotes and files you want to recall months later belong in a vector store, searched by meaning. So a working second brain has two stores: chat memory for the last few turns, and a vector store for everything you have ever saved. A human-readable copy, in Notion or similar, is a useful third.
A reference build: NeuralNine's three workflows
The seed for this page is NeuralNine's hour-long "n8n Tutorial: Second Brain With AI Agents & Memory", published 16 November 2026. The exported workflows are public in the channel's GitHub tutorials repository, and they make a clean reference architecture. The node names below come from those files and n8n's documentation.
Ingestion workflow
Started by an Execute Workflow Trigger so other workflows can call it. An Information Extractor node, backed by an OpenAI Chat Model, pulls structured fields from the raw content: type, tags, source, URL and author. A Notion node creates a database entry with those fields and appends the content. In parallel, a Qdrant Vector Store node in Insert Documents mode stores the content through a Default Data Loader and an Embeddings OpenAI sub-node.
Email capture workflow
A Schedule Trigger runs every 15 minutes. A Gmail node fetches messages carrying a dedicated label, attachments are uploaded to Google Drive, each message is handed to the ingestion workflow, and the label is removed so nothing is processed twice.
Chat agent workflow
A Telegram Trigger receives messages, an IF node rejects anyone but the owner's Telegram user ID, and a Switch node routes text, voice and photos. Voice is transcribed with the OpenAI node. The AI Agent node then gets an OpenAI Chat Model, Simple Memory with a context window length of 20, a Qdrant Vector Store in Retrieve Documents (As Tool for AI Agent) mode as its search tool, Gmail and Google Calendar tools for read-only lookups, and a Call n8n Workflow Tool that points at the ingestion workflow so the agent can save new notes itself.
Build it in four steps
1. Build ingestion first. Everything else depends on it. Decide the metadata you will want to filter on later, such as type, tags, source and date, and extract it before embedding. In n8n, metadata is set by the document loader at insert time, not by the vector store node, so wire it there.
2. Add the chat agent. Attach a chat model, a memory sub-node and the vector store in Retrieve Documents (As Tool for AI Agent) mode. Give the tool a clear name and description, because the agent chooses tools by their descriptions.
3. Add capture channels. Telegram, email, a form, a webhook from a browser extension. Each one only normalizes input and calls the ingestion workflow, so adding a channel never touches the agent.
4. Write strict rules into the system message. NeuralNine's agent prompt tells it to save self-contained notes with pronouns resolved and URLs kept, to search the brain before answering questions about saved knowledge and answer only from results, to say so when nothing is found, and never to send emails or create events. Those rules do more for reliability than model choice.
Choosing the memory and vector store nodes
Simple Memory is fine for one user on a single n8n instance. n8n's docs warn not to use it in queue mode, because calls may not reach the same worker. Keep the context window short; the vector store, not the chat buffer, carries long-term recall.
Postgres Chat Memory, Redis Chat Memory or MongoDB Chat Memory persist history in a database, survive restarts, and work across workers. Set the session key to the chat or user ID so conversations do not bleed together. n8n notes that several Postgres Chat Memory nodes in one workflow share one memory instance unless their session IDs differ.
For the vector store, Simple Vector Store is in-memory and suited to testing. Qdrant, PGVector, Pinecone and Supabase Vector Store nodes give persistent storage; PGVector is attractive if you already run Postgres for chat memory, since one database then covers both.
Where a homemade second brain breaks
Edits and duplicates. Re-sending an updated note inserts a second vector rather than replacing the first, so search returns both versions. Store a stable ID in metadata and delete before re-inserting.
Filtering. n8n's Qdrant docs list the Metadata Filter option for Get Many and the chain retrieval mode, so check what your chosen retrieval mode supports before relying on filters by tag or date.
Privacy. In the reference build, every note passes through a hosted model for extraction, embedding and transcription. That is a fine trade for personal links and a poor one for client material.
Scale. Search quality depends on chunking. Long documents saved as single entries embed poorly and retrieve vaguely.
Using a retrieval layer you do not maintain
If your notes already live in plain folders or an Obsidian vault, you can skip building ingestion and indexing. RDK indexes them as encrypted private chunks, with content kept on your node under the vault key, and agents query them over MCP, the CLI or the Partner API, getting a few hundred tokens of context instead of whole documents. n8n's MCP Client Tool node lets an AI Agent call tools exposed by an MCP server, which is the natural place to attach an external retrieval layer while keeping n8n for capture and orchestration.
Frequently asked questions
- What is the difference between n8n memory nodes and a vector store?
- Memory sub-nodes such as Simple Memory or Postgres Chat Memory keep the recent messages of one conversation, keyed by a session key, so the agent can follow the thread. A vector store keeps saved knowledge as embeddings and returns passages by meaning. A second brain needs both: chat memory for continuity, the vector store for recalling anything saved weeks ago.
- Which memory node should an n8n second brain use?
- Simple Memory works for a single user on one n8n instance and for testing, but n8n advises against it in queue mode. For anything that must survive restarts or run across workers, use Postgres Chat Memory, Redis Chat Memory or MongoDB Chat Memory, with the session key set to the user or chat ID so conversations stay separate.
- Which vector store works best with n8n?
- n8n has nodes for Qdrant, PGVector, Pinecone, Supabase and others, plus an in-memory Simple Vector Store for testing. The NeuralNine reference build uses Qdrant. PGVector is convenient if Postgres already holds chat memory. Choose on what you can host and back up; for a personal knowledge base, chunking and metadata matter more than the database.
- How does the n8n agent decide when to save versus search?
- Through its system message and tool descriptions. In the reference build, the ingestion workflow is exposed with the Call n8n Workflow Tool and the vector store as a retrieval tool. The prompt tells the agent to save shared ideas and links, to search before answering questions about saved knowledge, and to ask when intent is unclear.
- Can an n8n second brain run fully self-hosted?
- The orchestration can, since n8n is self-hostable and vector stores such as Qdrant and PGVector run locally. The reference build still calls hosted OpenAI models for extraction, embeddings and transcription. A fully local version needs local chat and embedding models, which n8n supports through other model sub-nodes, at some cost in quality and speed.