Skip to content

Configuration Guide: Complete Reference

Memento is configured via ~/.claude-memory/config.json. This file controls storage backend, embeddings provider, auto-capture behavior, search settings, and more.

Configuration Resolution Order

Memento loads configuration in this priority order:

1. Environment Variables (highest priority)
   MEMENTO_STORAGE_TYPE=chromadb
   MEMENTO_EMBEDDINGS_PROVIDER=openai

2. Config File (~/.claude-memory/config.json)
   {
     "storage": { "type": "json" },
     "embeddings": { "provider": "local" }
   }

3. Default Values (lowest priority)
   storage.type = "json"
   embeddings.provider = "local"

If you set an environment variable, it overrides the config file. If the config file has a value, it's used. Otherwise, the default is applied.

Complete Configuration Reference

Root Level

json
{
  "id": "memento-config",
  "version": "0.1.0",
  "ide": "claude-code",
  "namespace": "default",
  "projectPath": "/Users/me/my-project"
}
FieldTypeDefaultDescription
idstring"memento-config"Config identifier
versionstring"0.1.0"Config version (for migrations)
idestring"claude-code"IDE being used: claude-code, cursor, windsurf, opencode
namespacestring"default"Default namespace for memories
projectPathstringcurrent dirProject root path

Storage Configuration

Controls where memories are stored.

JSON (Local File-Based, Default)

json
{
  "storage": {
    "type": "json",
    "path": "~/.claude-memory/store",
    "compression": false,
    "backupInterval": 3600000
  }
}
FieldTypeDefaultDescription
typestring"json"Storage backend type
pathstring"~/.claude-memory/store"Directory to store JSON files
compressionbooleanfalseEnable gzip compression (saves 60% space)
backupIntervalnumber3600000Backup every N ms (1 hour default)

Environment Variable Override:

bash
MEMENTO_STORAGE_TYPE=json
MEMENTO_STORAGE_PATH=/custom/path

Use JSON when:

  • You want portability (all files are readable JSON)
  • You prefer simplicity
  • You're on a laptop or single machine
  • You don't have extra dependencies

IndexedDB (Browser)

json
{
  "storage": {
    "type": "indexeddb",
    "dbName": "memento-app",
    "storeName": "memories",
    "version": 1
  }
}
FieldTypeDefaultDescription
typestring-Must be "indexeddb"
dbNamestring"memento-db"Browser database name
storeNamestring"memories"Object store within database
versionnumber1Database schema version

Use IndexedDB when:

  • Building web applications
  • You need persistent browser storage
  • You want offline-first capability

ChromaDB (Vector Database)

json
{
  "storage": {
    "type": "chromadb",
    "host": "localhost",
    "port": 8000,
    "path": "~/.chroma",
    "collectionName": "memento"
  }
}
FieldTypeDefaultDescription
typestring-Must be "chromadb"
hoststring"localhost"ChromaDB server host
portnumber8000ChromaDB server port
pathstring"~/.chroma"Local ChromaDB data path
collectionNamestring"memento"Collection name in ChromaDB

Use ChromaDB when:

  • You want a dedicated vector database
  • You need better search performance at scale (10K+ memories)
  • You're sharing a database across multiple users

Start ChromaDB:

bash
# Install (optional dependency)
pip install chromadb

# Start server
chroma run --host localhost --port 8000

Neo4j (Graph Database)

json
{
  "storage": {
    "type": "neo4j",
    "uri": "bolt://localhost:7687",
    "username": "neo4j",
    "password": "${MEMENTO_NEO4J_PASSWORD}",
    "database": "memento"
  }
}
FieldTypeDefaultDescription
typestring-Must be "neo4j"
uristring"bolt://localhost:7687"Neo4j connection URI
usernamestring"neo4j"Neo4j username
passwordstring-Neo4j password (use env var!)
databasestring"memento"Database name

Use Neo4j when:

  • You want relationship-aware storage
  • You're doing complex graph queries
  • You need to integrate with other graph applications
  • You want to visualize memory relationships

Start Neo4j:

bash
# Docker
docker run -d \
  --name neo4j \
  -p 7474:7474 \
  -p 7687:7687 \
  -e NEO4J_AUTH=neo4j/password \
  neo4j

# Or use Neo4j Desktop app

Embeddings Configuration

Controls how memories are converted to vectors for semantic search.

Local Embeddings (Default)

json
{
  "embeddings": {
    "provider": "local",
    "model": "all-MiniLM-L6-v2",
    "dimensions": 384,
    "offline": true
  }
}
FieldTypeDefaultDescription
providerstring"local"Must be "local"
modelstring"all-MiniLM-L6-v2"Hugging Face model ID
dimensionsnumber384Vector dimensionality
offlinebooleantrueWorks without internet

Use local when:

  • You want offline operation (no API key needed)
  • You want privacy (embeddings never leave your machine)
  • You prefer simplicity
  • You have adequate RAM (model is ~200MB)

Gemini Embeddings (Google)

json
{
  "embeddings": {
    "provider": "gemini",
    "model": "embedding-001",
    "apiKey": "${MEMENTO_GEMINI_API_KEY}",
    "dimensions": 768,
    "batchSize": 100
  }
}
FieldTypeDefaultDescription
providerstring-Must be "gemini"
modelstring"embedding-001"Gemini model ID
apiKeystring-API key (NEVER hardcode!)
dimensionsnumber768Output vector size
batchSizenumber100Requests per batch

Get an API key:

  1. Go to Google AI Studio
  2. Create API key
  3. Set environment variable:
bash
export MEMENTO_GEMINI_API_KEY=your-key

Use Gemini when:

  • You want high-quality embeddings
  • You're okay with API calls
  • You need better semantic understanding
  • You have a Google Cloud account

OpenAI Embeddings

json
{
  "embeddings": {
    "provider": "openai",
    "model": "text-embedding-3-small",
    "apiKey": "${MEMENTO_OPENAI_API_KEY}",
    "dimensions": 1536,
    "batchSize": 100
  }
}
FieldTypeDefaultDescription
providerstring-Must be "openai"
modelstring"text-embedding-3-small"OpenAI model ID
apiKeystring-OpenAI API key
dimensionsnumber1536Output vector size
batchSizenumber100Requests per batch

Get an API key:

  1. Go to OpenAI Platform
  2. Create API key
  3. Set environment variable:
bash
export MEMENTO_OPENAI_API_KEY=your-key

Costs:

  • text-embedding-3-small: $0.02 per 1M tokens
  • ~10,000 memories: ~$0.01

Use OpenAI when:

  • You're already using OpenAI for other tasks
  • You want the best embeddings (text-embedding-3-large)
  • You have an OpenAI subscription

Search Configuration

Controls default search behavior.

json
{
  "search": {
    "defaultMode": "hybrid",
    "vectorWeight": 0.70,
    "keywordWeight": 0.30,
    "limit": 10,
    "hnswMaxElements": 10000,
    "hnswEfConstruction": 200,
    "hnswEf": 100
  }
}
FieldTypeDefaultDescription
defaultModestring"hybrid"Default search mode: vector, keyword, hybrid
vectorWeightnumber0.70Weight for vector results in hybrid (0-1)
keywordWeightnumber0.30Weight for keyword results in hybrid (0-1)
limitnumber10Default max results per query
hnswMaxElementsnumber10000Max elements in HNSW index
hnswEfConstructionnumber200HNSW construction parameter (higher = better quality, slower)
hnswEfnumber100HNSW search parameter (higher = more accurate, slower)

HNSW Tuning:

json
{
  "search": {
    "hnswMaxElements": 5000,
    "hnswEfConstruction": 100,
    "hnswEf": 50
  }
}

For fast searches with 1K-5K memories:

json
{
  "search": {
    "hnswEfConstruction": 100,
    "hnswEf": 30
  }
}

For accurate searches with 10K+ memories:

json
{
  "search": {
    "hnswEfConstruction": 400,
    "hnswEf": 200
  }
}

Auto-Capture Configuration

Controls what gets automatically saved to memory.

json
{
  "capture": {
    "enabled": true,
    "minOutputLength": 50,
    "ignoredTools": ["Read", "Glob", "Grep"],
    "workerIntervalMs": 5000,
    "queuePath": "~/.claude-memory/capture-queue.jsonl",
    "dedupSimilarityThreshold": 0.95,
    "sourceTag": "auto-capture"
  }
}
FieldTypeDefaultDescription
enabledbooleantrueEnable auto-capture
minOutputLengthnumber50Minimum output length in characters
ignoredToolsarray["Read","Glob","Grep"]Tools to skip
workerIntervalMsnumber5000Queue processing interval (ms)
queuePathstring"~/.claude-memory/capture-queue.jsonl"Queue file location
dedupSimilarityThresholdnumber0.95Skip if similar to existing (0-1)
sourceTagstring"auto-capture"Tag for auto-captured memories

Disable auto-capture:

json
{
  "capture": {
    "enabled": false
  }
}

Capture everything (aggressive):

json
{
  "capture": {
    "enabled": true,
    "minOutputLength": 10,
    "ignoredTools": []
  }
}

Selective capture (conservative):

json
{
  "capture": {
    "enabled": true,
    "minOutputLength": 200,
    "ignoredTools": ["Read", "Glob", "Grep", "Bash"]
  }
}

Smart Memory Configuration

Controls importance scoring, contradiction detection, and entity extraction.

json
{
  "smartMemory": {
    "importanceScoringEnabled": true,
    "sourceWeights": {
      "write": 0.90,
      "edit": 0.80,
      "bash": 0.70,
      "manual": 0.85
    },
    "tagWeights": {
      "decision": 0.95,
      "architecture": 0.90,
      "error": 0.80,
      "code": 0.60
    },
    "contradictionDetectionEnabled": true,
    "entityExtractionEnabled": true,
    "relationshipTypesEnabled": ["similar", "supersedes", "references", "contradicts", "elaborates"]
  }
}
FieldTypeDefaultDescription
importanceScoringEnabledbooleantrueCalculate importance scores
sourceWeightsobjectsee aboveWeight each memory source
tagWeightsobjectsee aboveWeight each tag
contradictionDetectionEnabledbooleantrueDetect contradictions
entityExtractionEnabledbooleantrueExtract entities (file paths, functions, etc.)
relationshipTypesEnabledarrayallRelationship types to track

Server Configuration

Controls HTTP API settings.

json
{
  "server": {
    "port": 7007,
    "host": "127.0.0.1",
    "cors": {
      "enabled": true,
      "origins": ["http://localhost:3000"],
      "credentials": true
    },
    "auth": {
      "enabled": true,
      "apiKeys": ["sk-abc123def456"]
    },
    "rateLimit": {
      "enabled": true,
      "requestsPerMinute": 100
    }
  }
}
FieldTypeDefaultDescription
portnumber7007HTTP server port
hoststring"127.0.0.1"Bind to this host
cors.enabledbooleantrueEnable CORS
cors.originsarray["*"]Allowed origins
cors.credentialsbooleanfalseAllow credentials
auth.enabledbooleantrueRequire API key
auth.apiKeysarray[]Valid API keys
rateLimit.enabledbooleantrueEnable rate limiting
rateLimit.requestsPerMinutenumber100Request limit

Index Configuration

Controls project indexing behavior.

json
{
  "index": {
    "excludePatterns": [
      "node_modules/",
      ".git/",
      "dist/",
      "build/",
      ".next/"
    ],
    "maxFileSizeKB": 50,
    "maxFilesPerScan": 1000,
    "fileTypes": [
      "*.md",
      "*.ts",
      "*.js",
      "*.py",
      "package.json",
      "docker-compose.yml"
    ]
  }
}
FieldTypeDefaultDescription
excludePatternsarraysee aboveDirectories to skip
maxFileSizeKBnumber50Skip files larger than this
maxFilesPerScannumber1000Max files to scan per index run
fileTypesarraysee aboveFile extensions to include

Compaction Configuration

Controls memory store cleanup.

json
{
  "compaction": {
    "enabled": true,
    "schedule": "0 2 * * 0",
    "ttlDays": 180,
    "maxEntries": 10000,
    "removeLowImportance": true,
    "lowImportanceThreshold": 0.3,
    "deduplicationSimilarityThreshold": 0.95
  }
}
FieldTypeDefaultDescription
enabledbooleantrueEnable auto-compaction
schedulestring"0 2 * * 0"Cron schedule (2 AM Sunday)
ttlDaysnumber180Delete memories older than N days
maxEntriesnumber10000Maximum memories to keep
removeLowImportancebooleantrueRemove low-importance memories
lowImportanceThresholdnumber0.3Importance cutoff (0-1)
deduplicationSimilarityThresholdnumber0.95Similarity threshold for dedup

Environment Variable Overrides

All config can be overridden via environment variables using SCREAMING_SNAKE_CASE:

bash
# Storage
MEMENTO_STORAGE_TYPE=chromadb
MEMENTO_STORAGE_PATH=/custom/path

# Embeddings
MEMENTO_EMBEDDINGS_PROVIDER=openai
MEMENTO_EMBEDDINGS_API_KEY=sk-...

# Search
MEMENTO_SEARCH_DEFAULT_MODE=vector
MEMENTO_SEARCH_LIMIT=20

# Capture
MEMENTO_CAPTURE_ENABLED=true
MEMENTO_CAPTURE_MIN_OUTPUT_LENGTH=100

# Server
MEMENTO_SERVER_PORT=8008
MEMENTO_SERVER_AUTH_ENABLED=false

# IDE
MEMENTO_IDE=cursor

Example Configurations

Lightweight Development Setup

json
{
  "storage": {
    "type": "json",
    "compression": false
  },
  "embeddings": {
    "provider": "local",
    "model": "all-MiniLM-L6-v2"
  },
  "search": {
    "defaultMode": "hybrid",
    "limit": 10
  },
  "capture": {
    "enabled": true,
    "minOutputLength": 50
  }
}

Production Server Setup

json
{
  "storage": {
    "type": "chromadb",
    "host": "chroma.internal",
    "port": 8000,
    "collectionName": "memento-prod"
  },
  "embeddings": {
    "provider": "openai",
    "model": "text-embedding-3-large",
    "apiKey": "${OPENAI_API_KEY}"
  },
  "search": {
    "defaultMode": "vector",
    "limit": 50
  },
  "server": {
    "port": 7007,
    "host": "0.0.0.0",
    "cors": {
      "origins": ["https://app.example.com"]
    },
    "auth": {
      "enabled": true,
      "apiKeys": ["${MEMENTO_API_KEY}"]
    }
  }
}

Research/Archival Setup

json
{
  "storage": {
    "type": "neo4j",
    "uri": "bolt://graph.example.com:7687",
    "username": "neo4j",
    "password": "${NEO4J_PASSWORD}"
  },
  "embeddings": {
    "provider": "gemini",
    "apiKey": "${GEMINI_API_KEY}"
  },
  "search": {
    "defaultMode": "hybrid",
    "hnswEfConstruction": 400,
    "hnswEf": 200
  },
  "compaction": {
    "ttlDays": 730,
    "maxEntries": 100000
  }
}

Browser App Setup

json
{
  "storage": {
    "type": "indexeddb",
    "dbName": "my-app-memories"
  },
  "embeddings": {
    "provider": "gemini",
    "apiKey": "${VITE_GEMINI_API_KEY}"
  },
  "search": {
    "defaultMode": "hybrid"
  },
  "capture": {
    "enabled": false
  }
}

Validating Your Configuration

Check your config is valid:

bash
memento config --validate

Output:

Validating configuration...

✓ storage: json backend configured
✓ embeddings: local provider ready
✓ search: hybrid mode (70/30 weights)
✓ capture: enabled (minLength: 50)
✓ server: port 7007

Configuration is valid!

Memento's configuration system provides sensible defaults that work for most users, while offering deep control for advanced use cases. Start with defaults, customize only what you need.

Released under the AGPL-3.0 License.