CLI Reference
graphmemory <command> [options]
serve — start the server
Primary mode. Starts HTTP server with MCP endpoints, REST API, web UI, and WebSocket.
# Zero-config: use current directory as project
graphmemory serve
# With config file
graphmemory serve --config graph-memory.yaml
# Force re-index from scratch
graphmemory serve --reindex
| Option | Default | Description |
|---|---|---|
--config | graph-memory.yaml | Config file path (optional) |
--host | 127.0.0.1 | Bind address |
--port | 3000 | Port |
--reindex | false | Discard saved graphs, re-index everything |
--log-level | info | Log level: fatal/error/warn/info/debug/trace |
Environment variables
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL | info | Log level threshold (also settable via --log-level) |
LOG_JSON | 0 | Set to 1 for JSON log output (recommended for Docker/production) |
What happens on startup
- Reads config, creates project manager
- Loads embedding models for all projects (blocking)
- Indexes all projects (blocking)
- Starts HTTP server (MCP + REST + Web UI + WebSocket)
Models and indexing complete before the server starts listening.
Endpoints
| Path | Description |
|---|---|
/ | Web UI |
/mcp/{projectId} | MCP endpoint for AI clients |
/api/* | REST API |
/api/ws | WebSocket |
index — one-shot indexing
Indexes a project and exits. Useful for CI/CD or pre-warming.
# Zero-config
graphmemory index
# Specific project
graphmemory index --config graph-memory.yaml --project my-app
# Force re-index
graphmemory index --config graph-memory.yaml --reindex
| Option | Default | Description |
|---|---|---|
--config | graph-memory.yaml | Config file path |
--project | all | Specific project ID to index |
--reindex | false | Discard saved graphs |
users add — add a user
Interactive command to create a user in the config file.
graphmemory users add --config graph-memory.yaml
Prompts for:
- User ID — alphanumeric identifier (e.g.
alice) - Name — display name
- Email — for UI login
- Password — hashed with scrypt
Generates an API key (mgm-...) and writes the user to your config file.
--reindex flag
Both serve and index support --reindex:
- Discards persisted graph JSON files
- Re-indexes all files from scratch
Automatic re-index
Graph Memory automatically detects model changes and data version upgrades. If either differs from what's stored, graphs are re-indexed without needing --reindex.