Skip to content

Environment Variables

This page is a quick-reference table of all AutoMem environment variables, grouped by category. For full documentation of each variable including validation rules, behavior details, and configuration examples, see Configuration Reference.


Variables are loaded from multiple sources in priority order:

  1. Process environmentexport VAR=value or variables injected by the platform (Railway, Docker)
  2. Project .env — File in repository root
  3. User config~/.config/automem/.env (personal overrides, never committed)

Variables set earlier in this list take precedence over later sources.


VariableRequiredDefaultDescription
FALKORDB_HOSTYeslocalhostFalkorDB graph database hostname
FALKORDB_PORTYes6379FalkorDB port
FALKORDB_PASSWORDNounsetFalkorDB/Redis password (set in production)
FALKORDB_GRAPHNomemoriesGraph name for Cypher queries
GRAPH_NAMENomemoriesAlias for FALKORDB_GRAPH
PORTNo8001Flask API server port

AutoMem operates in graph-only mode if these variables are not set. Qdrant enables semantic vector search but is optional.

VariableRequiredDefaultDescription
QDRANT_URLNounsetQdrant API endpoint (HTTP or HTTPS)
QDRANT_API_KEYNounsetQdrant authentication key (required for Qdrant Cloud)
QDRANT_COLLECTIONNomemoriesCollection name for memory vectors
COLLECTION_NAMENomemoriesAlias for QDRANT_COLLECTION
VECTOR_SIZENo3072Embedding dimension — must match collection (768/1024/2048/3072)
VariableRequiredDefaultDescription
AUTOMEM_API_TOKENYesunsetToken for all standard API operations
ADMIN_API_TOKENYesunsetToken for admin endpoints (/admin/*, /enrichment/reprocess)
API_TOKENNounsetBackward-compatible alias for AUTOMEM_API_TOKEN
ADMIN_TOKENNounsetBackward-compatible alias for ADMIN_API_TOKEN

See Authentication for token generation and usage details.

VariableRequiredDefaultDescription
EMBEDDING_PROVIDERNoautoProvider selection: auto / voyage / openai / local / ollama / placeholder
EMBEDDING_MODELNotext-embedding-3-largeOpenAI model name
OPENAI_API_KEYNounsetOpenAI (or compatible provider) API key
OPENAI_BASE_URLNounsetCustom base URL for OpenAI-compatible APIs (OpenRouter, LiteLLM, vLLM)
VOYAGE_API_KEYNounsetVoyage AI API key
VOYAGE_MODELNovoyage-4Voyage model name (voyage-4, voyage-4-large)
OLLAMA_BASE_URLNohttp://localhost:11434Ollama server endpoint
OLLAMA_MODELNonomic-embed-textOllama embedding model
EMBEDDING_BATCH_SIZENo20Items per batch API call (reduces costs 40–50%)
EMBEDDING_BATCH_TIMEOUT_SECONDSNo2.0Max wait before flushing a partial batch

Background enrichment runs after each memory is stored — it generates similarity links, entity tags, and summaries.

VariableRequiredDefaultDescription
ENRICHMENT_MAX_ATTEMPTSNo3Retry limit before marking a job failed
ENRICHMENT_SIMILARITY_LIMITNo5Number of semantic neighbors to link
ENRICHMENT_SIMILARITY_THRESHOLDNo0.8Min cosine similarity for SIMILAR_TO edge
ENRICHMENT_IDLE_SLEEP_SECONDSNo2Worker sleep duration when queue is empty
ENRICHMENT_FAILURE_BACKOFF_SECONDSNo5Delay between retry attempts
ENRICHMENT_ENABLE_SUMMARIESNotrueAuto-generate memory summaries
ENRICHMENT_SPACY_MODELNoen_core_web_smspaCy model for NER (if installed)

Background maintenance cycles that decay, cluster, and optionally forget low-value memories.

VariableRequiredDefaultDescription
CONSOLIDATION_TICK_SECONDSNo60Scheduler check interval
CONSOLIDATION_DECAY_INTERVAL_SECONDSNo86400Decay cycle frequency (1 day)
CONSOLIDATION_DECAY_IMPORTANCE_THRESHOLDNo0.3Min importance to process in decay
CONSOLIDATION_CREATIVE_INTERVAL_SECONDSNo604800Creative association cycle frequency (1 week)
CONSOLIDATION_CLUSTER_INTERVAL_SECONDSNo2592000Cluster pattern cycle frequency (1 month)
CONSOLIDATION_FORGET_INTERVAL_SECONDSNo0Forget cycle frequency (disabled by default)
CONSOLIDATION_ARCHIVE_THRESHOLDNo0.2Relevance threshold for archiving
CONSOLIDATION_DELETE_THRESHOLDNo0.05Relevance threshold for deletion
CONSOLIDATION_GRACE_PERIOD_DAYSNo30Min age in days before a memory can be forgotten
CONSOLIDATION_IMPORTANCE_PROTECTION_THRESHOLDNo0.7Memories above this importance are never forgotten
CONSOLIDATION_PROTECTED_TYPESNoDecision,PatternComma-separated types to never forget
VariableRequiredDefaultDescription
SEARCH_WEIGHT_VECTORNo0.25Vector similarity weight
SEARCH_WEIGHT_KEYWORDNo0.15Keyword/TF-IDF matching weight
SEARCH_WEIGHT_TAGNo0.10Tag overlap weight
SEARCH_WEIGHT_IMPORTANCENo0.05User-assigned importance weight
SEARCH_WEIGHT_RECENCYNo0.10Freshness boost weight
SEARCH_WEIGHT_CONFIDENCENo0.05Memory confidence weight
SEARCH_WEIGHT_EXACTNo0.25Content token overlap weight
RECALL_MAX_LIMITNo100Maximum results returned by /recall
RECALL_RELATION_LIMITNo5Max related memories per result
RECALL_EXPANSION_LIMITNo20Max memories added via expand_relations=true
VariableRequiredDefaultDescription
SYNC_CHECK_INTERVAL_SECONDSNo300Frequency of drift checks between FalkorDB and Qdrant (5 minutes)
SYNC_AUTO_REPAIRNotrueAutomatically queue missing embeddings when drift detected
VariableRequiredDefaultDescription
MEMORY_TYPESNoDecision,Pattern,Preference,Style,Habit,Insight,Context,MemoryComma-separated valid memory types
RELATIONSHIP_TYPESNoRELATES_TO,LEADS_TO,...Comma-separated valid relationship types
ALLOWED_RELATIONSNoSame as RELATIONSHIP_TYPESAlias for backward compatibility
CLASSIFICATION_MODELNogpt-4o-miniOpenAI model used for content classification fallback
VariableRequiredDefaultDescription
LOG_LEVELNoINFOPython logging level (DEBUG, INFO, WARNING, ERROR)
FLASK_ENVNoproductionFlask environment mode

These variables configure the mcp-automem client package, not the server.

VariableRequiredDefaultDescription
AUTOMEM_ENDPOINTYeshttp://127.0.0.1:8001HTTP URL of the AutoMem server
AUTOMEM_API_KEYNounsetAPI key for authenticated instances (preferred name)
AUTOMEM_API_TOKENNounsetAlternative name for the API key
AUTOMEM_LOG_LEVELNounsetSet to debug for verbose MCP client logging
AUTOMEM_PROCESS_TAGNounsetProcess title tag for safe process management
MCP_PROCESS_TAGNounsetAlternative process tag variable

The client checks API key variables in this priority order: AUTOMEM_API_KEYAUTOMEM_API_TOKENAUTOMEM_TOKENAPI_KEY.


Used only for the AutoMem test suite — do not set in production.

VariableRequiredDefaultDescription
AUTOMEM_RUN_INTEGRATION_TESTSNo0Enable integration test suite
AUTOMEM_START_DOCKERNo0Auto-start Docker Compose before tests
AUTOMEM_STOP_DOCKERNo0Auto-stop Docker after tests
AUTOMEM_TEST_BASE_URLNohttp://localhost:8001Test target URL
AUTOMEM_ALLOW_LIVENo0Allow tests against non-localhost URLs
AUTOMEM_TEST_API_TOKENNounsetAPI token for integration tests
AUTOMEM_TEST_ADMIN_TOKENNounsetAdmin token for integration tests

Section titled “Minimal local (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
AUTOMEM_API_TOKEN=your-token-here
ADMIN_API_TOKEN=your-admin-token-here
FALKORDB_HOST=localhost
PORT=8001
OPENAI_API_KEY=sk-...
QDRANT_URL=http://localhost:6333
VECTOR_SIZE=3072
Terminal window
AUTOMEM_API_TOKEN=your-token-here
ADMIN_API_TOKEN=your-admin-token-here
FALKORDB_HOST=localhost
PORT=8001
EMBEDDING_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=nomic-embed-text
QDRANT_URL=http://localhost:6333
VECTOR_SIZE=768
Terminal window
PORT=8001
FALKORDB_HOST=falkordb.railway.internal
FALKORDB_PORT=6379
FALKORDB_PASSWORD=<generated>
AUTOMEM_API_TOKEN=<generated>
ADMIN_API_TOKEN=<generated>
OPENAI_API_KEY=sk-...
QDRANT_URL=https://your-cluster.cloud.qdrant.io
QDRANT_API_KEY=your-qdrant-key
VECTOR_SIZE=3072
{
"env": {
"AUTOMEM_ENDPOINT": "https://your-service.railway.app",
"AUTOMEM_API_KEY": "your-api-token"
}
}

  • Never commit .env files — add to .gitignore
  • Use strong tokens — minimum 32 bytes: openssl rand -hex 32
  • Use separate tokens for AUTOMEM_API_TOKEN and ADMIN_API_TOKEN
  • Set FALKORDB_PASSWORD in all production environments
  • Use HTTPS for all external service endpoints (Qdrant Cloud, OpenAI, Voyage)
  • Use Railway private networking — never expose FalkorDB publicly
  • Avoid query parameter auth (?api_key=) in production — tokens appear in server logs