Quickstart: Docker Compose
The stack has five services: Postgres with pgvector, Redis, a one-shot
migrate job, the server and a local Ollama. No image is published, so
Compose builds the server and the migrate job from the repository.
You need Docker with about 8 GB of memory and 12 GB of free disk. The first run builds the images and downloads about 3 GB of models: allow 5 to 15 minutes. No cloud API key is needed.
Clone and start the stack
git clone https://github.com/lucasmailland/mnemosyne
cd mnemosyne/docker
cp .env.example .env
echo "MNEMO_DASHBOARD_SECRET=$(openssl rand -hex 32)" >> .env
docker compose up -dThe secret lets the web dashboard sign in. Without it the server still runs, with the dashboard sign-in turned off.
Pull the two Ollama models
The local stack runs the embeddings and the LLM on the bundled Ollama, and Ollama only serves models that have been pulled into its volume.
docker exec mnemosyne-ollama ollama pull bge-m3
docker exec mnemosyne-ollama ollama pull qwen2.5:3bbge-m3 produces the embeddings and qwen2.5:3b handles completions, such as
extracting facts when a session is collapsed.
Wait until the server is ready
curl http://localhost:3939/health/ready{
"status": "ready",
"degraded": false,
"checks": { "postgres": "ok", "vector": "ok", "cache": "ok", "embed": "ok" }
}Wait until every check is ok, embed included, before the first recall. To
follow the boot, run docker compose logs -f server.
Mint an API key
The first key comes from the terminal, because every HTTP route that could create one is itself authenticated. The key is printed once, so copy it.
docker compose exec server node scripts/create-api-key.cjs --label "my laptop"The script generates a new workspace for the key. --workspace is optional
and must be a UUID when you pass it.
Remember something
Writes go to POST /remember and the field is statement.
curl -X POST http://localhost:3939/remember \
-H "Authorization: Bearer mns_live_..." \
-H "Content-Type: application/json" \
-d '{"statement": "Acme prefers communication in Spanish."}'The response carries the id of the new memory, its workspaceId and the
statement as it was stored.
Recall it
curl -X POST http://localhost:3939/recall \
-H "Authorization: Bearer mns_live_..." \
-H "Content-Type: application/json" \
-d '{"query": "what language should we use with Acme?", "topK": 5}'The recall finds the memory by meaning, with no words in common, and returns it with its validity and its sensitivity:
{
"hits": [
{
"kind": "fact",
"content": "Acme prefers communication in Spanish.",
"score": 0.74,
"validFrom": "2026-11-19T00:24:12.810Z",
"validTo": null,
"sensitivity": "internal",
"status": "active"
}
],
"nothingRelevant": false
}Check the workspace
curl http://localhost:3939/health \
-H "Authorization: Bearer mns_live_..."GET /health is authenticated and scoped to the key’s workspace. It returns
factsLive, factsClosed, pinnedCount, lastRecallAt, lastWriteAt and
the count of indexed and pending embeddings.
The local stack is for trying Mnemosyne out. It connects to Postgres as the
database owner, which bypasses row-level security, so workspaces are not
isolated from each other here. The production overlay provisions a
restricted role and turns the isolation on. See
docker/README.md.
What just happened
- Compose started Postgres with the pgvector extension and Redis.
- The
migratejob applied the schema and exited. The server only starts after it finishes successfully. - The server came up on port
3939, using the bundled Ollama for embeddings and completions. - Your statement was stored as a
fact. ItsvalidToisnull, so it stays current until something supersedes it or you forget it. - The recall gathered candidates from vector search and full-text search. HyDE and the LLM rerank are opt-in.
Connect your agents
One command detects Claude Code, Cursor, Codex, Gemini CLI, OpenCode and Windsurf on the machine and registers the MCP server in each one it finds:
npx -y @mnemo-ai/cli installCommon operations
docker compose logs -f server # tail the server logs
docker compose run --rm migrate # re-run migrations
docker compose down # stop everything, keep the data
docker compose down -v # stop and delete the dataIf ports 5432 or 6379 are taken on your machine, set POSTGRES_PORT or
REDIS_PORT in .env.
Where to go next
- Concepts: read Bitemporal model and Cognitive primitives before you build on top.
- MCP: see the MCP tools your agents get.
- Operations: learn how to back up and monitor before you put it in production.