topoteretes/cognee

Cognee is the open-source AI memory platform for agents. Give your AI agents persistent long-term memory with small models for free

Cognee – Open‑source AI memory platform

What it is – Cognee is a Python‑based library (with a CLI, REST API, UI and SDKs for several languages) that lets you turn text, code, documents, tickets, etc. into a knowledge graph that an AI agent can query later. It provides persistent, searchable “long‑term memory” for agents, so they can recall facts or lessons from previous runs without re‑reading the original sources.

Key capabilities

  • Ingestion – cognee.remember extracts entities and relations from raw text (using a tiny local GLiNER model) or from code, stores them as graph nodes, and creates vector embeddings for similarity search.
  • Retrieval – cognee.recall finds relevant chunks, graph sub‑structures or code symbols and can either return the raw source or, if an LLM key is supplied, generate a natural‑language answer.
  • Improvement / feedback – cognee.improve lets you add annotations or corrections that are merged back into the graph, turning session‑specific knowledge into permanent memory.
  • Forget – cognee.forget removes items or whole datasets.
  • LLM‑optional – All core steps work with free local models; an OpenAI (or Ollama, etc.) key can be added later to get answer generation and vision/transcription support.
  • Multi‑language SDKs – Python API, TypeScript package, Rust crate, and a REST endpoint, plus ready‑made plugins for Claude Code, Codex, OpenClaw, etc.
  • Deployability – Run locally via pip/uv, Docker Compose (API + UI + MCP server), or a single‑Postgres stack that combines graph, vector, and relational storage.

Typical use‑cases

  • Building a Company Brain: ingest internal docs, tickets, code, and conversation logs so both humans and agents can query the collective knowledge.
  • Giving autonomous agents memory across sessions, so they can reuse learned rules or past decisions.
  • Grounding agents in a domain‑specific ontology by defining custom entity types and relationships.

How to get started

  1. Install the package (e.g. uv pip install "cognee[gliner]").
  2. Run the quick‑start script or CLI commands to remember a sentence and recall a question – no API key needed.
  3. Optionally set LLM_API_KEY to enable generated answers.
  4. Explore the bundled demo (cognee-cli demo) or launch the UI (cognee-cli -ui).

Ecosystem – The main repo hosts the core engine; a separate cognee‑integrations repo contains plugins for Claude Code, Codex, OpenClaw, and other “memory client protocols” (MCP). Community adapters are listed under cognee‑community.

Research backing – The project is accompanied by a 2025 arXiv paper on linking knowledge graphs with LLMs for complex reasoning, and a BEAM benchmark showing high scores (0.79 for 100 K‑token contexts).

License & community – MIT‑style open source, with a Discord, Reddit community, and contribution guide.


All details are taken directly from the repository’s README.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Project