Skip to main content

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 brain CLI from the brain-memory npm package
  • Python 3.10+ — no pip dependencies

Docs & source

License

MIT © Omelas

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_brain_memory-0.1.0.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_brain_memory-0.1.0-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

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

Hashes for hermes_brain_memory-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7cd73436e4fb277583c75aa74bac981c5da9647575db63e1665c827fc82a3185
MD5 e8c4beaad61b652993fd6ee481ee6364
BLAKE2b-256 255f34e9360af9e5f933a340490f0cbfb78e1ff9acddc9c803bb791996730719

See more details on using hashes here.

File details

Details for the file hermes_brain_memory-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hermes_brain_memory-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74d4a6ac85a2a4ff5b46e6cb9cd23a0578c34a0528c9c43d299580c5337cedbd
MD5 ba12bbebdaf8d6ad65ed7bc86bd9b12c
BLAKE2b-256 ec549df1370ecdf02ce9116b390e56565487fa0fa5a7cb835687286574a9ba70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page