Skip to main content

Hermes Agent memory provider plugin backed by Cashew thought-graph memory.

Project description

hermes-cashew

A Hermes Agent memory provider plugin that stores conversation context in a local Cashew thought graph. Get from zero to a working install in under five minutes.

Prerequisites

  • Hermes Agent installed
  • cashew-brain — installed automatically by hermes plugins install or manually:
    ~/.hermes/hermes-agent/venv/bin/python3 -m ensurepip  # bootstrap pip if missing
    ~/.hermes/hermes-agent/venv/bin/python3 -m pip install \
      "cashew-brain @ git+https://github.com/rajkripal/cashew.git@90d1c73"
    

Install

hermes plugins install magnus919/hermes-cashew

This clones the repository to ~/.hermes/plugins/cashew/ and registers the plugin entry point. After install, restart the gateway:

hermes gateway restart

Register with Hermes

After installing, set cashew as the active memory provider:

hermes config set memory.provider cashew
hermes gateway restart

Note: hermes memory setup shows a hardcoded list of providers and does not yet include cashew in the interactive picker. Use hermes config set to activate it directly.

Configure

Create ~/.hermes/cashew.json with your settings:

cat > ~/.hermes/cashew.json << 'EOF'
{
  "cashew_db_path": "cashew/brain.db",
  "embedding_model": "sentence-transformers/all-MiniLM-L6-v2",
  "recall_k": 5,
  "sync_queue_timeout": 30
}
EOF
Key Default Description
cashew_db_path cashew/brain.db Path to the SQLite DB, relative to hermes_home
embedding_model sentence-transformers/all-MiniLM-L6-v2 Embedding model for retrieval
recall_k 5 Maximum nodes returned per recall query
sync_queue_timeout 30 Seconds to wait for the sync worker to drain on shutdown

Verify the Install

hermes gateway restart   # ensure gateway picks up the new plugin
hermes memory status

Expected output shows Provider: cashew with Plugin: installed and Status: available.

How It Works

hermes-cashew provides two LLM-accessible tools:

  • cashew_query — searches the local thought graph for context relevant to the current conversation. The agent calls this automatically during prefetch().
  • cashew_extract — explicitly persists a conversation turn into the graph. The agent can call this when it judges a turn contains worth-remembering knowledge.

Both tools are registered automatically when Hermes loads the plugin.

Uninstall

hermes plugins remove cashew
hermes config set memory.provider built-in   # revert to built-in memory
rm -rf ~/.hermes/cashew   # optional: remove the local graph data

Troubleshooting

Plugin: NOT installed in hermes memory status

This has two common causes:

  1. cashew-brain not installed in Hermes venvhermes plugins install does not automatically install Python package dependencies into Hermes's venv. Install it manually:

    ~/.hermes/hermes-agent/venv/bin/python3 -m ensurepip
    ~/.hermes/hermes-agent/venv/bin/python3 -m pip install \
      "cashew-brain @ git+https://github.com/rajkripal/cashew.git@90d1c73"
    
  2. Stale pycache or entry point not registered — If cashew-brain is installed but the plugin still shows NOT installed, the entry point may not be registered:

    cd ~/.hermes/plugins/cashew && \
      ~/.hermes/hermes-agent/venv/bin/python3 -m pip install -e .
    hermes gateway restart
    

Plugin: installed but Status: not available

Ensure ~/.hermes/cashew.json exists. The plugin's is_available() checks for this file's presence. Create it with the default config shown above.

Hermes-agent venv has no pip

Hermes-agent creates a minimal venv without pip. Bootstrap it first:

~/.hermes/hermes-agent/venv/bin/python3 -m ensurepip
~/.hermes/hermes-agent/venv/bin/python3 -m pip install <package>

Do not run pip install from outside the venv targeting the hermes python, or the package will land in the wrong environment.

Embedding model download on first use

cashew-brain bundles sentence-transformers. The first retrieval operation may trigger a ~500 MB embedding model download. To avoid this in automated environments:

HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 HF_DATASETS_OFFLINE=1 hermes ...

Development

# Clone the repo first
git clone https://github.com/magnus919/hermes-cashew
cd hermes-cashew

pip install -e ".[dev]"   # macOS
python3 -m pip install -e ".[dev]"   # Linux
pytest                      # run the test suite

Tests require no network access and mock the embedding model automatically (HF_HUB_OFFLINE=1 is set by tests/conftest.py).

Architecture Notes

The plugin uses a dual-path loading strategy to support both pip install -e . (development) and hermes plugins install (flat-entry loader):

  • pip / test path: Python's namespace package mechanism resolves plugins.memory.cashew to plugins/memory/cashew/__init__.py via sys.path
  • flat-entry path: Hermes loads ~/.hermes/plugins/cashew/__init__.py as _hermes_user_memory.cashew. The root __init__.py detects this context and exec's the nested implementation with sys.modules patched so relative imports resolve correctly

License

See LICENSE.

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_cashew-0.1.4.tar.gz (54.7 kB view details)

Uploaded Source

Built Distribution

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

hermes_cashew-0.1.4-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file hermes_cashew-0.1.4.tar.gz.

File metadata

  • Download URL: hermes_cashew-0.1.4.tar.gz
  • Upload date:
  • Size: 54.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hermes_cashew-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1df1099f7f39d0801e392cd32d3d47ccd201aba9522ab6e8d22f60e8f912e261
MD5 a73c455e151226b2ffc14f22c083d767
BLAKE2b-256 885d5ccbfc263842e5239a6d04d6f16ef477fa4676ef43257867adfc4123faaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for hermes_cashew-0.1.4.tar.gz:

Publisher: release.yml on magnus919/hermes-cashew

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hermes_cashew-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: hermes_cashew-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hermes_cashew-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a204b25e55bca3da8e1b548e4e4fadf663ddd3d09499613787ce21087501fb22
MD5 2064cc3b926b326c6495c0c49e230910
BLAKE2b-256 915632c77437c8ac7615ac9f0a643c65446722fa577c4a2a0d29364d15538c54

See more details on using hashes here.

Provenance

The following attestation bundles were made for hermes_cashew-0.1.4-py3-none-any.whl:

Publisher: release.yml on magnus919/hermes-cashew

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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