Reference
Configuration reference
Core-engine environment variables, greatmemory.toml keys, operational flags, and feature toggles.
Engine configuration reference
This page configures gm-server, the Meivo memory framework. The built-in
enterprise gateway and control panel are separate services with their own
GM_INGEST_* settings. In particular, a model provider configured in the
control panel does not silently replace the engine's fact-extraction/reflection
configuration.
Precedence
Configuration is layered in this order:
command flags > GM_* environment variables > greatmemory.toml > defaults
gm-server serveaccepts host, port, data-directory, config, and feature flags.gm-server mcpaccepts data-directory and config flags.greatmemory.tomlis read from the current directory when present.--config <path>selects an explicit file, which must exist.- Unknown TOML keys and invalid values fail startup.
Booleans accept 1/0, true/false, yes/no, and on/off
case-insensitively.
Runtime and storage
| Variable | Default | Purpose |
|---|---|---|
GM_HOST | 127.0.0.1 | HTTP bind host |
GM_PORT | 7437 | HTTP bind port |
GM_DATA_DIR | ./.greatmemory | SQLite data and local model-cache directory |
GM_DB | <data-dir>/greatmemory.db | Main store: SQLite path, :memory:, or a postgres:///postgresql:// URL for Postgres + pgvector |
GM_DB_ASSUME_PGVECTOR | false | Postgres only: skip extension creation when a DBA already provisioned pgvector |
GM_DB_POOL_SIZE | 10 | Postgres connection-pool maximum |
GM_HNSW_MAX_SCAN_TUPLES | unset | Postgres/pgvector session value for filtered HNSW scans |
GM_CORS_ORIGINS | local origins | Comma-separated exact browser origins; setting it replaces the localhost policy |
GM_API_KEYS | unset | Comma-separated direct-engine bearer keys; entries can be named as service-name:secret |
GM_ALLOW_INSECURE | false | Explicitly allow a non-loopback bind without an API key; unsafe for production and available only as an environment override |
The main document/vector store is SQLite or Postgres with pgvector. MySQL is not a main-store option.
Engine audit delivery
| Variable | Default | Purpose |
|---|---|---|
GM_AUDIT_SCOPE | all | all audits mutations plus search/context reads; mutations-only skips read events |
GM_AUDIT_MODE | integrated | integrated delivers to the enterprise gateway; standalone writes audit events to local logs |
GM_INGEST_AUDIT_URL | unset | Gateway endpoint for integrated audit batches |
GM_INGEST_INTERNAL_TOKEN | unset | Shared token sent to the integrated audit endpoint |
In integrated mode, mutations are recorded through a durable outbox and
reconciled to the gateway. Read events use a bounded asynchronous queue and can
be dropped under sustained overload. Monitor audit_backlog_count,
audit_backlog_oldest_age_secs, and audit_read_tier_dropped_count from
GET /v1/stats.
For a local engine without the gateway:
GM_AUDIT_MODE=standalone gm-server serve
For the packaged path, set both the URL and the shared token from a secret manager.
Embeddings, extraction, and reflection
| Variable | Default | Purpose |
|---|---|---|
GM_EMBEDDER | fastembed | fastembed, ollama, or openai (fake is test-only) |
GM_EMBEDDER_URL | provider default | Base URL for an HTTP embedder |
GM_EMBEDDER_API_KEY | unset | Bearer key for an OpenAI-compatible embedder |
GM_EMBEDDER_MODEL | unset | Required model name for Ollama/OpenAI-compatible embeddings |
GM_EMBEDDER_DIM | unset | Required output dimension for Ollama/OpenAI-compatible embeddings |
GM_LLM | none | Fact/reflection LLM: none, ollama, or openai |
GM_LLM_URL | provider default | Base URL for the LLM endpoint |
GM_LLM_API_KEY | unset | Bearer key for an OpenAI-compatible LLM |
GM_LLM_MODEL | unset | Model name for fact extraction and reflection |
openai means an endpoint that implements the expected OpenAI-compatible
/chat/completions or /embeddings contract. Compatibility, authentication,
model names, quotas, and data handling still depend on the selected provider.
Local Ollama example:
GM_EMBEDDER=ollama \
GM_EMBEDDER_URL=http://127.0.0.1:11434 \
GM_EMBEDDER_MODEL=nomic-embed-text \
GM_EMBEDDER_DIM=768 \
GM_LLM=ollama \
GM_LLM_URL=http://127.0.0.1:11434 \
GM_LLM_MODEL=llama3 \
GM_AUDIT_MODE=standalone \
gm-server serve
OpenAI-compatible example:
GM_EMBEDDER=openai \
GM_EMBEDDER_URL=https://approved-provider.example/v1 \
GM_EMBEDDER_API_KEY="$EMBEDDING_API_KEY" \
GM_EMBEDDER_MODEL=approved-embedding-model \
GM_EMBEDDER_DIM=1536 \
GM_LLM=openai \
GM_LLM_URL=https://approved-provider.example/v1 \
GM_LLM_API_KEY="$LLM_API_KEY" \
GM_LLM_MODEL=approved-chat-model \
gm-server serve
The returned embedding length must exactly match GM_EMBEDDER_DIM. Changing the
model or dimension requires a controlled re-embedding/migration plan; existing
vectors do not become compatible automatically.
Provider-specific deployment notes:
Retrieval, graph, and memory features
| Variable | Default | Purpose |
|---|---|---|
GM_RERANK | none | none, noop, or the built-in lexical reranker |
GM_GRAPH_EXPAND_HOPS | 0 | Number of graph-expansion hops during retrieval |
GM_GRAPH_BACKEND | store | Reuse the main store, or use a separate SQLite, Postgres, or MySQL graph backend |
GM_CARDS_SEMANTIC_LINKING | false | Link newly created cards by embedding similarity instead of keyword/tag overlap |
GM_REFLECTION | true | Create a document summary card when an LLM is configured |
GM_USEFULNESS | true | Apply stored usefulness feedback as a retrieval prior |
GM_TRUST | true | Apply content-aware trust gating before graph promotion |
The three higher-level features also have command flags:
| Feature | Enable flag | Disable flag |
|---|---|---|
| Reflection | --enable-reflection | --disable-reflection |
| Usefulness weighting | --enable-usefulness | --disable-usefulness |
| Trust gating | --enable-trust | --disable-trust |
gm-server serve \
--disable-reflection \
--disable-usefulness \
--disable-trust
- Reflection is enabled by default but does nothing with
GM_LLM=none. - Usefulness changes ranking only after an application submits used chunk ids
to
POST /v1/feedback. - Trust gating uses provenance and known pattern checks. It is not a complete malicious-content detector.
- Graph expansion is off by default. Start with one hop and evaluate precision.
- MySQL is supported only as a separate graph backend.
Complete greatmemory.toml example
All keys are optional:
host = "127.0.0.1"
port = 7437
data_dir = "./.greatmemory"
# db = "postgres://gm:password@localhost:5432/greatmemory"
db_assume_pgvector = false
db_pool_size = 10
# hnsw_max_scan_tuples = 60000
cors_origins = ["http://localhost:3000"]
api_keys = ["internal-agent:replace-with-a-secret"]
audit_scope = "all" # all | mutations-only
audit_mode = "standalone" # integrated | standalone
# ingest_audit_url = "http://gm-ingest-svc:8080/v1/audit/engine-events"
# ingest_internal_token = "replace-with-a-secret"
graph_expand_hops = 0
[embedder]
kind = "fastembed" # fastembed | ollama | openai
# base_url = "http://127.0.0.1:11434"
# api_key = "replace-with-a-secret"
# model = "nomic-embed-text"
# dim = 768
[llm]
kind = "none" # none | ollama | openai
# base_url = "http://127.0.0.1:11434"
# api_key = "replace-with-a-secret"
# model = "llama3"
[rerank]
kind = "none" # none | noop | lexical
[graph]
backend = "store" # store | sqlite path | postgres URL | mysql URL
[cards]
semantic_linking = false
[features]
reflection = true
usefulness = true
trust = true
Direct-engine auth versus enterprise identity
GM_API_KEYS protects the direct engine with shared bearer secrets. Any valid
engine key can address every space; spaces are not authorisation boundaries.
The built-in enterprise gateway is the user-facing path for local/LDAP identity,
roles, and ACL-derived retrieval filters.
When exposing gm-server beyond loopback:
- set named API keys and store them in the customer's secret manager;
- terminate TLS at a trusted reverse proxy or load balancer;
- restrict network paths so users cannot bypass the enterprise gateway;
- set exact CORS origins;
- monitor audit backlog/drop counters;
- rotate keys by overlapping old and new values during a restart.