Live LabsComing soon10 min

Add Memory to an Agent with Cognee

Chat history is not memory. Cognee turns what the agent reads into a graph it can search later, so the next answer builds on the last one.

Out on Sunday 15 November10 minutes, one build start to finish

Get it in your inbox the day it is out

One email when the recording is live, then the newsletter. Unsubscribe in one click.

We email you each new issue. You can leave at any time. Privacy

Why this matters

Chat history is not memory. An agent that only sees the current conversation repeats questions and forgets decisions. Turning what it reads into a knowledge graph lets the next session find and build on what the last one learned.

What you build

An agent that remembers what it learned in earlier conversations.

  1. Add documents and earlier conversations to Cognee.
  2. Turn them into a knowledge graph.
  3. Search the graph from the agent before it answers.
  4. Start a new session and see the earlier answer used.

The ideas behind it

  • Memory versus history

    History is the last messages; memory is what the agent can find later, from any session.

  • A knowledge graph

    Facts and the links between them, extracted from documents and conversations.

  • Search before answering

    The agent looks up memory first, then answers with it in the prompt.

Before you start

You need
Python and an LLM API key.
Length
About 10 minutes, one build start to finish.

Questions

How is this different from a vector database?

A vector search finds similar passages. A graph also keeps how facts relate, which helps with questions that span several documents.

Where is the memory stored?

In stores you run. Cognee can use several graph and vector backends.

What should an agent forget?

Anything personal or outdated. Decide what to keep before you store everything.

Is the recorded lab free?

Yes. Watch it any time, follow the steps and keep the code you build.

How is it different from a Live Lab?

A recorded lab is one short build you follow on your own. A Live Lab builds a bigger part of the system in an hour, with time for your questions.

Then take it further

This build is one piece. The Live Lab Build an AI Second Brain with Claude Code goes from here to a working part of a real system.

Capture into one brain
Claude Code files, tags and links what you add as you work.
Answer with sources
Every answer cites the note or issue it came from.
Share the memory
Serve the brain over MCP so any agent can read from it.

The parts of a production agent system that lab builds, lit on the map:

Week 1Architect
  • Roles and modelsOne job per agent, a model chosen for that job, and a token budget.
  • OrchestrationA queue agents pick work from, with hand-offs a person can follow.
  • Context and memoryRetrieval with sources, memory across sessions, prompts laid out for the cache.
  • Tool callingTyped tools that act in GitHub, Linear and Google.
Week 2Build
  • MCP serversEvery tool behind an MCP gateway, scoped to the role that needs it.
  • Durable executionRuns that resume after a crash and never repeat a write.
  • Human in the loopA person approves anything that cannot be undone.
Week 3Secure and deploy
  • Identity and permissionsEach agent signs in as itself and acts on behalf of a user.
  • LLM gatewayRouting, caching and a budget on every model call.
  • Traces, evals and costEvery run traced, scored and charged to the agent that made it.
  • Multi-tenancyEach team or customer kept apart, in data and in the bill.
Week 4Govern and extend
  • Policy as codeRules checked on every action, not written in a document.
  • Signed skillsNew roles built from reviewed, signed skills.