Cognee

RAG & Memory 💻 Python ⚖️ Apache-2.0 🟢 Actively maintained
30.5k stars

Cognee is an open-source AI memory platform that gives AI agents persistent long-term memory across sessions. It ingests data in any format, builds a self-hosted knowledge graph, and enables agents to recall, connect, and act with full context. It is for developers building AI agents that need reliable, evolving memory.

Cognee - Knowledge Engine for AI Agent Memory

🎬 Cognee - Knowledge Engine for AI Agent Memory · cognee

Cognee demo
🎞️ Demo from the project README

✨ Key features

  • Unified ingestion from various data sources
  • Self-hosted knowledge graph with vector and graph search
  • Persistent memory with session and graph layers
  • Procedural memory via SKILL.md playbooks
  • Agentic user/tenant isolation and traceability
  • Runs locally with optional Docker deployment

🎯 Use cases

  • Build a company brain by unifying data for agents
  • Customer support agents that resolve issues using historical context
  • Expert knowledge distillation for junior analysts
  • Give Claude Code persistent memory across sessions
  • Create agents that learn from feedback and improve over time

📦 Installation

🧰 Requirements: Python 3.10 to 3.14, an LLM API key (e.g., OpenAI), and optionally Docker for UI/MCP server.

uv pip install cognee

Alternatively, use pip:

pip install cognee

🚀 Usage

import cognee
import asyncio

async def main():
    # Store permanently in the knowledge graph
    await cognee.remember("Cognee turns documents into AI memory.")

    # Query with auto-routing
    results = await cognee.recall("What does Cognee do?")
    for result in results:
        print(result)

    # Delete when done
    await cognee.forget(dataset="main_dataset")

if __name__ == '__main__':
    asyncio.run(main())

❓ FAQ

What are the prerequisites for using Cognee?

You need Python 3.10 to 3.14 and an LLM API key (e.g., OpenAI). For the UI or MCP server, Docker is required.

How do I configure the LLM?

Set the LLM_API_KEY environment variable or create a .env file based on the template. You can also integrate other LLM providers as per documentation.

Can I use Cognee with Claude Code?

Yes, there is a plugin for Claude Code that gives it persistent memory. Install it from the marketplace and set the required environment variables.

Does Cognee support Docker deployment?

Yes, you can use Docker Compose to build from source or pull prebuilt images for the API server, MCP server, and UI.

📊 Repository

Stars★ 30,491
Forks🍴 2,998
Open issues🐛 474
Last commit🕒 Sep 4, 2026
Created📅 Aug 2023
Language💻 Python
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.