Configuration

Mnemosyne is configured via environment variables and an optional Hermes config.yaml file. All settings have sensible defaults — you can start using it with zero configuration.

Environment Variables

Storage & Memory Tiers

VariableDefaultDescription
MNEMOSYNE_DATA_DIR~/.hermes/mnemosyne/dataRoot data directory for SQLite database files
MNEMOSYNE_WM_MAX_ITEMS10000Maximum items in working memory (per session)
MNEMOSYNE_WM_TTL_HOURS24Working memory TTL in hours
MNEMOSYNE_EP_LIMIT50000Episodic recall scan limit
MNEMOSYNE_SLEEP_BATCH5000Sleep/consolidation batch size
MNEMOSYNE_SP_MAX1000Maximum scratchpad entries
MNEMOSYNE_RECENCY_HALFLIFE168Recency decay half-life in hours (default: 1 week)

Vector & Retrieval Weights

Mnemosyne uses hybrid scoring (vector + FTS5 + importance) for recall. These weights are configurable and auto-normalized per query.

VariableDefaultDescription
MNEMOSYNE_VEC_TYPEint8Vector quantization: float32, int8, or bit
MNEMOSYNE_VEC_WEIGHT0.5Vector similarity weight in hybrid scoring
MNEMOSYNE_FTS_WEIGHT0.3FTS5 text relevance weight
MNEMOSYNE_IMPORTANCE_WEIGHT0.2Importance score weight
MNEMOSYNE_TEMPORAL_HALFLIFE_HOURS24Temporal boost half-life in hours
MNEMOSYNE_BEAM_OPTIMIZATIONSfalseEnable BEAM benchmark optimizations (OR semantics, larger scans)

Tiered Degradation

Episodic memories degrade through 3 tiers over time. Tier 1 is full content, Tier 2 is LLM-summarized, Tier 3 is entity-extracted compressed signal.

VariableDefaultDescription
MNEMOSYNE_TIER2_DAYS30Days before Tier 1 degrades to Tier 2
MNEMOSYNE_TIER3_DAYS180Days before Tier 2 degrades to Tier 3
MNEMOSYNE_TIER1_WEIGHT1.0Recall score multiplier for Tier 1 memories
MNEMOSYNE_TIER2_WEIGHT0.5Recall score multiplier for Tier 2 memories
MNEMOSYNE_TIER3_WEIGHT0.25Recall score multiplier for Tier 3 memories
MNEMOSYNE_DEGRADE_BATCH100Max memories per degradation cycle
MNEMOSYNE_SMART_COMPRESStrueEnable entity-aware sentence extraction for Tier 3
MNEMOSYNE_TIER3_MAX_CHARS300Max characters for Tier 3 compressed content

Veracity Weights

Memories carry veracity labels that affect their recall weight. These multipliers tune how strongly each veracity level influences retrieval.

VariableDefaultDescription
MNEMOSYNE_STATED_WEIGHT1.0Recall multiplier for explicitly stated facts
MNEMOSYNE_INFERRED_WEIGHT0.7Recall multiplier for inferred facts
MNEMOSYNE_TOOL_WEIGHT0.5Recall multiplier for tool-generated output
MNEMOSYNE_IMPORTED_WEIGHT0.6Recall multiplier for imported facts
MNEMOSYNE_UNKNOWN_WEIGHT0.8Recall multiplier for uncategorized/legacy facts

Embeddings

Mnemosyne uses BAAI/bge-small-en-v1.5 via fastembed (384 dimensions, local ONNX) for embedding generation. No external API key is needed.

VariableDefaultDescription
MNEMOSYNE_EMBEDDING_MODELBAAI/bge-small-en-v1.5Embedding model (local fastembed or openai/* API)

Local LLM (Sleep Summarization)

The sleep/consolidation cycle can use a local or remote LLM to summarize grouped working memories before promoting them to episodic memory.

VariableDefaultDescription
MNEMOSYNE_LLM_ENABLEDtrueEnable LLM-based summarization during sleep
MNEMOSYNE_LLM_BASE_URLOpenAI-compatible API base URL for remote LLM
MNEMOSYNE_LLM_API_KEYAPI key for the remote LLM endpoint
MNEMOSYNE_LLM_MODELModel name for the remote LLM endpoint
MNEMOSYNE_LLM_MAX_TOKENS2048Max output tokens for generated summaries
MNEMOSYNE_LLM_N_THREADS4CPU threads for local LLM inference
MNEMOSYNE_LLM_N_CTX2048Context window size for the local LLM
MNEMOSYNE_LLM_REPOTheBloke/TinyLlama-1.1B-Chat-v1.0-GGUFGGUF model repository
MNEMOSYNE_LLM_FILEtinyllama-1.1b-chat-v1.0.Q4_K_M.ggufGGUF model filename

Host LLM Backend (Hermes Integration)

When running inside Hermes, the host agent can provide an LLM backend for consolidation — avoiding duplicate API calls.

VariableDefaultDescription
MNEMOSYNE_HOST_LLM_ENABLEDfalseRoute LLM calls through Hermes' authenticated client
MNEMOSYNE_HOST_LLM_PROVIDERProvider name override (e.g. openai-codex)
MNEMOSYNE_HOST_LLM_MODELModel name override
MNEMOSYNE_HOST_LLM_N_CTX32000Prompt context budget for host LLM path

Multi-Agent Identity

Filter memories by author and channel for multi-agent or multi-tenant deployments.

VariableDefaultDescription
MNEMOSYNE_AUTHOR_IDDefault author identifier
MNEMOSYNE_AUTHOR_TYPEAuthor category: human, agent, or system
MNEMOSYNE_CHANNEL_IDDefault channel identifier for cross-session memory

Auto-Sleep & SHMR

VariableDefaultDescription
MNEMOSYNE_AUTO_SLEEP_ENABLEDfalseEnable auto-sleep after N turns
MNEMOSYNE_SHMR_BATCH_SIZE50SHMR batch size for harmony cycles
MNEMOSYNE_SHMR_MAX_ITERATIONS3SHMR max iterations per cluster
MNEMOSYNE_SHMR_SIMILARITY_THRESHOLD0.70SHMR cosine similarity threshold
MNEMOSYNE_SHMR_HARMONY_THRESHOLD0.60SHMR harmony score threshold
MNEMOSYNE_LOG_TOOLSfalseOpt-in tool call logging in hermes_plugin
MNEMOSYNE_MCP_BANKdefaultDefault bank for MCP server

YAML Configuration

Mnemosyne integrates with the Hermes config.yaml file (not a standalone mnemosyne.yaml). Configure settings under the memory.mnemosyne key:

# config.yaml (Hermes project root)
memory:
mnemosyne:
  # Auto-sleep consolidation
  auto_sleep: false             # Auto-run sleep() when working memory exceeds threshold
  sleep_threshold: 50           # Working memory count before auto-sleep triggers

  # Vector configuration
  vector_type: int8             # Quantization: float32, int8, or bit

  # Pattern filtering
  ignore_patterns:              # Content patterns to skip during remember()
    - "be ACTIVE"               # Skill refinement boilerplate
    - "nothing to change"       # No-op responses
    - "skill.*refined"          # Wildcard match

Config file lookup order (first found wins):

  1. ./config.yaml (current working directory)
  2. ~/.hermes/mnemosyne/config.yaml (user-level)
  3. Environment variables (fallback for any setting not in config.yaml)

Programmatic Configuration

No config file is needed. You can create a Mnemosyne instance directly in Python:

from mnemosyne import Mnemosyne

mem = Mnemosyne(
  session_id="my-agent",        # Scope working memories to this session
  db_path="./my-memory.db",     # Custom SQLite database path (optional)
  bank="work",                  # Named memory bank for isolation
  author_id="alice",            # Multi-agent identity
  author_type="human",          # "human", "agent", or "system"
  channel_id="team-slack",      # Cross-session channel
)
ParameterTypeDefaultDescription
session_idstr"default"Session identifier for scoping working memories
db_pathstr | NoneNonePath to the SQLite database file (auto-created if None)
bankstr | NoneNoneNamed memory bank — each bank gets its own isolated SQLite file under data_dir/banks/
author_idstr | NoneNoneAuthor identifier for multi-agent memory scoping
author_typestr | NoneNoneAuthor category: "human", "agent", or "system"
channel_idstr | NoneNoneChannel identifier for cross-session shared memory
Local-first by default

Mnemosyne requires no external API keys for basic usage. Embeddings use BAAI/bge-small-en-v1.5 via fastembed (384-dimensional, local ONNX runtime). The sleep/consolidation cycle defaults to a local TinyLlama GGUF model. You only need API keys if you configure a remote LLM endpoint via MNEMOSYNE_LLM_BASE_URL.