Skip to content

Commit 2d3c30e

Browse files
committed
feat(hermes): support existing Basic Memory HTTP daemon
1 parent a5fb68e commit 2d3c30e

6 files changed

Lines changed: 1238 additions & 95 deletions

File tree

integrations/hermes/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
### Added
10+
- **Existing Streamable HTTP server mode.** Set `server_url` to connect the
11+
provider to a running Basic Memory MCP endpoint (for example,
12+
`http://127.0.0.1:8766/mcp`) without installing/spawning `bm` or creating a
13+
local project. Existing tool, prefetch, capture, cleanup, reconnect, and
14+
per-call project-routing behavior is retained. A reconnect retries only
15+
read/idempotent operations; ambiguous note mutations are never replayed.
16+
717
## [0.3.2] — 2026-05-23
818

919
### Fixed

integrations/hermes/README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ hermes plugins install basicmachines-co/basic-memory/integrations/hermes
1313
```
1414

1515
Hermes does not install a plugin's Python dependencies (it only prints them), so put the
16-
`mcp` package into the Hermes venv yourself:
16+
`mcp>=2,<3` package into the Hermes venv yourself:
1717

1818
```bash
1919
uv pip install --python ~/.hermes/hermes-agent/venv/bin/python "mcp>=2,<3"
@@ -28,7 +28,32 @@ memory:
2828
2929
If you run the gateway, restart it (`hermes gateway restart`). Done.
3030

31-
The plugin self-installs the `basic-memory` CLI on first init via `uv tool install basic-memory --prerelease=allow` (one-time ~10s pause if it isn't already present). The bm binary lands at `~/.local/bin/bm` — the same location a manual `uv tool install basic-memory` would produce, so a later manual install or upgrade is a no-op rather than a second install.
31+
In the default local/cloud modes, the plugin self-installs the `basic-memory` CLI on first init via `uv tool install basic-memory --prerelease=allow` (one-time ~10s pause if it isn't already present). The bm binary lands at `~/.local/bin/bm` — the same location a manual `uv tool install basic-memory` would produce, so a later manual install or upgrade is a no-op rather than a second install.
32+
33+
### Use an existing Basic Memory MCP server
34+
35+
If Basic Memory is already running as a shared MCP Streamable HTTP server, set
36+
`server_url` in `~/.hermes/basic-memory.json`. This mode connects directly to
37+
that endpoint and does not install or spawn `bm`, create a project, or modify
38+
Basic Memory's project registry. An explicit non-empty `project` is required
39+
in this mode (the provider fails closed with an actionable error if omitted),
40+
and is sent on each read/write call. Optional per-call `project` / `project_id`
41+
overrides continue to work.
42+
43+
```json
44+
{
45+
"server_url": "http://127.0.0.1:8766/mcp",
46+
"project": "main",
47+
"capture_per_turn": true,
48+
"capture_session_end": true,
49+
"capture_folder": "hermes-sessions"
50+
}
51+
```
52+
53+
`server_url` takes precedence over `mode`; omit it to retain the existing
54+
local/cloud behavior and CLI bootstrap. If an HTTP session drops, the provider
55+
reconnects once and retries only read/idempotent operations; an ambiguous note
56+
write or mutation is not replayed, so its original failure is surfaced.
3257

3358
### Prerequisites
3459

@@ -38,7 +63,7 @@ The plugin self-installs the `basic-memory` CLI on first init via `uv tool insta
3863
builds may lack repository-subdirectory plugin sources, and the `/bm-*` slash commands
3964
need Hermes ≥ v0.11.0
4065
- [`uv`](https://docs.astral.sh/uv/) on PATH (used for the bootstrap install)
41-
- The `mcp` Python package in the Hermes venv. Hermes never installs plugin Python
66+
- The `mcp>=2,<3` Python package in the Hermes venv. Hermes never installs plugin Python
4267
dependencies — it prints the ones declared in `plugin.yaml` — so run:
4368
```bash
4469
uv pip install --python ~/.hermes/hermes-agent/venv/bin/python "mcp>=2,<3"
@@ -136,7 +161,8 @@ Defaults are reasonable for local use:
136161
| Key | Default | Notes |
137162
|---|---|---|
138163
| `mode` | `local` | `local` (in-process) or `cloud` (route through BM Cloud API) |
139-
| `project` | `hermes-memory` | BM project name |
164+
| `server_url` | empty | Existing Basic Memory MCP Streamable HTTP endpoint. When set, connects directly and skips CLI/project setup. |
165+
| `project` | `hermes-memory` (local/cloud); required with `server_url` | BM project name |
140166
| `project_path` | `~/hermes-memory/` | Local mode only — where session notes land |
141167
| `capture_folder` | `hermes-sessions` | Folder within the project for session notes |
142168
| `capture_per_turn` | `true` | Append every turn to a session transcript |
@@ -238,7 +264,7 @@ BM_INTEGRATION=1 uv run --with pytest --with mcp pytest tests/test_integration.p
238264

239265
The unit suite stubs out Hermes-internal imports (`agent.memory_provider`, `tools.registry`) so it runs without a Hermes install. `mcp` is optional at unit-test time — its absence just makes `is_available()` return False, which the tests verify.
240266

241-
Integration tests require `BM_INTEGRATION=1`, `bm` CLI on PATH, and `mcp` Python package importable. Each session creates a unique throwaway BM project (under `tempfile.mkdtemp`) and removes it on teardown, so they never touch your real BM projects.
267+
Integration tests require `BM_INTEGRATION=1`, `bm` CLI on PATH, and `mcp>=2,<3` importable. Each session creates a unique throwaway BM project (under `tempfile.mkdtemp`) and removes it on teardown, so they never touch your real BM projects.
242268

243269
## License
244270

0 commit comments

Comments
 (0)