Skip to main content

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
OptionDefaultDescription
--configgraph-memory.yamlConfig file path (optional)
--host127.0.0.1Bind address
--port3000Port
--reindexfalseDiscard saved graphs, re-index everything
--log-levelinfoLog level: fatal/error/warn/info/debug/trace

Environment variables

VariableDefaultDescription
LOG_LEVELinfoLog level threshold (also settable via --log-level)
LOG_JSON0Set to 1 for JSON log output (recommended for Docker/production)

What happens on startup

  1. Reads config, creates project manager
  2. Loads embedding models for all projects (blocking)
  3. Indexes all projects (blocking)
  4. Starts HTTP server (MCP + REST + Web UI + WebSocket)

Models and indexing complete before the server starts listening.

Endpoints

PathDescription
/Web UI
/mcp/{projectId}MCP endpoint for AI clients
/api/*REST API
/api/wsWebSocket

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
OptionDefaultDescription
--configgraph-memory.yamlConfig file path
--projectallSpecific project ID to index
--reindexfalseDiscard 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:

  1. User ID — alphanumeric identifier (e.g. alice)
  2. Name — display name
  3. Email — for UI login
  4. 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.