Brain Memory provider for Hermes Agent — local-first, cross-agent Markdown memory (~/.brain) shared with Claude Code, Codex, OpenCode, and OpenClaw. No runtime dependencies.
Project description
hermes-brain-memory
Brain Memory provider for Hermes Agent — one local-first memory shared across all your AI agents. The same human-readable Markdown store in ~/.brain/ is read and written by Claude Code, Codex, OpenCode, and OpenClaw, so Hermes remembers what your other agents learned — and vice versa.
Memories are plain Markdown files with YAML frontmatter (greppable, diffable, editable). They decay over time, strengthen with use (spaced reinforcement), and connect through an associative network with spreading activation. The model decides what to remember via explicit tools; the brain CLI scores recall deterministically.
Zero pip dependencies — this package and the provider it installs are Python stdlib only.
Install
# 1. The brain CLI (once, if you don't already use Brain Memory)
npm install -g brain-memory
# 2. This package + the provider
pip install hermes-brain-memory # or: uv tool install / pipx install hermes-brain-memory
hermes-brain-memory install # copies the provider into $HERMES_HOME/plugins/brain
Activate
hermes config set memory.provider brain
hermes memory setup # optional guided configuration
hermes memory status # verify: "brain" should show as installed & available
Or set it directly in $HERMES_HOME/config.yaml (usually ~/.hermes/config.yaml):
memory:
provider: brain
Only one external memory provider can be active at a time; Hermes' built-in MEMORY.md/USER.md memory keeps running alongside.
What it does
| Lifecycle | Behavior |
|---|---|
| Session start | Injects a budget-bounded context block from brain session-start: status line, pinned facts, procedural-skills index, relevant memory titles, memorize guidance |
| Pre-turn | Prefetches relevant memories for the user's message (background thread, non-blocking) |
| Tools | brain_recall (deterministic recall + full bodies + auto-reinforce), brain_memorize (validated store), brain_reinforce (spaced reinforcement by ID) |
| Pre-compression | Reminds the model to store un-memorized notable content before context is discarded |
| Session end | Appends a session entry to ~/.brain/contexts.json (last 20 kept) |
| Built-in memory writes | Mirrors MEMORY.md entries into ~/.brain as content-hash-deduplicated observations |
| Backup | ~/.brain is declared via backup_paths() so hermes backup captures it |
No transcript dumping: sync_turn does lightweight in-memory topic tracking only. Nothing leaves the machine unless you enable Brain's own sync (Brain Cloud or a private Git remote).
Installer commands
hermes-brain-memory install [--force] # copy/update the provider (idempotent; --force overwrites)
hermes-brain-memory uninstall # remove it ($HERMES_HOME/plugins/brain only — ~/.brain is untouched)
hermes-brain-memory status # install state, brain CLI, active memory.provider
HERMES_HOME (or --hermes-home PATH) selects the Hermes profile to install into; default ~/.hermes.
Configuration
Stored in $HERMES_HOME/brain.json (written by hermes memory setup); environment variables override.
| Key | Default | Env var | Description |
|---|---|---|---|
project |
hermes |
BRAIN_PROJECT |
Project label for context-dependent recall |
top_recall |
6 |
BRAIN_TOP_RECALL |
Max memories per recall (1–25) |
auto_reinforce |
true |
BRAIN_AUTO_REINFORCE |
Reinforce memories surfaced by brain_recall |
brain_bin |
brain |
BRAIN_BIN |
Path to the brain CLI |
sync_on_memorize |
false |
BRAIN_SYNC_ON_MEMORIZE |
Push each store to Brain Cloud / Git remote |
Requirements
- Hermes Agent (a version with pluggable memory providers)
- The
brainCLI from thebrain-memorynpm package - Python 3.10+ — no pip dependencies
Docs & source
- Brain Memory: brainmemory.ai
- Source & full integration docs: github.com/omelas-tech/brain (
integrations/hermes/) - Hermes memory providers: hermes-agent.nousresearch.com/docs/user-guide/features/memory-providers
License
MIT © Omelas
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hermes_brain_memory-0.1.0.tar.gz.
File metadata
- Download URL: hermes_brain_memory-0.1.0.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cd73436e4fb277583c75aa74bac981c5da9647575db63e1665c827fc82a3185
|
|
| MD5 |
e8c4beaad61b652993fd6ee481ee6364
|
|
| BLAKE2b-256 |
255f34e9360af9e5f933a340490f0cbfb78e1ff9acddc9c803bb791996730719
|
File details
Details for the file hermes_brain_memory-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hermes_brain_memory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74d4a6ac85a2a4ff5b46e6cb9cd23a0578c34a0528c9c43d299580c5337cedbd
|
|
| MD5 |
ba12bbebdaf8d6ad65ed7bc86bd9b12c
|
|
| BLAKE2b-256 |
ec549df1370ecdf02ce9116b390e56565487fa0fa5a7cb835687286574a9ba70
|