Configuration
Basic Memory can be configured through ~/.basic-memory/config.json or environment variables. Environment variables take precedence over config file settings.
Configuration File
Location: ~/.basic-memory/config.json
Example configuration:
{
"default_project": "main",
"default_project_mode": true,
"log_level": "INFO",
"sync_delay": 1000,
"kebab_filenames": false,
"disable_permalinks": false,
"sync_changes": true
}
Project Settings
projects
Mapping of project names to filesystem paths.
| Property | Value |
|---|---|
| Type | Dictionary |
| Default | {"main": "~/basic-memory"} |
| Example | {"work": "~/work-notes", "personal": "~/personal-notes"} |
default_project
Name of the default project used when no project is specified.
| Property | Value |
|---|---|
| Type | String |
| Default | "main" |
default_project_mode
Automatic project selection for single-project users. When enabled, AI assistants automatically use the default project without asking.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | false |
| Environment Variable | BASIC_MEMORY_DEFAULT_PROJECT_MODE |
Behavior:
- When
true, tools automatically use your default project - You can still override by explicitly passing a different project
- Best for users who primarily work in one project
project_root
Constrain all projects under a root directory.
| Property | Value |
|---|---|
| Type | String (optional) |
| Default | null (projects can be created anywhere) |
| Environment Variable | BASIC_MEMORY_PROJECT_ROOT |
When set, all project paths must be within this directory.
Sync Settings
sync_changes
Enable or disable real-time synchronization.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | true |
| Environment Variable | BASIC_MEMORY_SYNC_CHANGES |
When false, changes are not automatically synced to the database.
sync_delay
Milliseconds to wait after changes before syncing. Prevents excessive sync operations during rapid edits.
| Property | Value |
|---|---|
| Type | Integer |
| Default | 1000 (1 second) |
| Environment Variable | BASIC_MEMORY_SYNC_DELAY |
sync_thread_pool_size
Thread pool size for file I/O operations. Higher values may improve performance with many files.
| Property | Value |
|---|---|
| Type | Integer |
| Default | 4 |
| Environment Variable | BASIC_MEMORY_SYNC_THREAD_POOL_SIZE |
skip_initialization_sync
Skip expensive initialization sync. Useful for cloud/stateless deployments.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | false |
| Environment Variable | BASIC_MEMORY_SKIP_INITIALIZATION_SYNC |
watch_project_reload_interval
Seconds between reloading project list. Used in watch service to detect new projects.
| Property | Value |
|---|---|
| Type | Integer |
| Default | 30 |
| Environment Variable | BASIC_MEMORY_WATCH_PROJECT_RELOAD_INTERVAL |
File Management
kebab_filenames
Filename format for generated files.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | false |
| Environment Variable | BASIC_MEMORY_KEBAB_FILENAMES |
false: Preserves spaces and special characters (e.g.,My Important Note.md)true: Converts to kebab-case (e.g.,my-important-note.md)
update_permalinks_on_move
Update permalinks when files are moved.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | false |
| Environment Variable | BASIC_MEMORY_UPDATE_PERMALINKS_ON_MOVE |
When true, permalinks are updated to reflect new file location. When false, permalinks remain stable identifiers.
disable_permalinks
Disable automatic permalink generation.
| Property | Value |
|---|---|
| Type | Boolean |
| Default | false |
| Environment Variable | BASIC_MEMORY_DISABLE_PERMALINKS |
When true, new notes won't have permalinks added. Existing permalinks still work for reading.
Logging
log_level
Logging verbosity level.
| Property | Value |
|---|---|
| Type | String |
| Default | "INFO" |
| Options | "DEBUG", "INFO", "WARNING", "ERROR" |
| Environment Variable | BASIC_MEMORY_LOG_LEVEL |
Console Logging
Enable logging to console (environment variable only).
| Property | Value |
|---|---|
| Environment Variable | BASIC_MEMORY_CONSOLE_LOGGING |
| Values | true, false, 1, 0, yes, no |
| Default | false (logs to file only) |
Log file location: ~/.basic-memory/basic-memory-{process}.log
Environment Variables
All configuration can be overridden with environment variables using the BASIC_MEMORY_ prefix:
# Set default project mode
export BASIC_MEMORY_DEFAULT_PROJECT_MODE=true
# Change log level
export BASIC_MEMORY_LOG_LEVEL=DEBUG
# Enable console logging
export BASIC_MEMORY_CONSOLE_LOGGING=true
# Set custom sync delay
export BASIC_MEMORY_SYNC_DELAY=2000
Special Environment Variables
| Variable | Description | Default |
|---|---|---|
BASIC_MEMORY_HOME | Override default project location | ~/basic-memory |
BASIC_MEMORY_PROJECT_ROOT | Constrain project paths | (none) |
BASIC_MEMORY_CLOUD_MODE | Enable cloud mode | false |
BASIC_MEMORY_MCP_PROJECT | Lock MCP server to specific project | (none) |
Configuration Priority
Settings are applied in this order (highest to lowest priority):
Example:
# Config file has: "log_level": "INFO"
# Environment has: BASIC_MEMORY_LOG_LEVEL=DEBUG
# Result: DEBUG is used (environment wins)
Cloud Configuration
When using Basic Memory Cloud, additional configuration is stored in ~/.basic-memory/basic-memory-cloud.json:
{
"access_token": "...",
"refresh_token": "...",
"tenant_id": "...",
"expires_at": "..."
}
This file is managed automatically by bm cloud login and bm cloud logout.
Cloud-Specific Settings
| Variable | Description |
|---|---|
BASIC_MEMORY_CLOUD_MODE | Force cloud mode on/off |
BASIC_MEMORY_CLOUD_URL | Override cloud API URL (for development) |
Editing Configuration
Via Config File
# Edit configuration
vim ~/.basic-memory/config.json
# Restart MCP server for changes to take effect
# (Claude Desktop, VS Code, etc.)
Via CLI
# Set default project
basic-memory project default work
# View all projects
basic-memory project list
# Check current configuration
cat ~/.basic-memory/config.json
Via Environment
# Temporary (current session)
export BASIC_MEMORY_LOG_LEVEL=DEBUG
basic-memory status
# Permanent (add to ~/.bashrc or ~/.zshrc)
echo 'export BASIC_MEMORY_DEFAULT_PROJECT_MODE=true' >> ~/.bashrc
Ignore Patterns
Basic Memory respects ignore patterns to skip sensitive files during indexing.
Pattern Sources
- Global patterns:
~/.basic-memory/.bmignore(applied to all projects) - Project patterns:
{project}/.gitignore(applied to specific project)
Example .bmignore
# Sensitive files
.env
.env.*
*.key
credentials.json
# Build artifacts
node_modules/
__pycache__/
dist/
build/
# OS files
.DS_Store
Thumbs.db
# Database files
*.db
*.db-wal
*.db-shm
Benefits
- Security: Prevents indexing sensitive files like
.envor API keys - Performance: Skips unnecessary files like
node_modules/or build outputs - Cleaner knowledge base: Ignores OS and editor files
Files matching these patterns are automatically skipped during index sync and never indexed in your knowledge base.
Complete Settings Reference
| Setting | Type | Default | Environment Variable |
|---|---|---|---|
default_project | String | "main" | - |
default_project_mode | Boolean | false | BASIC_MEMORY_DEFAULT_PROJECT_MODE |
project_root | String | null | BASIC_MEMORY_PROJECT_ROOT |
sync_changes | Boolean | true | BASIC_MEMORY_SYNC_CHANGES |
sync_delay | Integer | 1000 | BASIC_MEMORY_SYNC_DELAY |
sync_thread_pool_size | Integer | 4 | BASIC_MEMORY_SYNC_THREAD_POOL_SIZE |
skip_initialization_sync | Boolean | false | BASIC_MEMORY_SKIP_INITIALIZATION_SYNC |
watch_project_reload_interval | Integer | 30 | BASIC_MEMORY_WATCH_PROJECT_RELOAD_INTERVAL |
kebab_filenames | Boolean | false | BASIC_MEMORY_KEBAB_FILENAMES |
update_permalinks_on_move | Boolean | false | BASIC_MEMORY_UPDATE_PERMALINKS_ON_MOVE |
disable_permalinks | Boolean | false | BASIC_MEMORY_DISABLE_PERMALINKS |
log_level | String | "INFO" | BASIC_MEMORY_LOG_LEVEL |

