Try the Cognee API server with a single copy-pasteable file — no cloning, no
building. It uses the prebuilt cognee/cognee
image with the default local databases (SQLite, LanceDB, Ladybug), so the only
thing you need to provide is an LLM API key.
- Docker with the Compose plugin (Docker Desktop, Colima, or any OCI-compatible runtime — see Docker & Colima Setup)
- An OpenAI API key (the default LLM and embedding provider)
services:
cognee:
image: cognee/cognee:main
ports:
- "8000:8000"
environment:
LLM_API_KEY: ${LLM_API_KEY:?set LLM_API_KEY to your OpenAI API key}
# Single-user try-out: no auth, shared local databases.
# Remove this line (or set it to true) for multi-tenant mode,
# which requires authentication on every API call.
ENABLE_BACKEND_ACCESS_CONTROL: "false"export LLM_API_KEY="sk-..." # your OpenAI API key
docker compose upcurl http://localhost:8000/healthThen open http://localhost:8000/docs for the interactive API reference and send your first requests:
# Ingest a text file
echo "Cognee turns documents into AI memory." > note.txt
curl -X POST http://localhost:8000/api/v1/add \
-F "data=@note.txt" \
-F "datasetName=main_dataset"
# Build the knowledge graph
curl -X POST http://localhost:8000/api/v1/cognify \
-H "Content-Type: application/json" \
-d '{"datasets": ["main_dataset"]}'
# Search it
curl -X POST http://localhost:8000/api/v1/search \
-H "Content-Type: application/json" \
-d '{"searchType": "GRAPH_COMPLETION", "query": "What does Cognee do?", "datasets": ["main_dataset"]}'The minimal file above stores everything inside the container, so removing the container removes your data. To persist it, point Cognee's data directories at a named volume:
services:
cognee:
image: cognee/cognee:main
ports:
- "8000:8000"
environment:
LLM_API_KEY: ${LLM_API_KEY:?set LLM_API_KEY to your OpenAI API key}
ENABLE_BACKEND_ACCESS_CONTROL: "false"
DATA_ROOT_DIRECTORY: /cognee-data/data
SYSTEM_ROOT_DIRECTORY: /cognee-data/system
volumes:
- cognee_data:/cognee-data
volumes:
cognee_data:- Other LLM providers (Anthropic, Gemini, Ollama, …): add the matching
LLM_PROVIDER/LLM_MODEL/LLM_ENDPOINTvariables — see.env.templatefor the full list. - UI, MCP server, Postgres, Neo4j: the repository's
docker-compose.ymlprovides these as opt-in profiles — see Run with Docker in the README. - Production: multi-tenant mode (
ENABLE_BACKEND_ACCESS_CONTROL=true, the default) requires authentication and isolates data per user and dataset. Review the security variables in.env.templatebefore exposing the API.