Skip to main content
Cognee gives your n8n workflows a memory. Store notes, documents, and messages, let Cognee organize them, and then ask questions about them in plain English — all from n8n’s visual editor, without writing any code. A few things people build with it:
  • A support bot that answers questions from your help docs
  • A research assistant that remembers everything you feed it from RSS feeds or web pages
  • A sales helper that recalls what you know about a customer before a call

Install the Cognee node

Cognee ships as a free n8n community node package. Installing it adds two nodes: Cognee, the action node used in the workflows below, and Cognee Memory, a memory sub-node for n8n’s AI Agent.
  1. Log in to your self-hosted n8n
  2. Go to Settings → Community Nodes
  3. Click Install, search for n8n-nodes-cognee, and confirm
Don’t have n8n yet? Follow n8n’s Docker setup guide, then open n8n at localhost:5678.

Connect your Cognee account

  1. Sign in to Cognee Cloud and copy your Base URL and API key from the API Keys page
  2. In n8n, add the Cognee node to a workflow (click + and search for “cognee”)
  3. When asked for credentials, create a new Cognee API credential and paste in your Base URL and API key
Enter the Base URL exactly as shown in your dashboard (for example https://tenant-xxx.aws.cognee.ai) — don’t add anything after it. The node appends /api itself.
Running your own Cognee server? Use its address (for example http://localhost:8000) as the Base URL instead. The node calls the same /api/v1 routes on Cognee Cloud and self-hosted servers.

Your first memory workflow

A memory workflow has three steps: store something, let Cognee organize it, then ask a question about it. Each step is one Cognee node.

1. Add Data — store something

  • Resource: Add Data
  • Dataset Name: my-dataset (a dataset is like a folder for related content)
  • Text Data: any text you want Cognee to remember

2. Cognify — organize it into memory

  • Resource: Cognify
  • Datasets: my-dataset
This is where Cognee reads what you stored and connects the facts inside it, so it can answer questions later.

3. Search — ask a question

  • Resource: Search
  • Search Type: Graph Completion
  • Datasets: my-dataset
  • Query: a plain-English question, like “Tell me about NLP”
Run the workflow, and the Search node returns an answer based on what you stored.
Want fewer nodes? The Memory resource does the same job in two: Remember stores text or a file and organizes it in one call (Add Data + Cognify), and Recall asks the question.
Everything you add from n8n also appears in your Cognee Cloud workspace, and n8n can search data you’ve already added there.

Start from a template

Prefer not to build it by hand? Copy the template below, click an empty spot on your n8n canvas, and paste (Cmd+V / Ctrl+V). The three connected nodes appear, ready to run — you don’t need to read or edit the JSON, just copy and paste it.
  1. Copy the template (use the copy button in the corner of the block)
  2. Paste it onto your n8n canvas
  3. Open each Cognee node once and select your Cognee API credential
  4. Click Execute workflow, then check the Search node’s output for the answer
The template stores two short support answers, organizes them into memory, and asks “How do I export my data?” — swap in your own text and questions once it runs.

Give an AI Agent long-term memory

Cognee Memory is a sub-node for n8n’s AI Agent: click the Agent’s Memory port and it appears next to Simple Memory, Redis Chat Memory, and Postgres Chat Memory. Each turn of the conversation is stored in a Cognee session, so the chat history survives restarts and stays readable from any Cognee client — no second datastore to run if you already have Cognee. Since version 0.8.0 it also remembers across conversations. For every question it recalls relevant knowledge from the knowledge graph and hands it to the agent along with the chat history. It also promotes the sessions it writes into the knowledge graph, so a user who comes back later under a new Session ID is remembered. Both are on by default.
  1. Wire a Chat Trigger into an AI Agent
  2. Click the Agent’s Memory port and pick Cognee Memory
  3. Select your Cognee API credential
  4. Session ID defaults to {{ $json.sessionId }} (the chat trigger’s session); keep it, or use any stable per-user key
  5. Recall Query defaults to {{ $json.chatInput }} (the chat trigger’s message). It’s the question recall searches for; when it resolves to nothing, recall is skipped for that turn
  6. Chat — every turn is saved as a question/answer entry in that session
The recalled context is added as one message right before the question. It’s never written into the session, so n8n’s Chat Memory Manager still sees the real transcript. If recall or promotion fails, the node logs a warning and the agent’s turn continues — a failed promotion is retried on the next execution.
For searches the agent should decide to run, also attach the Cognee node to the Agent’s Tool port. The Memory port’s recall is context the agent always gets; a tool is a search the agent runs when it judges it needs one.
A few things to know:
  • Sessions are keyed per Cognee user and Session ID, not per dataset, so reusing one Session ID under two dataset names mixes a single history rather than splitting it. Keep Session IDs unique.
  • The last promotion time and the sessions waiting to be promoted are kept in the workflow’s static data, which n8n only saves for production executions. Manual test runs from the editor promote every time.
  • Promotion is driven by traffic: a conversation that goes quiet is promoted when the next execution past the interval ends. To promote at a fixed hour instead, use the nightly promotion workflow (Schedule Trigger → Session Get Many → Memory → Improve). It promotes into main_dataset until you set its Dataset Name to the dataset your Cognee Memory writes to.
  • Promotion sends one request per dataset, so a Dataset Name expression (one dataset per customer, say) promotes each session into its own dataset. If the server is busy promoting, the sessions stay queued for the next execution. Once 1000 sessions are queued, the execution that queues the 1000th promotes them, regardless of the interval.
  • The sub-node needs n8n 2.16 or newer, the first release that exposes n8n’s AI node SDK to community nodes. The Cognee action node has no such requirement.
  • On a self-hosted Cognee server the session cache has to be on (CACHING=true, the default — see Sessions and caching). Cognee Cloud has it enabled already.
  • Clearing a session isn’t supported yet, because Cognee has no endpoint that deletes a single session. The Chat Memory Manager operations that wipe memory first — Delete Messages, and Insert Messages with Override All Messages — fail with an explanatory error instead. Start a new Session ID for a fresh conversation.

What each operation does

The Cognee node groups its operations into resources. Pick the resource first, then the operation. The Cognee node also works as a tool for n8n’s AI Agent: attach it to the Agent’s Tool port to let the agent remember and search on its own.

Picking a search type

Both Search and Recall offer nearly all of Cognee’s search types, beyond the three above. Recall also has Auto, which lets the server pick one for you, and defaults to Hybrid Completion. Learn more about how search works in the search basics guide.

Troubleshooting


GitHub Repository

View source code and contribute

n8n Documentation

Learn more about n8n community nodes