DockerSelf-HostingAIAI Coding Agents
Cognee with Docker and Ollama: local graph memory for AI apps (Linux, Windows, Mac)
Before you start
- 22 min read
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
Cognee is a free, open-source (Apache-2.0) memory layer for AI apps: you give it text, documents or code, it builds a knowledge graph plus a vector index, and your app asks questions against that memory later. This guide runs all of it on your own machine with Ollama.
Logo: the official Cognee project (github.com/topoteretes/cognee)
A plain vector search finds similar passages. Cognee also extracts entities and the links between them, so a question can follow a connection ("which decision led to this fix?"). Use it for notes, documentation, code or an agent's memory. The project is alive: not archived, not renamed, latest release October 2026. Only its embedded graph engine changed name, from Kuzu to Ladybug.
| What | Value (official docs and releases, read November 2026) |
|---|---|
| Current version | Cognee v1.6.6, released October 2026 (GitHub release, PyPI, Docker Hub) |
| Licence | Apache-2.0 (LICENSE at the release tag). Some production add-ons are a paid product |
| Image to pin | cognee/cognee:1.6.6 (checked on Docker Hub; amd64 and arm64) |
| Python | 3.10 to 3.14 (on Windows use 3.11 or newer) |
| Time needed | About 45 minutes for both routes, mostly model downloads (our estimate, not measured) |
| Size | Ollama lists 4.9 GB for llama3.1:8b and 274 MB for nomic-embed-text; the image is about 0.9 GB compressed. The project publishes no RAM figure for Cognee itself |
| Ports | Ollama 11434; Cognee API 8000 (the repository compose file also offers UI 3000 and MCP 8001) |
| Official docs | docs.cognee.ai and the repository |
At a glance:
- What it is: a Python library and an optional Docker API with four operations:
remember,recall,improve,forget. - Default providers: OpenAI for both the language model and the embeddings. Nothing is local until you change both.
- Ollama works: set the LLM and the embedder to Ollama together. If you set only one, the other stays on OpenAI.
- Stores it needs: none to install. The defaults are files on disk: SQLite, LanceDB (vectors) and Ladybug (graph).
- Telemetry: anonymous usage events are on by default. One setting turns them off.
Pick a route:
| Route | Best for | Steps |
|---|---|---|
| A. Python library + Ollama | Learning, scripts, one app | 1 to 4 |
| B. Docker API + Ollama | A service other apps and agents call over HTTP | 1, then 5 |
How it fits together#
Your text reaches Cognee, which asks an Ollama language model for entities and links and an Ollama embedding model for vectors, then saves both as files.
Drawn for this guide from the official Cognee docs. The dashed OpenAI box is the default when you do not switch both models.
Before you start#
You need Ollama for the models, Python for route A, and Docker for route B.
| System | What to use |
|---|---|
| Linux | x86_64 or arm64, Python 3.10+ with venv, Docker Engine with Compose |
| Windows | Windows 10 or 11, Python 3.11+ (the docs say 3.10 can break the graph store), Docker Desktop |
| Mac | macOS with Python 3.10+ and Docker Desktop (Apple silicon is covered by the arm64 image) |
| GPU | Optional. The docs call roughly 6 GB of VRAM the rough need for an 8B model at 4-bit; without it the model runs on CPU, much slower |
Check the tools on Linux and Mac:
python3 --version && docker --version && docker compose version && ollama --version
On Windows, in PowerShell, use python --version instead of python3. Install Ollama with our Ollama guide.
Checklist:
- [ ] Ollama installed and running (
ollama --version) - [ ] Python 3.10 to 3.14 (Windows: 3.11 or newer)
- [ ] For route B: Docker with Compose, port 8000 free
- [ ] About 6 GB of free disk
- [ ] For the HTTPS section only: a domain with a DNS record, and ports 80 and 443 free
Tested by DIY Lab Hub: not yet. Every command comes from the official docs and release files read in November 2026. We did not run them, and the docs publish no sample output, so this page shows none.
Step 1: Pull the two Ollama models#
Cognee never downloads models for you. It needs one language model and one embedding model.
Linux#
ollama pull llama3.1:8b ollama pull nomic-embed-text:latest
Windows (PowerShell)#
ollama pull llama3.1:8b ollama pull nomic-embed-text:latest
Mac (Terminal)#
Same commands as Linux.
Check it worked. The list shows both models (use curl.exe on Windows):
curl http://localhost:11434/api/tags
Tip:
llama3.1:8bis the docs' recommended model. Cognee extracts the graph with many short structured-output calls, and small or unvalidated models often return empty or broken graphs (see Common mistakes).
Step 2: Install Cognee in a virtual environment#
A virtual environment keeps Cognee's many packages away from your system Python. The ollama extra adds Ollama support.
Linux#
mkdir -p ~/cognee-local && cd ~/cognee-local python3 -m venv .venv source .venv/bin/activate pip install "cognee[ollama]"
Windows (PowerShell)#
New-Item -ItemType Directory -Force "$HOME\cognee-local" | Out-Null Set-Location "$HOME\cognee-local" python -m venv .venv .\.venv\Scripts\Activate.ps1 pip install "cognee[ollama]"
If PowerShell blocks the activation script, run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser once (from the official install page), then activate again.
Mac (Terminal)#
Same commands as Linux.
Check it worked. The printed path must point inside the .venv folder:
python -c "import cognee; print(cognee.__file__)"
Tip: Open a new terminal? Activate the environment again. On Windows the error
ModuleNotFoundError: No module named 'cognee'almost always means the wrong Python is running.
Step 3: Point Cognee at Ollama#
Cognee reads a .env file from the folder you run it in. This one switches the language model and the embedder to Ollama, spells out the local file stores, and turns telemetry off. It holds no secret: LLM_API_KEY is a placeholder, because Cognee insists on a non-empty value and Ollama ignores it.
Linux#
cd ~/cognee-local cat > .env << 'EOF' LLM_PROVIDER="ollama" LLM_MODEL="llama3.1:8b" LLM_ENDPOINT="http://localhost:11434" LLM_API_KEY="ollama" EMBEDDING_PROVIDER="ollama" EMBEDDING_MODEL="nomic-embed-text:latest" EMBEDDING_ENDPOINT="http://localhost:11434/api/embed" EMBEDDING_DIMENSIONS="768" HUGGINGFACE_TOKENIZER="nomic-ai/nomic-embed-text-v1.5" DB_PROVIDER="sqlite" VECTOR_DB_PROVIDER="lancedb" GRAPH_DATABASE_PROVIDER="ladybug" SYSTEM_ROOT_DIRECTORY="~/cognee-local/memory/system" DATA_ROOT_DIRECTORY="~/cognee-local/memory/data" TELEMETRY_DISABLED=true EOF chmod 600 .env
Windows (PowerShell)#
Write the file without a byte-order mark, which some dotenv readers choke on:
Set-Location "$HOME\cognee-local" $envText = @' LLM_PROVIDER="ollama" LLM_MODEL="llama3.1:8b" LLM_ENDPOINT="http://localhost:11434" LLM_API_KEY="ollama" EMBEDDING_PROVIDER="ollama" EMBEDDING_MODEL="nomic-embed-text:latest" EMBEDDING_ENDPOINT="http://localhost:11434/api/embed" EMBEDDING_DIMENSIONS="768" HUGGINGFACE_TOKENIZER="nomic-ai/nomic-embed-text-v1.5" DB_PROVIDER="sqlite" VECTOR_DB_PROVIDER="lancedb" GRAPH_DATABASE_PROVIDER="ladybug" SYSTEM_ROOT_DIRECTORY="~/cognee-local/memory/system" DATA_ROOT_DIRECTORY="~/cognee-local/memory/data" TELEMETRY_DISABLED=true '@ [System.IO.File]::WriteAllText((Join-Path (Get-Location).Path ".env"), $envText)
The docs say a ~ prefix works on every system. If your setup rejects it, write absolute paths with forward slashes, such as C:/Users/<you>/cognee-local/memory/system.
Mac (Terminal)#
Same commands as Linux.
Check it worked. The official doctor command compares your settings and reports a mismatch before you ingest anything:
cognee-cli doctor
Tip: The LLM endpoint is the bare host with no path; the embedding endpoint keeps
/api/embed. Adding/v1to the LLM endpoint is the classic mistake (see below).
Step 4: Remember something and ask about it#
remember builds the graph and the vectors; recall asks a question. The first run downloads the Hugging Face tokenizer and can look stuck for minutes. Keep the text short: an 8B model on CPU is slow.
Save this as quickstart.py in cognee-local (it follows the official local Ollama example):
import asyncio
import cognee
from cognee.modules.search.types import SearchType
TEXT = """\
Cognee is an open-source library that helps developers turn documents into AI memory.
It builds semantic graphs, indexes entities, and stores vectors to enable structured retrieval.
Cognee supports local execution via Ollama as well as hosted cloud providers.
"""
async def main():
await cognee.remember(TEXT, dataset_name="local_demo", self_improvement=False)
results = await cognee.recall(
query_text="What does Cognee help developers do?",
query_type=SearchType.GRAPH_COMPLETION,
datasets=["local_demo"],
)
print(results[0].text if results else "<no results>")
if __name__ == "__main__":
asyncio.run(main())
Linux#
cd ~/cognee-local && source .venv/bin/activate python quickstart.py ls memory/system/databases
Windows (PowerShell)#
Set-Location "$HOME\cognee-local" .\.venv\Scripts\Activate.ps1 python quickstart.py Get-ChildItem .\memory\system\databases
Mac (Terminal)#
Same commands as Linux.
Check it worked. The script prints a sentence written by your local model, and the databases folder holds cognee_db, cognee.lancedb and cognee_graph_ladybug (file names from the docs). The command line does the same without Python code:
cognee-cli remember "Marie Curie was born in Warsaw." -d local_demo cognee-cli recall "Where was Marie Curie born?" -d local_demo
Tip: If you ran Cognee with its OpenAI defaults before switching, call
cognee.prune.prune_system(metadata=True)once before the nextremember. The docs warn that old vector collections keep the previous embedding size.
Step 5: Run the Cognee API in Docker (route B)#
The image runs the HTTP API on port 8000 so other apps and agents can call it. This file pins the image, keeps all memory in ~/docker_volumes/cognee/storage, and publishes the port on 127.0.0.1 only. ENABLE_BACKEND_ACCESS_CONTROL: "false" is the docs' single-user switch and turns off the API login: never use it on a server others can reach.
Ollama runs on the host, so inside the container localhost is the wrong address: the file uses host.docker.internal, which Docker Desktop provides and Linux gets from the host-gateway line.
services:
cognee:
image: cognee/cognee:1.6.6
container_name: cognee
restart: unless-stopped
ports:
- "127.0.0.1:8000:8000"
environment:
ENABLE_BACKEND_ACCESS_CONTROL: "false"
TELEMETRY_DISABLED: "true"
LLM_PROVIDER: "ollama"
LLM_MODEL: "llama3.1:8b"
LLM_ENDPOINT: "http://host.docker.internal:11434"
LLM_API_KEY: "ollama"
EMBEDDING_PROVIDER: "ollama"
EMBEDDING_MODEL: "nomic-embed-text:latest"
EMBEDDING_ENDPOINT: "http://host.docker.internal:11434/api/embed"
EMBEDDING_DIMENSIONS: "768"
HUGGINGFACE_TOKENIZER: "nomic-ai/nomic-embed-text-v1.5"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./storage:/cognee-storage
Linux#
The container runs as user 1000, so a host folder must belong to uid 1000 (the docs' fix for PermissionError). Ollama must also listen beyond 127.0.0.1 so the container can reach it; the Ollama FAQ sets this with systemd:
mkdir -p ~/docker_volumes/cognee/{storage,backups}
sudo chown -R 1000:1000 ~/docker_volumes/cognee/storage
sudo systemctl edit ollama.service
In the editor add these two lines, save, then restart Ollama:
[Service] Environment="OLLAMA_HOST=0.0.0.0:11434"
sudo systemctl daemon-reload && sudo systemctl restart ollama cd ~/docker_volumes/cognee # save the compose file above here as docker-compose.yml, then: docker compose up -d docker compose ps
Ollama has no login. Keep port 11434 closed to the internet and, if you can, to your LAN.
Windows (PowerShell)#
New-Item -ItemType Directory -Force "$HOME\docker_volumes\cognee\storage", "$HOME\docker_volumes\cognee\backups" | Out-Null Set-Location "$HOME\docker_volumes\cognee" # save the compose file above here as docker-compose.yml, then: docker compose up -d docker compose ps
The docs describe the chown fix for Linux only. If you see PermissionError on Windows or Mac, switch the volume line to the named volume the docs use, cognee_storage:/cognee-storage, and add volumes: { cognee_storage: {} } at the bottom of the file.
Mac (Terminal)#
mkdir -p ~/docker_volumes/cognee/{storage,backups}
cd ~/docker_volumes/cognee
# save the compose file above here as docker-compose.yml, then:
docker compose up -d
docker compose ps
Check it worked. The image has a built-in health check (/health every 30 seconds, 40-second start period), so docker compose ps shows healthy after a minute. Then test the whole path. On Linux and Mac:
curl -f http://localhost:8000/health printf "Cognee turns data into searchable AI memory." > cognee-smoke.txt curl -X POST http://localhost:8000/api/v1/remember -F "[email protected]" -F "datasetName=smoke_test" -F "run_in_background=false" curl -X POST http://localhost:8000/api/v1/recall -H "Content-Type: application/json" -d '{"query": "What does Cognee do?", "datasets": ["smoke_test"], "search_type": "GRAPH_COMPLETION", "top_k": 5}'
On Windows, curl.exe sends the file and Invoke-RestMethod handles the JSON quotes:
curl.exe -f http://localhost:8000/health Set-Content -Path cognee-smoke.txt -Value "Cognee turns data into searchable AI memory." curl.exe -X POST http://localhost:8000/api/v1/remember -F "[email protected]" -F "datasetName=smoke_test" -F "run_in_background=false" Invoke-RestMethod -Method Post -Uri http://localhost:8000/api/v1/recall -ContentType "application/json" -Body '{"query": "What does Cognee do?", "datasets": ["smoke_test"], "search_type": "GRAPH_COMPLETION", "top_k": 5}'
The API docs open at http://localhost:8000/docs. /health only proves the server is alive; the recall answer proves Ollama, the graph and the vectors work together.
Tip: Route A and route B do not share memory. The library keeps its files in
~/cognee-local/memory; the container keeps its own in~/docker_volumes/cognee/storage.
Put it behind HTTPS (with or without Traefik)#
Skip this section if Cognee stays on one computer. If other people or other machines will call the API, put HTTPS in front and turn the login on: the single-user switch from Step 5 has no authentication at all, and the project excludes ENABLE_BACKEND_ACCESS_CONTROL=false on a network-exposed server from its security scope. Both routes need a domain with a DNS record pointing at the server.
First create two secrets. The password is for the default account; the JWT secret signs login tokens (names from the docs' production settings). Avoid a $ in the password, because Compose reads $ in .env files as a variable.
Linux#
cd ~/docker_volumes/cognee umask 077 printf 'COGNEE_ADMIN_PASSWORD=%s\nCOGNEE_JWT_SECRET=%s\n' "<choose-a-long-password>" "$(openssl rand -hex 32)" > .env
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\cognee"
$b = New-Object byte[] 32
[System.Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($b)
$jwt = ($b | ForEach-Object { $_.ToString("x2") }) -join ""
[System.IO.File]::WriteAllText((Join-Path (Get-Location).Path ".env"), "COGNEE_ADMIN_PASSWORD=<choose-a-long-password>`nCOGNEE_JWT_SECRET=$jwt`n")
Mac (Terminal)#
Same commands as Linux.
Compose reads that .env for the ${...} values below. The file is not mounted into the container.
With Traefik#
On a server that already runs Traefik v3 with the Docker provider, replace the Step 5 file with this one. It assumes an external network called proxy and an entrypoint called https; use your own names. Create the network once with docker network create proxy.
services:
cognee:
image: cognee/cognee:1.6.6
container_name: cognee
restart: unless-stopped
environment:
DEFAULT_USER_PASSWORD: ${COGNEE_ADMIN_PASSWORD:?set it in .env}
FASTAPI_USERS_JWT_SECRET: ${COGNEE_JWT_SECRET:?set it in .env}
JWT_LIFETIME_SECONDS: "3600"
AUTH_TOKEN_COOKIE_SECURE: "true"
ACCEPT_LOCAL_FILE_PATH: "False"
TELEMETRY_DISABLED: "true"
LLM_PROVIDER: "ollama"
LLM_MODEL: "llama3.1:8b"
LLM_ENDPOINT: "http://host.docker.internal:11434"
LLM_API_KEY: "ollama"
EMBEDDING_PROVIDER: "ollama"
EMBEDDING_MODEL: "nomic-embed-text:latest"
EMBEDDING_ENDPOINT: "http://host.docker.internal:11434/api/embed"
EMBEDDING_DIMENSIONS: "768"
HUGGINGFACE_TOKENIZER: "nomic-ai/nomic-embed-text-v1.5"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./storage:/cognee-storage
networks:
- proxy
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.cognee.rule=Host(`cognee.<your-domain>`)"
- "traefik.http.routers.cognee.entrypoints=https"
- "traefik.http.routers.cognee.tls=true"
- "traefik.http.services.cognee.loadbalancer.server.port=8000"
networks:
proxy:
external: true
Start it with docker compose up -d in ~/docker_volumes/cognee (PowerShell: the same command in $HOME\docker_volumes\cognee).
Without Traefik: Caddy#
Choose this if you have no Traefik. Caddy gets and renews its own certificates. Caddy's docs describe automatic Let's Encrypt certificates for a public domain and tls internal for a local certificate at home. Use the same Cognee file as above, but delete the labels: block (Caddy needs none).
Create the Caddy folders. Following the Caddy Docker docs, we mount the whole conf folder, never a single Caddyfile:
mkdir -p ~/docker_volumes/caddy/{conf,data,config}
cd ~/docker_volumes/caddy
On Windows, create the same folders under $HOME\docker_volumes\caddy. Save this as ~/docker_volumes/caddy/docker-compose.yml. The image is caddy:2.11.8, the latest Caddy release read in November 2026:
services:
caddy:
image: caddy:2.11.8
container_name: caddy
restart: unless-stopped
ports:
- "80:80/tcp"
- "443:443/tcp"
- "443:443/udp"
volumes:
- ./conf:/etc/caddy
- ./data:/data
- ./config:/config
networks:
- proxy
networks:
proxy:
external: true
Save this as ~/docker_volumes/caddy/conf/Caddyfile for a public domain:
cognee.example.com {
reverse_proxy cognee:8000
}
For a home-only name, use tls internal instead:
cognee.home.arpa {
tls internal
reverse_proxy cognee:8000
}
Start both stacks:
cd ~/docker_volumes/caddy && docker compose up -d cd ~/docker_volumes/cognee && docker compose up -d
For a home-only certificate, Caddy's docs say that in a container you install the root certificate on each device yourself. Locate it first:
docker exec caddy find /data -name root.crt docker cp caddy:<path-from-find> ./caddy-root.crt
Install caddy-root.crt as a trusted root on each device. These OS steps are not from the Cognee or Caddy docs: on Windows use "Trusted Root Certification Authorities", on macOS Keychain Access with "Always Trust", on Linux your distribution's CA store. Docker Desktop on Windows and Mac can run these files for a home-only name; Let's Encrypt needs a public server.
Check it worked. Without a token the API must refuse you, and with one it must answer. The login user is the docs' default account:
curl -I https://cognee.example.com/health TOKEN="$(curl -s -X POST https://cognee.example.com/api/v1/auth/login -H 'Content-Type: application/x-www-form-urlencoded' -d '[email protected]&password=<your-password>' | jq -r .access_token)" curl -H "Authorization: Bearer $TOKEN" https://cognee.example.com/api/v1/datasets
On Windows:
$r = Invoke-RestMethod -Method Post -Uri https://cognee.example.com/api/v1/auth/login -Body @{ username = "[email protected]"; password = "<your-password>" }
Invoke-RestMethod -Uri https://cognee.example.com/api/v1/datasets -Headers @{ Authorization = "Bearer $($r.access_token)" }
Tip: A
401with "Authentication required" is not a fault: it is the default posture. A certificate error usually means the name in the Caddyfile differs from the DNS record.
Security and testing#
Three defaults matter most.
| Control | How |
|---|---|
| Login | The default API posture requires authentication. ENABLE_BACKEND_ACCESS_CONTROL=false removes it: local use only |
| Port | 127.0.0.1:8000 in Step 5. Behind a proxy, publish no host port |
| Secrets | .env with chmod 600, never in a shared folder or a screenshot. The Ollama route needs none |
| Ollama | No login. Do not expose port 11434 to the internet |
| Production settings | The docs list JWT_LIFETIME_SECONDS, AUTH_TOKEN_COOKIE_SECURE and ACCEPT_LOCAL_FILE_PATH=False; the HTTPS file sets all three. ALLOW_CYPHER_QUERY stays off by default |
| Telemetry | On by default. It sends operation names, settings (including provider and model names), random IDs and a hash of LLM_API_KEY, never document, query or answer text. TELEMETRY_DISABLED=true turns it off, but a hosted LLM still receives your text |
Quick tests on Linux:
cd ~/docker_volumes/cognee
docker compose ps
docker compose logs --tail=100 cognee
docker inspect --format '{{.State.Health.Status}}' cognee
Windows and Mac run the same commands in PowerShell or Terminal.
Where the memory lives and which stores you can swap#
By default Cognee needs no database server. Three embedded stores write files under the system folder (<SYSTEM_ROOT_DIRECTORY>/databases/), and the raw files you ingest go under the data folder.
| Role | Default | Other choices (official docs) |
|---|---|---|
| Metadata | SQLite | Postgres (cognee[postgres]) |
| Vectors | LanceDB | PGVector, Turso, ChromaDB; Qdrant, Redis and FalkorDB as community adapters |
| Graph | Ladybug (formerly Kuzu) | Neo4j (recommended for production), Neo4j Aura, Neptune; Postgres as a graph is a demo only |
The docs say Ladybug has one writer, one machine, no replication and 32 GB default size ceilings: fine for local use, not for a busy team. For a bigger setup move the graph to Neo4j (pip install "cognee[neo4j]", GRAPH_DATABASE_PROVIDER="neo4j", GRAPH_DATABASE_URL="bolt://localhost:7687"). Neo4j Community edition limits multi-user mode, so read the docs' table first.
To use Qdrant instead of LanceDB, install the community adapter and register it before any Cognee call. Start Qdrant as in our Qdrant guide, then:
pip install cognee-community-vector-adapter-qdrant
from cognee_community_vector_adapter_qdrant import register # noqa: F401 (run this before using cognee)
VECTOR_DB_PROVIDER="qdrant" VECTOR_DB_URL="http://localhost:6333"
Without the registration line, Cognee stops with Unsupported vector database provider: qdrant. The registration lives in your Python process, so this route fits route A; the docs do not show a hook for it in the stock Docker image.
Cognee or Mem0? Mem0 keeps short facts about a user ("vegetarian", "prefers dark mode"). Cognee builds a graph from documents, code and conversations and links the entities. The Cognee README also lists an import path from Mem0, Letta, Zep and Graphiti memory.
Give your coding agent the memory#
Cognee has a Claude Code plugin, a Codex plugin and an MCP server (cognee/cognee-mcp, with remember, recall and forget tools). For Claude Code the README gives two commands:
claude plugin marketplace add topoteretes/cognee-integrations claude plugin install cognee-memory@cognee
We did not test the plugin. Its setup page explains local or remote memory.
Common mistakes#
These come from the docs' own warnings, the issue tracker and common AI assistant answers.
| Mistake | Why it happens | Do this instead |
|---|---|---|
| Switching only the LLM to Ollama | The embedder keeps its OpenAI default. remember() stops with ProviderConfigMismatchError, or fails later on a missing key | Set the LLM_* and the EMBEDDING_* variables together |
/v1 on LLM_ENDPOINT | The default backend adds /api/generate itself, so Ollama sees /v1/api/generate and returns 404 | Use the bare host http://localhost:11434. Keep /api/embed on the embedding endpoint |
localhost in the Docker file | Inside a container, localhost is the container itself | Use host.docker.internal (plus the host-gateway line on Linux) |
Leaving LLM_API_KEY empty | Cognee wants a non-empty value for Ollama and raises LLMAPIKeyNotSetError before it contacts Ollama | Use any placeholder, by convention ollama |
Copying .env.template unchanged | Issue #5875 (closed): the template ships LLM_API_KEY="your_api_key", so keyless mode is off and the first call fails with a 401 | Delete or replace that line, or use the .env from Step 3 |
| A small or unvalidated model | Extraction needs valid structured output. The docs flag mistral, phi3, phi3.5 and qwen2.5 below 14B. A hackathon task (#3647, closed) records a user who gave up on qwen2.5 and mistral | Use llama3.1, llama3.2, llama3.3 or qwen2.5:14b and larger |
| Default Ollama context window | Cognee builds large chunks (issue #3436, closed). Ollama may cut the prompt and return malformed output or an HTTP 500 | Build a tag with num_ctx 8192 from a Modelfile, or lower LLM_MAX_COMPLETION_TOKENS |
| Changing the embedding model later | Stored vectors keep the old size, so recall errors or comes back empty (issues #3547 closed, #6092 open) | Delete the dataset and ingest again (the error's own advice). If delete is blocked, prune after a backup: pruning clears what Cognee stored |
| A host folder with the wrong owner | The container runs as uid 1000 and cannot write to a folder you own | sudo chown -R 1000:1000 ~/docker_volumes/cognee/storage on Linux |
| Copying the data folders while Cognee runs | SQLite, LanceDB and Ladybug write to those files directly | Stop with docker compose down, copy, start again |
AI assistants: writing LLM_API_BASE, a /v1 endpoint, or the old add, cognify, search calls | Assistants copy older tutorials. A docs request (issue #6239) even asks for LLM_API_BASE and localhost:11434/v1. Current docs use LLM_ENDPOINT without /v1, and remember and recall | Check every variable against the official Ollama section and this guide |
| AI assistants: saying "local means nothing leaves the machine" | Telemetry is on by default and a hosted model still gets your text | Set TELEMETRY_DISABLED=true and use Ollama for both models |
Tip: After any
.envchange, runcognee-cli doctorbefore you ingest. It catches half-local setups in seconds, not after a long extraction.
Tip: Keep the first test text to three sentences. If the graph comes back empty, change the model before anything else.
Tip:
cognee-cli doctor --probecalls Ollama for real. Run it when you cannot tell whether the network or the config is at fault.
Troubleshooting#
| Problem | Solution |
|---|---|
LLMAPIKeyNotSetError: LLM API key is not set | Set LLM_API_KEY="ollama" (any non-empty text) |
ProviderConfigMismatchError | Configure the embedder too, as in Step 3 |
404 Not Found ... /v1/api/generate | Remove /v1 from LLM_ENDPOINT |
You have set some but not all of the required environment variables for LLM usage | With Ollama, set LLM_MODEL, LLM_ENDPOINT and LLM_API_KEY all together |
| Connection refused to Ollama | Check curl http://localhost:11434/api/tags on the host. In Docker use host.docker.internal. On Linux set OLLAMA_HOST=0.0.0.0:11434 |
| Timeouts under load | Ollama handles requests one at a time. Set EMBEDDING_BATCH_SIZE="5" (default 32) |
| HTTP 500 while the model answers fine in a terminal | Context window too small: see the num_ctx Modelfile below |
ModuleNotFoundError: No module named 'cognee' | Activate the .venv in this terminal |
RuntimeError: Could not find lbug C API shared library. | Windows with Python 3.10. Use Python 3.11 or newer in a fresh .venv |
PermissionError: [Errno 13] Permission denied: '/cognee-storage/data/...' | sudo chown -R 1000:1000 the host folder, or use a named volume |
Every /api/v1 call returns 401 | The default posture needs a login. Use DEFAULT_USER_PASSWORD (HTTPS section) or, locally only, ENABLE_BACKEND_ACCESS_CONTROL=false |
The exact docs text for a context-window fix is a Modelfile with two lines, then a new tag:
FROM llama3.1:8b PARAMETER num_ctx 8192
ollama create llama3.1:8b-8k -f Modelfile
Then set LLM_MODEL="llama3.1:8b-8k". A larger num_ctx needs more memory.
Known bugs (open, November 2026)#
- Issue #6170: with Ladybug 0.19.0 the graph store crashed at about 1,650 documents in one macOS report and left a damaged write-ahead log. Keep a backup and test your real data size.
- Issue #5736: upgrading a 1.4.x graph to 1.6.x failed to open it, and
/healthstayed at 503. Back up first and read the release notes. - Issues #4313 and #4364: LanceDB reports
Spill has sent an errorduringcognifyfor some embedding sizes. - Issue #6092: after you change the embedding model, the safety check also blocks
forget()on the old dataset.
Run docker compose ps, docker compose logs --tail=200 cognee and docker inspect cognee first.
Updates and backups#
Update. Read the release notes, then change the tag. In Docker:
cd ~/docker_volumes/cognee docker compose pull docker compose up -d docker compose logs --tail=100 cognee
For route A run pip install --upgrade "cognee[ollama]" inside the .venv. Back up before every update. The project releases often, and its docs say security fixes ship only in the latest release.
Back up. One copy holds both the system and the data folders, as the docs ask. Stop the container first, so nothing writes during the copy:
cd ~/docker_volumes/cognee docker compose down tar -czf "backups/cognee-$(date +%F).tar.gz" storage chmod 600 backups/cognee-*.tar.gz docker compose up -d
Nightly at 03:00 on Linux or Mac, with crontab -e (a crontab needs \%F):
0 3 * * * cd $HOME/docker_volumes/cognee && docker compose down && tar -czf "backups/cognee-$(date +\%F).tar.gz" storage && docker compose up -d
If your user is not uid 1000, the tar may need sudo to read the files. On Windows save these lines as backup.ps1, then register it once with Task Scheduler:
Set-Location "$HOME\docker_volumes\cognee" docker compose down Compress-Archive -Path .\storage -DestinationPath ".\backups\cognee-$(Get-Date -Format yyyy-MM-dd).zip" docker compose up -d
schtasks /Create /SC DAILY /ST 03:00 /TN "Cognee backup" /TR "powershell -NoProfile -File $HOME\docker_volumes\cognee\backup.ps1"
For route A copy both memory/system and memory/data the same way while no script is running.
Restore test. Unpack into a new empty folder, never over the live one, and look for the databases:
mkdir -p /tmp/restore-test && tar -xzf backups/cognee-<date>.tar.gz -C /tmp/restore-test ls /tmp/restore-test/storage/system/databases
On Windows: Expand-Archive .\backups\cognee-<date>.zip -DestinationPath $env:TEMP\restore-test.
Performance and resources#
The project publishes no RAM or CPU figures for Cognee. The heavy part is the language model, so measure your own machine.
- The model decides speed: extraction makes many short calls per document. The docs say an 8B model at 4-bit needs roughly 6 GB of free VRAM; a model that does not fit spills to system RAM and CPU and is much slower. With low VRAM pick a smaller model such as
llama3.2:3b(validated) and a smallerEMBEDDING_BATCH_SIZE. - Size: the image is about 0.9 GB compressed on Docker Hub; the Python wheel is about 19 MB.
- Live numbers:
docker stats cogneefor the container,ollama psfor the loaded models. - Graph limit: Ladybug is one writer on one machine. Plan Neo4j for large graphs.
FAQ#
Is Cognee free? Yes. The core is Apache-2.0. Running it with Ollama needs no account or paid key. Cognee Cloud is a separate managed product.
Is the project dead or renamed? No. Version 1.6.6 came out in October 2026. Only the embedded graph engine changed its name, from Kuzu to Ladybug; kuzu is still accepted in settings.
Do I need Neo4j or a vector database? No. The defaults are files on disk. Neo4j or Qdrant are options when you outgrow them.
Can it run without any LLM? Yes, in a limited way. With no LLM key set, Cognee extracts the graph with a small local model (GLiNER) and embeds locally. This guide uses Ollama, which gives generated answers.
Does it send my data anywhere? Only to the providers you configure, plus anonymous telemetry unless you turn it off. With Ollama and TELEMETRY_DISABLED=true, nothing leaves the machine except model and tokenizer downloads.
Sources#
- Cognee release v1.6.6, README, LICENSE, pyproject.toml and minimal Docker Compose guide - read November 2026
- Cognee docs: installation, local Ollama pipeline, local setup, LLM providers, embedding providers, setup overview, graph stores, vector stores, community adapters, Docker deployment, security and telemetry, MCP overview - read November 2026
- Cognee image on Docker Hub (tag
1.6.6checked) and cognee on PyPI - November 2026 - Ollama FAQ and the Ollama library (model sizes) - November 2026
- Caddy release v2.11.8 and the Caddy Docker image docs (conf folder, not a single file) - November 2026
- GitHub issues #3436, #3547, #3647, #4313, #4364, #5736, #5875, #6092, #6170, #6239 - read November 2026
Checked against the official docs on 2026-11-05.