# Repository Briefing: topoteretes/cognee
> Source: https://repoforai.com/repo/topoteretes/cognee (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/topoteretes/cognee
- **Official Docs / Website**: https://www.cognee.ai
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (98/100 · Maintenance 35/35 · Adoption 23/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v1.6.11 (2026-11-26) — https://github.com/topoteretes/cognee/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted, Local AI, MCP, CLI, API
- **Momentum**: 33,829 ★ total (+13 24h / +174 7d) · 3,597 forks
- **Topics**: `ai`, `cognitive-architecture`, `vector-database`, `ai-agents`, `graph-database`, `ai-memory`, `cognitive-memory`, `knowledge`, `knowledge-graph`, `graph-rag`, `contributions-welcome`, `good-first-issue`
- **When to Use**: Best for: 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. Skip if: 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.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Memory lifecycle: `remember`, `recall`, `improve`, and `forget` cover ingestion, retrieval, session curation, and targeted deletion.
- Retrieval routing: Choose a search strategy explicitly or let Cognee route among graph, vector, and code context.
- Local runtime: `cognee[gliner]` supports CPU-based extraction and local embeddings without an LLM key; models download on first use.
- Integration: Python, REST, CLI, and MCP expose memory to applications and agent clients; COGX supports imports from four named memory platforms.
- Storage boundary: PostgreSQL can hold metadata, PGVector embeddings, and graph state in the demo; the production graph implementation is separately licensed.
- Container operations: Compose separates system and data volumes and sets a 15-second shutdown grace period against a default 8-second background drain plus engine close and WAL checkpoint work.
```

## Quick Start / Clone
```bash
uv pip install "cognee[gliner]"
```
