Mnemosyne + OpenWebUI

May 29, 2026 ยท View on GitHub

Add persistent memory to OpenWebUI via a native @tool.

Setup

  1. Install Mnemosyne:
pip install mnemosyne-memory
  1. Create a bridge file in OpenWebUI's data/tools/ directory:
echo "from openwebui_tool import MnemosyneTool as Mnemosyne" \
  > /path/to/open-webui/data/tools/mnemosyne.py
  1. In OpenWebUI, go to Workspace > Tools. The mnemosyne tool appears automatically (hot-reloaded).

  2. In a chat, select the Mnemosyne tool from the model's tool dropdown.

Configuration

The tool provides a settings panel in OpenWebUI with these Valves:

SettingDefaultDescription
db_path~/.hermes/mnemosyne/data/Path to memory database directory
bankdefaultMemory bank name for isolation
top_k5Max results returned by recall
vec_weightnull (env default)Vector search weighting
fts_weightnull (env default)Full-text search weighting
importance_weightnull (env default)Importance boost weighting
show_citationstrueShow source citations in output

These settings are persisted per-user in OpenWebUI's database.

Usage

The tool provides these operations:

OperationDescription
mnemosyne_rememberStore a memory
mnemosyne_recallSearch memories by semantic similarity
mnemosyne_forgetDelete a specific memory
mnemosyne_statsView memory statistics
mnemosyne_sleepRun consolidation

The LLM decides when to use each tool based on the conversation context.

Tips

  • Memory isolation: Use different banks per chat/workspace for privacy
  • Data location: Override MNEMOSYNE_DATA_DIR env var to change storage path
  • Testing: Import the tool in Python directly to verify it works:
    import asyncio
    from openwebui_tool import MnemosyneTool
    tool = MnemosyneTool()
    result = asyncio.run(tool.mnemosyne_remember("test memory"))
    print(result)