betterdb-hermes-memory
A Hermes memory provider backed by
betterdb-agent-memory on
Valkey / valkey-search.
It gives a Hermes agent durable, semantic long-term memory: each completed turn is
embedded and written to a Valkey vector index, and the next turn recalls the most
relevant memories — ranked by a composite of similarity, recency (half-life decay),
and importance — and injects them as a recall block. It also exposes explicit
betterdb_remember / betterdb_recall / betterdb_forget tools.
How it maps to the MemoryProvider contract
| SDK operation | Hermes hook |
|---|---|
MemoryStore.recall() |
queue_prefetch() (background) → prefetch() cache |
MemoryStore.remember() |
sync_turn() (per turn) + on_memory_write() mirror |
MemoryStore.forget() |
betterdb_forget tool |
prefetch() is non-blocking: queue_prefetch() submits the recall to a background
event loop and stashes a formatted block in an in-memory cache; prefetch() only
reads that cache, so a turn never waits on a Valkey round-trip. is_available() is
network-free — it checks that the SDK imports, a connection target is configured,
and an embedding source is resolvable.
Requirements
- Python 3.11–3.14 (matches Hermes's own
>=3.11,<3.15). - A Valkey server with the Search module (e.g.
valkey/valkey-bundle). - An embeddings endpoint.
betterdb-agent-memorydoes not ship an embedding model — you point this provider at an OpenAI-compatible/v1/embeddingsendpoint (OpenAI, Azure OpenAI, Ollama, vLLM, LM Studio, a gateway, …).
Install
As a dropped-in plugin
Copy the package into your Hermes plugins directory and select it:
cp -r packages/hermes-memory-py/betterdb_hermes_memory ~/.hermes/plugins/betterdb
# then, in Hermes config, set: memory.provider: betterdb
As a pip package (entry point)
pip install betterdb-hermes-memory
The package registers the hermes_agent.memory_providers entry point
betterdb = betterdb_hermes_memory:register, so Hermes discovers it by name. Select
it with memory.provider: betterdb.
Configuration
Run hermes memory setup for the provider, or set the fields directly. Non-secret
fields live in config.yaml under memory.betterdb; secrets go to the scoped
secret store (env vars).
| Field | Env (secrets) | Default |
|---|---|---|
host |
— | 127.0.0.1 |
port |
— | 6379 |
db |
— | 0 |
username |
— | (none) |
password |
BETTERDB_MEMORY_PASSWORD |
(none) |
tls |
— | false |
url |
BETTERDB_MEMORY_URL |
(overrides host/port) |
store_name |
— | hermes |
namespace |
— | (none) |
embeddings_model |
— | text-embedding-3-small |
embeddings_base_url |
— | https://api.openai.com/v1 |
embeddings_api_key |
BETTERDB_MEMORY_EMBEDDINGS_API_KEY |
(none) |
A custom embeddings_base_url (a local/self-hosted endpoint) is treated as needing
no key; the hosted default requires embeddings_api_key.
Notes on the embeddings requirement
The SDK's MemoryStore takes an embed_fn that the host supplies — it is required
for remember / recall / ensure_index. Because Hermes does not hand providers
an embedding seam, this provider resolves one from the embeddings config above
(see embeddings.py). You can also inject an embed_fn directly into
BetterDBMemoryProvider(...) if you wire the provider yourself.
Development
pip install -e ".[dev]"
pytest
The unit tests mock the SDK client and the event-loop runtime, so they need neither a live Valkey nor an embeddings endpoint.
License
MIT
Metadata
Release files for betterdb-hermes-memory 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| betterdb_hermes_memory-0.1.0.tar.gz | 27.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| betterdb_hermes_memory-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.4 kB
Release files / betterdb_hermes_memory-0.1.0.tar.gz
| Download URL | betterdb_hermes_memory-0.1.0.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80e4ba568f140737c187bc565a9a49768a92d004d73dc90c164de593e62effe2
|
|
BLAKE2b-256 checksum How to use checksums |
c21b21307895e40b46d8d2ad2ecd14fdd6c0470896dfca4e3635e19406a8a7d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.
Transparency logRelease files / betterdb_hermes_memory-0.1.0-py3-none-any.whl
| Download URL | betterdb_hermes_memory-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c85e6f43f6968c615c962f50911d79a7f150649805663318a9cd5aa88774ba7a
|
|
BLAKE2b-256 checksum How to use checksums |
b31ead59658f88155f4ece83333df84111f2385ffb1f3421c283aba6e5221081
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.
Transparency log