Skip to main content

Configuration

Graphmind is configured through three layers (later layers override earlier ones):

  1. Config file (TOML) -- defaults to graphmind.toml in the working directory
  2. CLI flags -- override config file values
  3. Environment variables -- override everything

Config File

Create a graphmind.toml:

[server]
host = "127.0.0.1" # Bind address
resp_port = 6379 # RESP protocol port
http_port = 8080 # HTTP API and Visualizer port
data_dir = "./graphmind_data" # RocksDB data directory

[logging]
level = "info" # debug, info, warn, error

[auth]
enabled = false # Enable token-based authentication
tokens = [ # Allowed bearer tokens
"my-secret-token-1",
"my-secret-token-2",
]

Specify a config file path:

graphmind --config /etc/graphmind/graphmind.toml

If the file does not exist, Graphmind starts with defaults (no error).

CLI Flags

FlagConfig keyDefaultDescription
--config <path>--graphmind.tomlConfig file path
--host <addr>server.host127.0.0.1Bind address
--port <port>server.resp_port6379RESP server port
--http-port <port>server.http_port8080HTTP server port
--data-dir <path>server.data_dir./graphmind_dataData directory
--log-level <level>logging.levelinfoLog level
--demo <mode>--(none)Load demo data on startup

Environment Variables

VariableConfig keyDescription
GRAPHMIND_HOSTserver.hostBind address
GRAPHMIND_PORTserver.resp_portRESP port
GRAPHMIND_HTTP_PORTserver.http_portHTTP port
GRAPHMIND_DATA_DIRserver.data_dirData directory
GRAPHMIND_AUTH_TOKENauth.tokensSingle auth token (enables auth)
RUST_LOGlogging.levelLog level filter

NLQ Provider Variables

These enable natural language query translation. Set one:

VariableProviderDefault Model
OPENAI_API_KEYOpenAIgpt-4o-mini (override with OPENAI_MODEL)
GEMINI_API_KEYGoogle Geminigemini-2.0-flash (override with GEMINI_MODEL)
CLAUDE_CODE_NLQ=1Claude Code CLIUses local Claude Code

Example Configurations

Development

[server]
host = "127.0.0.1"
resp_port = 6379
http_port = 8080

[logging]
level = "debug"

Production (Single Node)

[server]
host = "0.0.0.0"
resp_port = 6379
http_port = 8080
data_dir = "/var/lib/graphmind/data"

[logging]
level = "info"

[auth]
enabled = true
tokens = ["prod-token-abc123"]

Docker / Kubernetes

When running in a container, use environment variables instead of a config file:

GRAPHMIND_HOST=0.0.0.0
GRAPHMIND_PORT=6379
GRAPHMIND_HTTP_PORT=8080
GRAPHMIND_DATA_DIR=/data
GRAPHMIND_AUTH_TOKEN=prod-token-abc123
RUST_LOG=info

Precedence

If the same setting is specified in multiple places, the order is:

Environment variable > CLI flag > Config file > Default

For example, if the config file says resp_port = 6379, the CLI flag --port 7379 overrides it, and GRAPHMIND_PORT=8379 overrides both.