Skip to content

Configuration Reference

This page provides a complete reference for all environment variables and configuration options used in AutoMem. Configuration controls service connectivity, authentication, embedding generation, background processing, and search behavior.

For a quick-reference table grouped by category, see Environment Variables. For deployment-specific setup, see Docker & Local Dev or Railway Deployment.


AutoMem loads environment variables from multiple sources in a specific precedence order, allowing flexible configuration across different deployment scenarios.

Load order (highest to lowest priority):

  1. Process environment — Variables set via export or passed directly to the process
  2. Project .env — File in repository root
  3. User config~/.config/automem/.env (user-specific, never committed)

This hierarchy allows local overrides without modifying shared configuration files. For example, a developer can set FALKORDB_HOST=localhost in their user config while the project .env contains shared development defaults.

graph TB
    subgraph "Configuration Hierarchy"
        EnvFile[".env<br/>(Repository Root)"]
        HomeConfig["~/.config/automem/.env<br/>(User-specific)"]
        RailwaySecrets["Railway Secrets<br/>(Production)"]
    end

    AppPy["app.py"]
    ConsPy["consolidation.py"]
    Scripts["scripts/*.py"]

    EnvFile -->|"dotenv.load_dotenv()"| AppPy
    HomeConfig -->|"dotenv.load_dotenv()"| AppPy
    RailwaySecrets -->|"os.getenv()"| AppPy

    AppPy -->|"passes config"| ConsPy
    EnvFile -->|"directly read"| Scripts

Required configuration for connecting to data stores:

VariableTypeRequiredDefaultDescription
FALKORDB_HOSTstringYeslocalhostGraph database hostname
FALKORDB_PORTintYes6379Graph database port
FALKORDB_PASSWORDstringNounsetRedis/FalkorDB password if auth enabled
FALKORDB_GRAPHstringNomemoriesGraph database name (Cypher GRAPH.QUERY target)
GRAPH_NAMEstringNomemoriesAlias for FALKORDB_GRAPH
PORTintNo8001Flask API server port
graph TB
    subgraph external["External Clients"]
        Client["HTTP Client"]
    end

    subgraph railway["Railway Internal Network (IPv6)"]
        subgraph mcp["mcp-sse-server"]
            MCPServer["Node.js Server<br/>Binds to ::<br/>PORT from env"]
        end

        subgraph api["memory-service"]
            FlaskApp["Flask App<br/>app.py<br/>Binds to ::<br/>PORT from env"]
        end

        subgraph db["falkordb"]
            FalkorDB["FalkorDB<br/>Port 6379<br/>FALKOR_PASSWORD"]
        end
    end

    Client -->|"HTTPS<br/>Public Domain"| MCPServer
    Client -->|"HTTPS<br/>Public Domain"| FlaskApp

    MCPServer -->|"HTTP<br/>memory-service.railway.internal:8001"| FlaskApp
    FlaskApp -->|"Redis Protocol<br/>falkordb.railway.internal:6379"| FalkorDB

Qdrant configuration enables semantic search but is not required. AutoMem operates in graph-only mode if these are unset:

VariableTypeRequiredDefaultDescription
QDRANT_URLstringNounsetQdrant API endpoint (HTTP/HTTPS)
QDRANT_API_KEYstringNounsetQdrant authentication key (required for cloud)
QDRANT_COLLECTIONstringNomemoriesCollection name for memory vectors
COLLECTION_NAMEstringNomemoriesAlias for QDRANT_COLLECTION
VECTOR_SIZEintNo3072Embedding dimension (768/1024/2048/3072)

All endpoints except /health require authentication:

VariableTypeRequiredDefaultDescription
AUTOMEM_API_TOKENstringYesunsetAuthentication token for standard operations
ADMIN_API_TOKENstringYesunsetToken for admin endpoints (/admin/*, /enrichment/reprocess)
API_TOKENstringNounsetFallback alias for AUTOMEM_API_TOKEN
ADMIN_TOKENstringNounsetFallback alias for ADMIN_API_TOKEN

Controls embedding generation with automatic provider selection:

VariableTypeRequiredDefaultDescription
EMBEDDING_PROVIDERstringNoautoProvider selection mode (auto/voyage/openai/local/ollama/placeholder)
EMBEDDING_MODELstringNotext-embedding-3-largeOpenAI model name or identifier
VOYAGE_API_KEYstringNounsetVoyage AI API key
VOYAGE_MODELstringNovoyage-4Voyage model (voyage-4, voyage-4-large)
OPENAI_API_KEYstringNounsetOpenAI or compatible provider API key
OPENAI_BASE_URLstringNounsetCustom endpoint for OpenAI-compatible APIs (OpenRouter, LiteLLM, vLLM)
OLLAMA_BASE_URLstringNohttp://localhost:11434Ollama server endpoint
OLLAMA_MODELstringNonomic-embed-textOllama embedding model name

Provider characteristics:

ProviderQualityCostOfflineDimensionsAPI Key
VoyageExcellent$0.00012/1K tokensNo256/512/1024/2048Required
OpenAIExcellent$0.00002–$0.00013/1K tokensNo768/3072Required
OllamaGoodFreeYesModel-dependentNot required
FastEmbedGoodFreeYes (after download)384/768/1024Not required
PlaceholderNoneFreeYesConfigurableNot required

When EMBEDDING_PROVIDER=auto, the provider is selected by checking API key availability in order: Voyage, then OpenAI, then local/Ollama, then placeholder.

Controls batch processing to reduce API costs:

VariableTypeRequiredDefaultDescription
EMBEDDING_BATCH_SIZEintNo20Items per batch API call
EMBEDDING_BATCH_TIMEOUT_SECONDSfloatNo2.0Max wait time before flushing partial batch

Batching reduces API costs by 40–50% by combining multiple embedding requests into single API calls. The timeout ensures reasonable latency even when traffic is low.

Controls automatic background enrichment after memory storage:

VariableTypeRequiredDefaultDescription
ENRICHMENT_MAX_ATTEMPTSintNo3Retry limit before marking failed
ENRICHMENT_SIMILARITY_LIMITintNo5Number of semantic neighbors to link
ENRICHMENT_SIMILARITY_THRESHOLDfloatNo0.8Min cosine similarity for SIMILAR_TO edge
ENRICHMENT_IDLE_SLEEP_SECONDSintNo2Worker sleep duration when queue empty
ENRICHMENT_FAILURE_BACKOFF_SECONDSintNo5Delay between retry attempts
ENRICHMENT_ENABLE_SUMMARIESboolNotrueAuto-generate memory summaries
ENRICHMENT_SPACY_MODELstringNoen_core_web_smspaCy model for NER (if installed)

Entity tag generation:

Extracted entities become structured tags with the pattern entity:<type>:<slug>:

Entity TypeExample InputGenerated Tag
ToolPostgreSQLentity:tool:postgresql
Projectautomementity:project:automem
PersonSarahentity:person:sarah
OrganizationOpenAIentity:organization:openai
ConceptACID complianceentity:concept:acid-compliance

Controls background memory maintenance cycles:

VariableTypeRequiredDefaultDescription
CONSOLIDATION_TICK_SECONDSintNo60Scheduler check interval
CONSOLIDATION_DECAY_INTERVAL_SECONDSintNo86400Decay cycle frequency (1 day)
CONSOLIDATION_DECAY_IMPORTANCE_THRESHOLDfloatNo0.3Min importance to process in decay
CONSOLIDATION_CREATIVE_INTERVAL_SECONDSintNo604800Creative cycle frequency (1 week)
CONSOLIDATION_CLUSTER_INTERVAL_SECONDSintNo2592000Cluster cycle frequency (1 month)
CONSOLIDATION_FORGET_INTERVAL_SECONDSintNo0Forget cycle frequency (disabled by default)
CONSOLIDATION_ARCHIVE_THRESHOLDfloatNo0.2Relevance threshold for archiving
CONSOLIDATION_DELETE_THRESHOLDfloatNo0.05Relevance threshold for deletion
CONSOLIDATION_GRACE_PERIOD_DAYSintNo30Min age before memory can be forgotten
CONSOLIDATION_IMPORTANCE_PROTECTION_THRESHOLDfloatNo0.7Memories above this importance are protected
CONSOLIDATION_PROTECTED_TYPESstringNoDecision,PatternComma-separated types to never forget

Consolidation task details:

TaskCypher OperationPurposeProtected Conditions
DecaySET m.importance = m.importance * decay_factorExponential relevance reductiontype IN PROTECTED_TYPES OR importance > IMPORTANCE_PROTECTION_THRESHOLD
CreativeMATCH (m1:Memory)-[*..3]-(m2:Memory)Multi-hop association discoveryN/A
ClusterMATCH (m:Memory) ... CREATE (p:Pattern)Pattern node generationN/A
ForgetSET m.archived = true or DELETE mArchive/remove low-value memoriesAge < GRACE_PERIOD_DAYS OR protected conditions

Fine-tune hybrid search ranking. Weights are applied to individual signals and summed to produce a final score:

VariableTypeRequiredDefaultDescription
SEARCH_WEIGHT_VECTORfloatNo0.25Vector similarity component
SEARCH_WEIGHT_KEYWORDfloatNo0.15Keyword/TF-IDF matching
SEARCH_WEIGHT_TAGfloatNo0.10Tag overlap score
SEARCH_WEIGHT_IMPORTANCEfloatNo0.05User-assigned importance
SEARCH_WEIGHT_RECENCYfloatNo0.10Freshness boost
SEARCH_WEIGHT_CONFIDENCEfloatNo0.05Memory confidence score
SEARCH_WEIGHT_EXACTfloatNo0.25Content token overlap

The default weights balance semantic similarity (vector + keyword + exact = 0.65) with metadata signals (tags + importance + recency + confidence = 0.35). Adjust weights to favor specific signals for your use case.

Controls query result expansion and limits:

VariableTypeRequiredDefaultDescription
RECALL_MAX_LIMITintNo100Maximum results returned by /recall
RECALL_RELATION_LIMITintNo5Max related memories per result
RECALL_EXPANSION_LIMITintNo20Max memories added via expand_relations=true

Controls automatic drift detection between FalkorDB and Qdrant:

VariableTypeRequiredDefaultDescription
SYNC_CHECK_INTERVAL_SECONDSintNo300Frequency of drift checks (5 minutes)
SYNC_AUTO_REPAIRboolNotrueAutomatically queue missing embeddings

The sync worker counts memories in FalkorDB vs Qdrant and queues repair operations when drift exceeds 5%.

Controls classification and relationship validation:

VariableTypeRequiredDefaultDescription
MEMORY_TYPESstringNoSee belowComma-separated valid memory types
RELATIONSHIP_TYPESstringNoSee belowComma-separated valid relationship types
ALLOWED_RELATIONSstringNoSame as RELATIONSHIP_TYPESAlias for backward compatibility

Default memory types:

Decision, Pattern, Preference, Style, Habit, Insight, Context, Memory

Default relationship types:

RELATES_TO, LEADS_TO, OCCURRED_BEFORE, PREFERS_OVER, EXEMPLIFIES,
CONTRADICTS, REINFORCES, INVALIDATED_BY, EVOLVED_INTO, DERIVED_FROM, PART_OF

Type aliases — The TYPE_ALIASES mapping in automem.config normalizes variations:

InputNormalized To
decision, decisionsDecision
pattern, patternsPattern
preference, preferencesPreference
fact, facts, knowledgeContext

Controls LLM-based memory classification fallback:

VariableTypeRequiredDefaultDescription
CLASSIFICATION_MODELstringNogpt-4o-miniOpenAI model for content classification

When an explicit type is not provided in the request, or regex patterns fail to match, AutoMem uses the LLM classification model. The system prompt for classification is defined in MemoryClassifier.SYSTEM_PROMPT in app.py.


The mcp-automem client uses two primary environment variables to locate and authenticate with the AutoMem backend service. These can be set via .env file, shell environment, or platform-specific MCP configuration files.

VariableRequiredDefaultDescription
AUTOMEM_ENDPOINTYeshttp://127.0.0.1:8001HTTP URL of the AutoMem service
AUTOMEM_API_KEYNo(none)API key for authenticated instances (preferred name)
AUTOMEM_API_TOKENNo(none)Alternative name for the API key
AUTOMEM_PROCESS_TAGNo(none)Process title tag for safe cleanup in multi-process environments
MCP_PROCESS_TAGNo(none)Alternative process tag variable
AUTOMEM_LOG_LEVELNo(none)Set to debug for verbose logging

Common endpoint values:

  • Local development: http://127.0.0.1:8001 or http://localhost:8001
  • Railway deployment: https://your-service.railway.app
  • Custom deployment: Your service’s public or internal URL

API key resolution order — The readAutoMemApiKeyFromEnv() function checks variables in this priority order:

graph TB
    subgraph Env_Resolution["Environment Variable Resolution"]
        DOTENV["dotenv.config()<br/>.env file loading"]

        ENDPOINT_CHECK{"AUTOMEM_ENDPOINT<br/>exists?"}
        ENDPOINT_DEFAULT["Default:<br/>http://127.0.0.1:8001"]
        ENDPOINT_VALUE["Use env value"]

        API_KEY_FUNC["readAutoMemApiKeyFromEnv()"]
        KEY_PRIORITY["Priority:<br/>1. AUTOMEM_API_KEY<br/>2. AUTOMEM_API_TOKEN<br/>3. AUTOMEM_TOKEN<br/>4. API_KEY"]
    end

    subgraph Client_Config["AutoMemClient Config"]
        CONFIG_OBJ["clientConfig: AutoMemConfig<br/>{ endpoint, apiKey }"]
        CLIENT_INSTANCE["new AutoMemClient(config)"]
    end

    DOTENV --> ENDPOINT_CHECK
    ENDPOINT_CHECK -->|"No"| ENDPOINT_DEFAULT
    ENDPOINT_CHECK -->|"Yes"| ENDPOINT_VALUE
    ENDPOINT_DEFAULT --> CONFIG_OBJ
    ENDPOINT_VALUE --> CONFIG_OBJ

    DOTENV --> API_KEY_FUNC
    API_KEY_FUNC --> KEY_PRIORITY
    KEY_PRIORITY --> CONFIG_OBJ

    CONFIG_OBJ --> CLIENT_INSTANCE

The client resolves configuration from multiple sources with a defined priority order:

graph TB
    subgraph "Configuration Resolution Priority"
        direction TB
        CMD["1. Command-line args<br/>--endpoint, --api-key"]
        ENV_FILE["2. .env file<br/>current directory"]
        PROCESS_ENV["3. Process environment<br/>shell exports"]
        DEFAULT["4. Default<br/>http://localhost:8001"]
    end

    AUTO_CLIENT["AutoMemClient"] --> CMD
    CMD -->|Not found| ENV_FILE
    ENV_FILE -->|Not found| PROCESS_ENV
    PROCESS_ENV -->|Not found| DEFAULT

    ENV_FILE --> DOT_ENV["dotenv.config()<br/>loads AUTOMEM_ENDPOINT<br/>loads AUTOMEM_API_KEY"]
  1. Environment variables (highest priority) — Direct shell environment or .env file or platform-specific MCP server env blocks
  2. ~/.claude.json configuration — Used by CLI commands when environment is not set; scans all mcpServers entries for AutoMem config
  3. Default values (lowest priority) — endpoint: http://127.0.0.1:8001, apiKey: undefined

Each AI platform stores MCP server configuration differently:

PlatformConfiguration FileFormat
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json (macOS)JSON
Claude Desktop%APPDATA%\Claude\claude_desktop_config.json (Windows)JSON
Claude Desktop~/.config/Claude/claude_desktop_config.json (Linux)JSON
Cursor IDE~/.cursor/mcp.jsonJSON
Claude Code~/.claude.jsonJSON
Codex~/.codex/config.tomlTOML
OpenClaw~/.openclaw/openclaw.jsonJSON

JSON configuration example (Claude Desktop, Cursor, Claude Code):

{
"mcpServers": {
"automem": {
"command": "npx",
"args": ["-y", "@verygoodplugins/mcp-automem"],
"env": {
"AUTOMEM_ENDPOINT": "https://your-service.railway.app",
"AUTOMEM_API_KEY": "your-api-token"
}
}
}
}

The command and args launch the MCP server in stdio mode. The env block passes configuration to the server process.

TOML configuration example (Codex):

[mcp.servers.automem]
command = "npx"
args = ["-y", "@verygoodplugins/mcp-automem"]
[mcp.servers.automem.env]
AUTOMEM_ENDPOINT = "https://your-service.railway.app"
AUTOMEM_API_KEY = "your-api-token"

The store_memory tool enforces content size limits to maintain embedding quality:

Limit TypeThresholdBehavior
Soft limit500 charactersWarning; backend may auto-summarize
Hard limit2000 charactersRejected immediately with error

The setup wizard validates the endpoint before saving configuration:

  1. URL format check — Ensures AUTOMEM_ENDPOINT is a valid HTTP/HTTPS URL
  2. Health endpoint probe — Sends GET /health request with 2-second timeout
  3. Database status check — Verifies FalkorDB and Qdrant connectivity
  4. Configuration write — Saves validated config to .env

At runtime, if the endpoint is unreachable, queue operations are skipped rather than blocking. This prevents queue operations from stalling when the service is temporarily down.


VariableTypeRequiredDefaultDescription
LOG_LEVELstringNoINFOPython logging level (DEBUG, INFO, WARNING, ERROR)
FLASK_ENVstringNoproductionFlask environment mode
VariableTypeRequiredDefaultDescription
AUTOMEM_RUN_INTEGRATION_TESTSboolNo0Enable integration test suite
AUTOMEM_START_DOCKERboolNo0Auto-start Docker Compose for tests
AUTOMEM_STOP_DOCKERboolNo0Auto-stop Docker after tests
AUTOMEM_TEST_BASE_URLstringNohttp://localhost:8001Test target URL
AUTOMEM_ALLOW_LIVEboolNo0Allow tests against non-localhost
AUTOMEM_TEST_API_TOKENstringNounsetToken for integration tests
AUTOMEM_TEST_ADMIN_TOKENstringNounsetAdmin token for integration tests

AutoMem validates critical configuration at startup with fail-fast behavior for critical misconfigurations and graceful degradation for optional features:

VariableValidationFailure Behavior
FALKORDB_HOST, FALKORDB_PORTConnection test on startup503 Service Unavailable
AUTOMEM_API_TOKENMust be non-empty string500 Internal Server Error
ADMIN_API_TOKENMust be non-empty string500 Internal Server Error
PORTMust be valid port numberDefaults to 8001
QDRANT_URLConnection test if providedLog warning, continue
VECTOR_SIZEMust match Qdrant collectionFail fast on mismatch
EMBEDDING_PROVIDERMust be valid optionDefaults to auto

The health endpoint at GET /health reflects connection status and can be used to verify configuration:

{
"status": "healthy",
"falkordb": "connected",
"qdrant": "connected",
"memory_count": 142,
"enrichment": {
"status": "running",
"queue_depth": 0
},
"graph": "memories"
}

When Qdrant is unavailable (expected in graph-only mode):

{
"status": "healthy",
"falkordb": "connected",
"qdrant": "unavailable",
"memory_count": 142
}

Section titled “Minimal local setup (graph-only, no vector search)”
Terminal window
AUTOMEM_API_TOKEN=your-token-here
ADMIN_API_TOKEN=your-admin-token-here
FALKORDB_HOST=localhost
FALKORDB_PORT=6379
PORT=8001
Terminal window
PORT=8001
FALKORDB_HOST=falkordb.railway.internal
FALKORDB_PORT=6379
FALKORDB_PASSWORD=<generated-by-template>
AUTOMEM_API_TOKEN=<generated-by-template>
ADMIN_API_TOKEN=<generated-by-template>
OPENAI_API_KEY=sk-...
QDRANT_URL=https://your-cluster.cloud.qdrant.io
QDRANT_API_KEY=your-qdrant-key
VECTOR_SIZE=3072
Terminal window
EMBEDDING_PROVIDER=openai
OPENAI_API_KEY=sk-or-...
OPENAI_BASE_URL=https://openrouter.ai/api/v1
EMBEDDING_MODEL=text-embedding-3-large
VECTOR_SIZE=3072

Variable resolution troubleshooting (Railway)

Section titled “Variable resolution troubleshooting (Railway)”
flowchart TD
    Start["Variable not resolving?"]

    Start --> Check1{"Using Railway<br/>template deploy?"}
    Check1 -->|Yes| Check2{"Variable shows<br/>literal $\{\{...\}\}?"}
    Check1 -->|No| UseHardcoded["Use hardcoded values<br/>NOT template syntax"]

    Check2 -->|Yes| Bug["Template bug<br/>Report to Railway"]
    Check2 -->|No| Working["Working correctly"]

    UseHardcoded --> SetVars["Set variables:<br/>FALKORDB_HOST=falkordb.railway.internal<br/>FALKORDB_PASSWORD=(copy from falkordb)"]

    SetVars --> Verify["Test connection:<br/>railway run redis-cli ping"]

    Bug --> Workaround["Workaround:<br/>Use hardcoded values"]
    Workaround --> SetVars

When deploying AutoMem to production, verify these security practices:

  • Never commit .env files — add to .gitignore
  • Use strong tokens — minimum 32 bytes of entropy for AUTOMEM_API_TOKEN and ADMIN_API_TOKEN
  • Rotate secrets periodically — update tokens every 90 days
  • Restrict ADMIN_API_TOKEN — use a separate, more restricted token for admin operations
  • Enable FalkorDB authentication — always set FALKORDB_PASSWORD in production
  • Use HTTPS for external services — Qdrant Cloud, OpenAI, Voyage endpoints must use TLS
  • Validate environment on startup — review logs for configuration warnings
  • Use Railway private networking — never expose FalkorDB publicly
  • Never use query parameter auth (?api_key=) in production — tokens appear in server logs