Configuration

July 16, 2026 · View on GitHub

SuperLocalMemory V3 Documentation https://superlocalmemory.com | Part of Qualixar

Control how SuperLocalMemory stores, retrieves, and processes your memories.


Three Operating Modes

For the published LoCoMo result scopes behind Modes A and C, see Benchmark Evidence. Mode B has no separately published LoCoMo run.

SuperLocalMemory runs in one of three modes. You pick the trade-off between privacy and power.

ModeWhat it doesNeeds API key?Data leaves your machine?
A: LocalRetrieval without a model-provider call in the core path.NoOptional integrations may transmit data
B: Local LLMMode A + a local LLM via Ollama.NoDepends on the Ollama endpoint and optional integrations
C: Cloud LLMMode B + configured cloud-provider enrichment and/or answer construction.YesConfigured query, ingestion, or enrichment content may be sent

Check your current mode

slm mode

Switch modes

slm mode a    # Zero-cloud (default)
slm mode b    # Local LLM
slm mode c    # Cloud LLM

Switching modes takes effect immediately. No data is lost.

Mode A: Zero-Cloud (Default)

Core memory operations run against the local data root. Optional model and dependency downloads, connectors, backup, and other enabled integrations can use the network.

Best for: deployments that want a local core path and can govern optional integrations explicitly. Regulatory compliance still requires deployment-specific assessment.

Mode B: Local LLM

Everything from Mode A, plus a local LLM (via Ollama) that improves recall by understanding query intent and reranking results.

Setup:

# Install Ollama using its reviewed package/instructions for your platform.
# macOS example:
brew install ollama

# Pull a model
ollama pull llama3.2

# Switch to Mode B
slm mode b

Best for: developers who can operate the selected local model and separately govern optional networked integrations.

Mode C: Cloud LLM

Everything from Mode B, plus a cloud LLM for cross-encoder reranking and agentic multi-round retrieval. Highest recall quality.

Setup:

slm mode c
slm provider set openai

You will be prompted for your API key (stored locally in your config file, never transmitted except to the provider you choose).

Best for: deployments that have approved the configured provider data path.

Provider Configuration

Mode C supports multiple LLM providers.

Set your provider

slm provider           # Show current provider
slm provider set       # Interactive provider selector

Supported providers

ProviderCommandEnv variable
OpenAIslm provider set openaiOPENAI_API_KEY
Anthropicslm provider set anthropicANTHROPIC_API_KEY
Azure OpenAIslm provider set azureAZURE_OPENAI_API_KEY
Ollama (local)slm provider set ollamaNone needed
OpenRouterslm provider set openrouterOPENROUTER_API_KEY

Set API keys

You can set keys interactively or via environment variables:

# Interactive (stored in config file)
slm provider set openai
# Prompts: Enter your OpenAI API key: sk-...

# Via environment variable (takes precedence)
export OPENAI_API_KEY="sk-..."

Config File

All settings live in:

~/.superlocalmemory/config.json

Example config

{
  "mode": "a",
  "profile": "default",
  "provider": {
    "name": "openai",
    "model": "gpt-4o-mini",
    "api_key_env": "OPENAI_API_KEY"
  },
  "auto_capture": true,
  "auto_recall": true,
  "embedding_model": "all-MiniLM-L6-v2",
  "max_recall_results": 10,
  "retention": {
    "default_policy": "indefinite"
  }
}

Key settings

SettingDefaultDescription
mode"a"Operating mode: a, b, or c
profile"default"Active memory profile
auto_capturetrueAutomatically store decisions and context
auto_recalltrueAutomatically inject relevant memories
embedding_model"all-MiniLM-L6-v2"Sentence transformer for semantic search
max_recall_results10Maximum memories returned per query

Environment Variables

These override config file settings when set:

VariablePurpose
SLM_MODEOverride operating mode
SLM_PROFILEOverride active profile
SLM_DATA_DIROverride data directory (default: ~/.superlocalmemory/)
OPENAI_API_KEYOpenAI API key for Mode C
ANTHROPIC_API_KEYAnthropic API key for Mode C
AZURE_OPENAI_API_KEYAzure OpenAI API key for Mode C
OPENROUTER_API_KEYOpenRouter API key for Mode C

Database Location

All data is stored locally in:

~/.superlocalmemory/memory.db    # SQLite database
~/.superlocalmemory/config.json  # Configuration
~/.superlocalmemory/backups/     # Automatic backups

To use a custom location:

export SLM_DATA_DIR="/path/to/your/data"

Multi-Machine Mesh (v3.4.48+)

VariableDefaultDescription
SLM_MESH_PEER_URLunsetFull URL of remote SLM instance (e.g., http://192.168.1.100:8765)
SLM_MESH_SHARED_SECRETunsetShared bearer token — same on both machines. Required when SLM_MESH_HOST is not localhost.
SLM_MESH_HOST127.0.0.1IP to bind this machine's mesh listener
SLM_MESH_WS_PORT7900Port used for mDNS service announcement
SLM_MESH_DISCOVERYonSet to off to disable mDNS auto-discovery

See Multi-Machine Setup for full setup guide.


Optimize Configuration (v3.6)

SLM v3.6 adds the Optimize module — Cache + Compress + Align for LLM cost reduction. Configuration lives in a separate file at ~/.superlocalmemory/optimize.json and hot-reloads within 2 seconds — no daemon restart required.

Master Switches

SettingDefaultDescription
optimize enabledtrueMaster ON/OFF
cache enabledtrueCache lookups (exact match)
semantic cachefalsevCache semantic (opt-in)
compressionsafesafe (lossless) or aggressive (lossy prose allowed)

Quick Toggle via CLI

slm optimize on                     # Enable all
slm optimize off                    # Disable all
slm cache semantic on               # Enable semantic cache
slm compress mode aggressive        # Enable aggressive compression

Config File Location

~/.superlocalmemory/optimize.json   # Written by UI, CLI, and API

Hot-Reload

The daemon polls this file every 2 seconds. On change, all settings take effect without restart. Config version is auto-incremented for change tracking.

Full Reference

See docs/optimize-config.md for all 45+ config fields with defaults and descriptions.


SuperLocalMemory V3 — Copyright 2026 Varun Pratap Bhardwaj. AGPL-3.0-or-later. Part of Qualixar.