Server and dashboard
Run Memnest for several clients, with scoped keys and a dashboard to review memory.
Run Memnest as a service when several clients, services or people share one memory, or when you want the dashboard to review what agents believe.
With Docker
- Start Postgres + pgvector and the server
git clone https://github.com/anidoesdev/MemNest.git && cd MemNest docker compose up -d # API and dashboard on http://localhost:8787 - Create an API key (printed once; only its hash is stored)
docker compose exec server memnest keys create --name admin docker compose exec server memnest keys create --name acme-bot --container customer:acme # scoped - Open the dashboard at
http://localhost:8787and sign in with the key. A scoped key opens its container directly.
Model providers are read from your shell or an .env file next to docker-compose.yml. For Ollama on the host, set MEMNEST_BASE_URL=http://host.docker.internal:11434.
Without Docker
npm install -g @memnest/cli
export MEMNEST_DATABASE_URL=postgres://memnest:memnest@localhost:5432/memnest # or omit for SQLite
memnest migrate
memnest keys create --name admin
memnest serve --port 8787To serve the dashboard too, build the repository and pass --dashboard apps/dashboard/dist (or set MEMNEST_DASHBOARD_DIR).
The extraction worker
memnest serve also runs the worker when a completion provider is configured. MEMNEST_WORKER controls it: auto (default), on (fail if no model), off (run memnest worker elsewhere).
Run one extraction worker per container shard for now. Job claims are safe across workers, but session grouping is not yet locked, so two workers holding jobs for different versions of the same session could both extract it.
The dashboard
Five views over one container, for a person rather than a model:
- Graph
- Every memory on a canvas. Colour is kind, size is reinforcement; superseded memories are faded, forgotten ones hollow. Arrows are
updates, dashed linesextends. Above 2,000 matching memories it groups them into topic clusters; clicking one, or filtering, expands it. It stays responsive at 10,000. - Lineage
- One memory: what it replaced, what extends it, and the documents it came from, as a layered graph.
- Retrieval trace
- Run a query with a budget and see every candidate: ranks, fused score, tokens, included or why not, with the budget line drawn across the list.
- Timeline
- A topic's facts over time, each change dated, so you can see when a belief switched.
- Detail
- Content, kind, confidence, validity, version history, sources with their text, and Forget with confirmation. Nothing can be edited: a wrong memory is forgotten, not rewritten.
The dashboard signs in by exchanging an API key for an HttpOnly, SameSite=Strict session cookie; revoking the key ends its sessions. It is served from the API's own origin, and there is no CORS, so it cannot be hosted elsewhere.
Postgres notes
- Everything lives in its own schema (
memnest, orMEMNEST_PG_SCHEMA), migrated under an advisory lock. - Full text is a generated
tsvectorcolumn with a GIN index; vectors use pgvector with a partial HNSW index per embedding dimension, so one database can host containers embedded by different providers. - Jobs are claimed with
FOR UPDATE SKIP LOCKED, so workers can share one database.
Upgrading
Run memnest migrate after upgrading. Migrations are additive and run under a lock, so it is safe to run on start.