topoteretes/cognee
Graph and vector retrieval for persistent agent memory across sessions
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Cognee is a Python memory layer that builds and queries indexes rather than just exposing a database API. Text ingestion produces entities, relationships, and searchable chunks; code ingestion maps symbols and dependencies. remember writes to durable memory or to a session when given a session ID. improve applies feedback and can promote curated session knowledge into the graph, while recall selects context through automatic routing or an explicit search strategy.
The package targets Python 3.10–3.14 and declares openai, pydantic, and python-dotenv as dependencies. Python, REST, CLI, and MCP provide distinct integration surfaces; plugins connect existing agent clients, while custom data models and ontologies shape extraction around application-specific entities. The tree separates cognee/, cognee-mcp/, cognee-connectors/, and cognee-integrations/.
Key Capabilities & Differentiators
The local text path uses GLiNER for extraction and a local embedding model for indexing. Without a generative LLM, Cognee can ingest text, store sessions, and return matching source passages; LLM-dependent improvement stages skip automatically. Configure a local or hosted model for generated answers, and configure the relevant vision or transcription model for media that requires it. Ollama is a documented local option. forget supports item- or dataset-level removal, and COGX can import memory from Mem0, Letta, Zep, and Graphiti.
The BEAM results are 0.79 at 100K tokens and 0.67 at 10M tokens. The 100K run used fixed hybrid retrieval over 20 questions from one held-out conversation across four rounds. The 10M run averaged five rounds and selected and scored question-type routing on the same question set. Different conversations, ingestion models, and retrieval procedures make these unsuitable as a scaling curve; the distributed 10M ingestion still has a reproduction gap.
Trade-offs & Limitations
Compared with a vector-only RAG stack, Cognee is a better fit when queries need relationships across sources, code dependencies, or lessons from earlier agent sessions. The cost is extra extraction and indexing work, plus a second source of retrieval error: a missed entity or incorrect edge can weaken graph retrieval even when the original passage was indexed. The bundled GLiNER extractor is a demo with limited label coverage relative to the production offering, so test it on domain terminology before committing to it.
CPU inference avoids sending text to a hosted model in the local path, but moves model preparation, throughput planning, and capacity costs onto your infrastructure. The single-PostgreSQL setup can colocate relational metadata, PGVector embeddings, and graph state for a demo. Do not plan a production rollout around that consolidation without licensing the production graph implementation or qualifying another supported backend. The repository's Apache-2.0 license does not cover the separately licensed implementation.
Hardware & Deployment Guide
For a local Python pilot, install cognee[gliner] on Python 3.10–3.14 and allow the extraction and embedding models to download on first use. The Docker image includes the GLiNER runtime, not the downloaded models. The prebuilt Compose setup is the shortest path to a persistent API demo. From a source checkout, configure .env from .env.template and run docker compose --profile ui --profile mcp up; the defaults are API 8000, UI 3000, and MCP 8001.
For shared deployments, retain authentication rather than using the local-only ENABLE_BACKEND_ACCESS_CONTROL=false setting, and configure persistent storage and compatible backends. The source Compose file mounts /cognee-storage/system and /cognee-storage/data; if you change BACKGROUND_DRAIN_TIMEOUT_SECONDS, adjust the container stop grace period to leave time for engine close and WAL checkpointing. Provision CPU, RAM, and disk against measured ingestion and query concurrency. v1.6.10 tightened PostgreSQL pooling; v1.6.11 focused on retrieval and ingestion and added a Granola connector.
remember, recall, improve, and forget cover ingestion, retrieval, session curation, and targeted deletion.cognee[gliner] supports CPU-based extraction and local embeddings without an LLM key; models download on first use.Teams building persistent agent memory or an internal knowledge system where document relationships, code dependencies, and lessons from prior sessions need to be retrieved together.
Passage similarity is sufficient, you cannot maintain extraction and indexing pipelines, or you require a production all-in-one PostgreSQL graph stack under Apache-2.0 alone.
Quick Start & Installation
uv pip install "cognee[gliner]"
Comparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| cognee ★ | 33.8k | +174 | Python | Apache-2.0 | Graph and vector retrieval for persistent agent memory across sessions |
| hindsight | 64.7k | +884 | Python | MIT | A bank-based memory service that turns agent interactions into durable knowledge |
| Memori | 17.9k | +337 | Python | — | An SDK-based agent memory layer for persistent state across sessions. |
| OpenViking | 43.2k | +255 | Python | AGPL-3.0 | A directory-scoped RAG database for inspectable agent knowledge and memory |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/topoteretes/cognee.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about cognee
How should I connect an existing agent to Cognee?
remember to write content and recall to query selected datasets. If you supply a session ID, the write goes into session memory; use improve to curate useful session knowledge into durable memory.Does Cognee require a GPU, and what should I measure to size it?
Can we self-host Cognee commercially under Apache-2.0?
When should I choose Cognee over a vector-only RAG stack or another agent memory layer?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy