Skip to content

feat(integrations): Hermes Agent memory provider for BrainDB - #17

Merged
dimknaf merged 4 commits into
mainfrom
feat/hermes-integration
Jun 14, 2026
Merged

feat(integrations): Hermes Agent memory provider for BrainDB#17
dimknaf merged 4 commits into
mainfrom
feat/hermes-integration

Conversation

@dimknaf

@dimknaf dimknaf commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

Adds a native memory-provider plugin so Hermes Agent can use a self-hosted BrainDB as its long-term memory, plus the two small endpoints it relies on and a hardened test sandbox.

Plugin (integrations/hermes/braindb/)

  • Agent-only gateway: braindb_ask(query) reaches all of BrainDB through one tool (recall / save / relate / reason via BrainDB's own internal agent); braindb_ingest(file_path) uploads a local file for ingestion.
  • Agent usage instructions are loaded live from BrainDB's /skill endpoint, so there is no copied prompt to keep in sync.
  • Standard Hermes MemoryProvider (register / plugin.yaml / JSON tool returns), verified against the real Hermes source.

BrainDB endpoints (only core change - additive, isolated)

New braindb/routers/integrations.py (plus one include_router line in main.py), commented as external-integration:

  • GET /api/v1/skill/{name} - serves a shipped skill's markdown (sanitized name, 404 if missing).
  • POST /api/v1/entities/datasources/upload - lands an uploaded file in data/sources/ for the existing watcher to ingest (filename sanitize, extension allow-list, size cap, no-overwrite). No new ingestion logic.

No existing route, schema, or behaviour is modified.

Sandbox (integrations/hermes/sandbox/)

A tool-stripped, containerized way to run Hermes against a throwaway BrainDB on an isolated host (compose + config template + README). The committed config hardcodes no model.

Install

Copy the plugin folder into ~/.hermes/plugins/braindb, then run hermes memory setup.

Tests

  • New tests/test_integrations.py covers both endpoints.
  • Full suite green: 154 passed, 9 deselected (agent-LLM tests); py_compile clean.
  • End-to-end verified on an isolated Raspberry Pi: Hermes called braindb_ask (fact saved + recalled) and braindb_ingest (file uploaded, watcher extracted facts, recalled).

Notes

  • BrainDB has no auth; docs recommend co-locating Hermes + BrainDB on loopback (a remote BrainDB needs your own auth/tunnel).
  • Follow-up (not in this PR): document one-command hermes plugins install git self-install once runtime-confirmed.

dimknaf added 4 commits June 13, 2026 22:49
Native Hermes MemoryProvider (integrations/hermes/braindb): agent-only gateway --
braindb_ask -> /agent/query (the whole of BrainDB) and braindb_ingest -> file
upload. Loads its usage skill live from BrainDB, so there is no duplicated prompt.

Relies on two small ADDITIVE BrainDB endpoints, isolated in a new
braindb/routers/integrations.py (+1 include_router line in main.py): GET
/api/v1/skill/{name} and POST /api/v1/entities/datasources/upload. No existing
route, schema, or behaviour is modified.

Adds a hardened, tool-stripped docker sandbox (integrations/hermes/sandbox) to run
Hermes against a throwaway BrainDB on an isolated host. Tests for both endpoints;
full suite green.
… path

- Remove all Llama-3.3-70B references. The sandbox template no longer hardcodes
  any model: model.default + model.api_key are blank placeholders, filled only in
  the gitignored Pi copy (hermes-data/config.yaml).
- Disable the correct toolset name 'code_execution' (was 'execute_code', which
  left code execution enabled).
- User memory-plugin path is FLAT (~/.hermes/plugins/<name>/): fix the compose
  mount target, the plugin + sandbox READMEs, and the plugin docstring.
- Sync the sandbox compose to the working form: default caps + non-root UID (the
  image's s6 init needs CHOWN/SETUID/SETGID, so cap_drop ALL broke startup).
- Drop the vestigial .env.example (the key now lives in config.yaml model.api_key).
Brief "Integrations" section in README.md linking to integrations/hermes/ (the
provider plugin + the test sandbox), and note the folder in CLAUDE.md's project
structure (+ list the new integrations.py router). Signpost only — the detailed
docs live in integrations/hermes/.
Hermes discovers memory providers by scanning plugin folders, not via pip/entry points, so the listed pip package could never register the provider (and naming an unowned PyPI package invites a squat). Keep only the verified folder-copy install.
@dimknaf
dimknaf merged commit b1193c3 into main Jun 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant