What is Cognee?
Agents without memory re-learn your world every session. Cognee is the maintained open-source answer (Apache-2.0, 17k+ stars, releases this month): ingest documents and conversations, "cognify" them into a knowledge graph plus vector index, and query the result as long-term memory over a clean API.
The engineering taste shows in the defaults: SQLite, LanceDB, and Kuzu all run in-process - one container, one volume, no sidecar fleet. Every layer has a scale-out path via env (Postgres, the catalogue’s qdrant, Neo4j) when you genuinely need it.
It is API-first (Swagger at /docs; the upstream UI is a separate work-in-progress) and slots into the catalogue’s agent lane: route extraction through the litellm gateway, and give agent-box or OpenClaw agents a memory that survives them.
What you get
- Knowledge graph + vector memory from documents and chats
- Self-contained defaults: SQLite + LanceDB + Kuzu in-process
- Real auth (JWT users + API keys) - register, token, go
- OpenAI-compatible gateway support (litellm plugs in)
- Scale-out env paths: Postgres, Qdrant, Neo4j per layer
- Apache-2.0, very actively maintained
How it runs on Lyngbak
| Service | Role | Public |
|---|---|---|
cognee | memory API + Swagger at /docs (:5000) | yes (JWT auth) |
Before you deploy
LLM_API_KEYfact extraction + embeddings (billed to you; litellm virtual keys work)
FASTAPI_USERS_JWT_SECREToverrides an insecure default
Sizing and billing
Cognify jobs are the memory consumers (graph building in-process) - 2 GiB is the floor, heavy corpora want more. Upstream caps its own compose at 8 GiB.
A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 9.77 GiB of volumes cost $0.15 per GiB a month ($1.47/mo) for as long as they exist. One workspace can use both. See pricing
Run it locally first
The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.
Questions
Cognee or Mem0 for agent memory?
Mem0 is the bigger name, but its published self-host images are stale (the current server has no amd64 image - we verified before choosing). Cognee ships current images, runs self-contained, and adds the knowledge-graph layer plain vector memory lacks. When Mem0 publishes proper images, it earns a template too.
How do agents use it?
Over the REST API: add content, trigger cognify, then search with graph-aware retrieval - returning facts and relationships, not just similar chunks. Register a user, mint a token, and any agent in the project calls http://cognee:5000.
What do the LLM calls cost?
Cognify extracts entities and relations via your LLM and embeds via your embedding model - that is the real cost, scaling with ingested volume. Route through the litellm template to cap it with a budgeted virtual key, and consider the tei template for the embedding leg.