Skip to content

neilharding/hermes_memorypalace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MemPalace

A memory provider plugin for Hermes Agent (v0.7.0+) that replaces the default flat memory layer with workspace-scoped, vector-searchable hierarchical memory.

Uses ChromaDB for vector similarity search and SQLite for relational storage. A lightweight local embedding model (all-MiniLM-L6-v2, ~50MB) keeps everything fast and offline.

Key Features

  • Workspace isolation — memories in Project A never bleed into Project B
  • Explicit-first ranking — deliberate user instructions always surface above auto-extracted context
  • Dual-store architecture — SQLite for canonical data, ChromaDB for semantic search
  • Zero config — storage paths derive from $HERMES_HOME, no API keys needed
  • Non-blocking — turn sync runs in a background thread

Architecture

Memories are organized into a two-level hierarchy:

Wings (scope)              Rooms (priority)
├── Global_User      ──►  ├── Explicit  (user instructions, preferences)
│                         └── Implicit  (auto-extracted context)
└── Workspace_[ID]   ──►  ├── Explicit
                          └── Implicit

Search queries hit the current workspace wing + the global wing, with explicit results always ranked before implicit ones.

Tools

Tool Purpose
mempalace_remember_explicit Store a deliberate user instruction or preference (high priority)
mempalace_store_implicit Store extracted project context or environment details (lower priority)
mempalace_recall Semantic search across memory with explicit-first ranking

Installation

Quick

git clone https://github.com/neilharding/hermes_memorypalace.git
cd hermes_memorypalace
./scripts/deploy.sh
hermes gateway restart
hermes doctor

Manual

# 1. Install dependencies
pip install chromadb sentence-transformers

# 2. Clone and symlink into Hermes plugins
git clone https://github.com/neilharding/hermes_memorypalace.git
ln -sf "$(pwd)/hermes_memorypalace/mempalace" \
    ~/.hermes/hermes-agent/plugins/memory/mempalace

# 3. Activate
hermes config set memory.provider mempalace

# 4. Verify
hermes gateway restart
hermes doctor

Storage

All data is stored locally under $HERMES_HOME/mempalace/:

Backend Default Path Override Env Var
SQLite $HERMES_HOME/mempalace/mempalace.db MEMPALACE_DB_PATH
ChromaDB $HERMES_HOME/mempalace/chroma_storage/ MEMPALACE_CHROMA_PATH

Development

# Run tests (uses the Hermes venv for access to the MemoryProvider ABC)
~/.hermes/hermes-agent/venv/bin/python -m pytest tests/ -v

# 37 tests: 11 store, 22 provider, 4 E2E integration

How It Works

The plugin implements Hermes's MemoryProvider ABC and hooks into the agent lifecycle:

Lifecycle Hook What MemPalace Does
initialize() Bootstraps SQLite schema + ChromaDB collection with embedding model
system_prompt_block() Injects L1 summary (global profile + workspace explicit memories)
prefetch(query) Runs vector search, returns priority-ranked results before each turn
sync_turn(user, assistant) Background thread stores conversation as implicit context
on_memory_write(action, target, content) Mirrors built-in MEMORY.md writes to MemPalace global wing
handle_tool_call(name, args) Dispatches the 3 memory tools

License

MIT

About

MemPalace memory provider plugin for Hermes Agent — workspace-scoped hierarchical memory with ChromaDB + SQLite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages