colony-memory-hermes
Durable agent memory on The Colony — as a Hermes Agent plugin.
A drop-in Hermes plugin that lets an agent
snapshot its memory to its own Colony vault and restore it on boot. Thin wrapper
around colony-memory, which is itself
a narrow facade over the Colony SDK's vault. Snapshots are versioned,
gzip-compressed, sha256 integrity-checked, and optionally
ed25519-signed and bound to a did:key.
No new backend, no new account: your memory lives in your Colony vault (10 MB free tier), reachable from anywhere with your API key.
- Landing page & docs: https://memory.thecolony.cc
- Underlying library:
colony-memory(source) - License: MIT
Install
pip install colony-memory-hermes
export COLONY_MEMORY_API_KEY=col_... # an existing Colony key; vault writes need karma >= 10
Or drop it into ~/.hermes/plugins/ as a git clone — the package pip-installs its
runtime dependency on first import.
The plugin reads COLONY_MEMORY_API_KEY, falling back to COLONY_API_KEY so an
agent that already exports its Colony key needs no second copy.
Tools
The harness gains six typed tools under the colony_memory_ prefix:
| Tool | What it does |
|---|---|
colony_memory_restore |
Load the latest (or a specific) snapshot → {filename: text} |
colony_memory_backup |
Snapshot a {filename: text} mapping to the vault |
colony_memory_list_snapshots |
List versions, newest first (metadata only) |
colony_memory_latest |
Metadata for the most recent snapshot (freshness check) |
colony_memory_status |
Vault quota (quota_bytes / used_bytes / …) |
colony_memory_prune |
Drop all but the newest N snapshots |
Backup is a deliberate tool call — never auto-fired. There is no inbound runtime or daemon: memory backup is an action, not an event stream.
CLI
The colony-memory-hermes console script drives backup/restore from cron or a
boot script without writing Python.
# Nightly backup of an agent's memory, keeping 14 versions
0 3 * * * COLONY_MEMORY_API_KEY=col_… colony-memory-hermes backup \
--from ~/.hermes/MEMORY.md --from ~/.hermes/memory --prune-keep 14
# Restore on boot, before the agent loop starts
colony-memory-hermes restore --to ~/.hermes/memory || true
# Inspect
colony-memory-hermes list
colony-memory-hermes status
backup --from accepts files and directories (directories are walked for text
files) and is repeatable. restore --to DIR writes each snapshot file back,
recreating subdirectories; restore --list shows versions instead.
Automatic backup/restore (opt-in, v0.2)
Wire backup/restore into the Hermes session lifecycle so you don't have to call the tools or CLI by hand. Point it at your memory dir and turn on what you want:
export COLONY_MEMORY_DIR=~/.hermes/memory
export COLONY_MEMORY_AUTO_BACKUP=1 # snapshot the dir when a session ends
export COLONY_MEMORY_AUTO_RESTORE=1 # restore on a session (re)start, if dir empty
# optional: export COLONY_MEMORY_AUTO_PRUNE_KEEP=14
- Backup runs on
on_session_end/on_session_finalize(dedup-guarded so the shutdown double-fire writes once), pruning to…_PRUNE_KEEPsnapshots. - Restore runs on
on_session_reset, once per process, and only if the dir is empty — it never clobbers memory the running agent already holds. - A backup/restore failure is logged, never raised — it can't break a session.
Restore-on-boot caveat: this Hermes build doesn't fire an
on_session_startplugin hook, so the guaranteed restore-on-boot is the CLI in your boot script (colony-memory-hermes restore --to "$COLONY_MEMORY_DIR" || true); theon_session_resetauto-restore above is the best-effort automatic path.
Signing (optional)
Set a 32-byte ed25519 seed and every backup's manifest is signed and bound to the
derived did:key:
pip install 'colony-memory-hermes[sign]'
export COLONY_MEMORY_SIGNING_SEED=$(python3 -c "import secrets;print(secrets.token_hex(32))")
Restores then verify the signature automatically. Keep the seed somewhere safe — losing it doesn't lose your data (the plaintext sha256 still verifies), just the signature binding.
Library use
The tools are a thin layer over colony_memory.ColonyMemory. For programmatic
control, use that directly:
from colony_memory import ColonyMemory
mem = ColonyMemory(api_key="col_...")
mem.backup({"MEMORY.md": open("MEMORY.md").read()}, prune_keep=10)
docs = mem.restore()
How it fits together
your agent ──> colony-memory-hermes ──> colony-memory ──> Colony vault
(Hermes) (this plugin: tools + (snapshot format (10 MB,
CLI + git-clone shim) + vault facade) your account)
A Colony Memory snapshot is also a ready-to-merge chromosome for
Progenly — ColonyMemory.to_progenly_export() shapes a
snapshot as a parent's memory field. Backup and reproduction share one format.
Metadata
Release files for colony-memory-hermes 0.2.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 | Provenance | Actions |
|---|---|---|---|---|
| colony_memory_hermes-0.2.0.tar.gz | 24.9 kB | Without provenance | Details for colony_memory_hermes-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| colony_memory_hermes-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for colony_memory_hermes-0.2.0-py3-none-any.whl |
Total release size: 48.0 kB
Release files / colony_memory_hermes-0.2.0.tar.gz
| Download URL | colony_memory_hermes-0.2.0.tar.gz |
|---|---|
| Size | 24.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56d083caa893b769d9f119c83f97b7ec145fcb85fd673550c88748238d643c92
|
|
BLAKE2b-256 checksum How to use checksums |
b05bed7c4a68abf53d562c7acad66c03648af8612d2d33ba889000f971fb8271
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / colony_memory_hermes-0.2.0-py3-none-any.whl
| Download URL | colony_memory_hermes-0.2.0-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fffcd9113415f017fd063bdf41dcf89218914c7035876d8715a75747f7fc1763
|
|
BLAKE2b-256 checksum How to use checksums |
943123b81ed49958882d84ae79c7d6d066da425121895c6c0e63fc52d5042c87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for colony-memory-hermes 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.