Skip to main content

Configuration

Zero-config mode

No config file needed. Run graphmemory serve in your project directory — the current directory becomes the project with sensible defaults.

Config file

For multi-project setups, custom models, auth, or workspaces — create graph-memory.yaml:

projects:
my-app:
projectDir: "/path/to/my-app"

Only projects.<id>.projectDir is required. Everything else has sensible defaults.

Full reference

# Default author for notes/tasks/skills
author:
name: "Your Name"
email: "[email protected]"

# Users (for authentication)
users:
alice:
name: "Alice"
email: "[email protected]"
apiKey: "mgm-key-abc123"
passwordHash: "$scrypt$..." # generated by CLI

# Server settings
server:
host: "127.0.0.1"
port: 3000
defaultAccess: "rw" # deny | r | rw
jwtSecret: "your-secret" # required when users are defined
cookieSecure: true # explicit Secure flag for cookies (default: auto)
corsOrigins: ["http://localhost:5173"]
accessTokenTtl: "15m"
refreshTokenTtl: "7d"
modelsDir: "~/.graph-memory/models"
model:
name: "Xenova/bge-m3"
dtype: "q8" # fp32, fp16, q8, q4
rateLimit:
global: 600 # requests/min
search: 120
auth: 10
redis:
enabled: true # must be true to activate Redis
url: "redis://localhost:6379" # Redis connection URL

# Projects
projects:
my-app:
projectDir: "/path/to/my-app"
graphs:
docs:
enabled: true
include: "**/*.md"
code:
enabled: true
include: "**/*.{js,ts,jsx,tsx,mjs,mts,cjs,cts}"
knowledge:
enabled: true
readonly: false # set true to block mutations
tasks:
enabled: true
files:
enabled: true
skills:
enabled: true

# Workspaces (optional)
workspaces:
backend:
projects: [api-gateway, catalog-service]
graphMemory: "./.workspace-backend"

Server settings

FieldDefaultDescription
host127.0.0.1Bind address
port3000Port
defaultAccessrwDefault access: deny, r, rw
jwtSecretRequired when users are defined
cookieSecureautoSet cookie Secure flag. Defaults to true unless NODE_ENV=development
modelsDir~/.graph-memory/modelsModel cache directory
sessionTimeout3600MCP session timeout (seconds)
corsOrigins* (all)Allowed CORS origins
accessTokenTtl15mJWT access token lifetime
refreshTokenTtl7dJWT refresh token lifetime
maxFileSize1048576Max file size for indexing (bytes)
excludeAdditional glob to exclude from indexing
redis.enabledfalseEnable Redis backend for session store and embedding cache
redis.urlRedis connection URL (redis:// or rediss:// for TLS)
redis.prefixmgm:Key prefix for all Redis keys
redis.embeddingCacheTtl30dTTL for cached embeddings in Redis

Model config

Set at server, project, or graph level. Resolution: graph → project → server → defaults (whole-object, first-defined-wins — no field-by-field merge).

The code graph has its own chain via codeModel: graphs.code.model → project.codeModel → server.codeModel → code defaults (defaults to jinaai/jina-embeddings-v2-base-code with mean pooling).

FieldDefaultDescription
nameXenova/bge-m3HuggingFace model ID
poolingclsmean or cls
normalizetrueL2-normalize vectors
dtypeq8Quantization: fp32, fp16, q8, q4

Embedding config

Set at server, project, or graph level. Resolution: graph → project → server → defaults (field-by-field merge — each field individually inherits up the chain, unlike model config).

FieldDefaultDescription
batchSize1Texts per forward pass
maxChars24000Max characters per node
cacheSize10000Embedding cache size (0 = disabled)
remoteRemote embedding API URL
remoteApiKeyAPI key for remote endpoint
remoteModelWhich model to request: "default" or "code" (auto for code graph)

Per-graph settings

Each graph (docs, code, knowledge, tasks, files, skills) supports:

FieldDefaultDescription
enabledtrueSet false to disable entirely
readonlyfalseLoaded and searchable, but mutations blocked
include(varies)Glob for file matching (docs/code only)
excludeAdditional exclude glob
model(inherited)Graph-specific model config
accessPer-user access overrides

Readonly mode

graphs:
knowledge:
readonly: true # loaded + searchable, mutations blocked
SettingGraph loaded?Read toolsMutation tools
enabled: falseNoHiddenHidden
enabled: trueYesVisibleVisible
readonly: trueYesVisibleHidden

readonly overrides per-user rw access. See Access Control for details.

Redis configuration

By default, Graph Memory uses in-memory storage for MCP HTTP sessions and the embedding cache. For production deployments or multi-instance setups, you can use Redis instead.

server:
redis:
enabled: true
url: "redis://localhost:6379"

When server.redis.enabled is true:

  • MCP session store — active MCP HTTP sessions are stored in Redis instead of memory. Sessions survive server restarts and are shared across instances.
  • Embedding cache — computed embeddings are cached in Redis. Vectors computed in one server instance are reused by others, and the cache persists across restarts.
FieldDefaultDescription
redis.enabledfalseEnable Redis backend
redis.urlRedis connection URL (redis:// or rediss:// for TLS)
redis.prefixmgm:Key prefix for all Redis keys
redis.embeddingCacheTtl30dTTL for cached embeddings in Redis

Set enabled: true and provide a url to activate Redis. Without enabled: true, in-memory stores are used regardless of the URL.

Applying changes

Restart the server to apply changes to graph-memory.yaml.