charm-adapter-hermes
Official Charm adapter for Nous Research Hermes Agent — the self-improving AI agent with persistent memory, cross-session recall, and multi-provider LLM support.
This repository serves as both:
- A production adapter enabling Hermes agents to run on the Charm platform.
- A reference implementation showing how to build a Charm adapter plugin from scratch.
Quick Start
1. Create a new Hermes agent project
charm init my-hermes-agent --template hermes-agent
cd my-hermes-agent
2. Set your API key
# In your charm.yaml `environment_variables` section, or via environment:
export OPENROUTER_API_KEY="sk-or-..."
3. Run locally
charm run --input '{"query": "Hello, who are you?"}'
4. Publish to Charm Store
charm push
How It Works
Architecture
┌──────────────────────────────────────────────────────┐
│ Charm Cloud Runner │
│ │
│ ┌────────────┐ ┌─────────────────┐ │
│ │ charm.yaml │───▶│ HermesAdapter │ │
│ │ lifecycle: │ │ │ │
│ │ daemon │ │ ┌───────────┐ │ │
│ └────────────┘ │ │ AIAgent │ │ │
│ │ │ (Hermes) │ │ │
│ │ └─────┬─────┘ │ │
│ │ │ │ │
│ └────────┼────────┘ │
│ │ │
│ ┌────────▼────────┐ │
│ │ CHARM_WORKSPACE │ │
│ │ /daemon_shared│ │
│ │ ├─ .hermes/ │ │
│ │ │ ├─ sessions.db (FTS5) │
│ │ │ ├─ skills/ │
│ │ │ └─ memory/ │
│ └─────────────────┘ │
└──────────────────────────────────────────────────────┘
Key Integration Points
| Concern | How it's handled |
|---|---|
| Persistent memory | HERMES_HOME is redirected to CHARM_WORKSPACE_DIR/.hermes so SQLite/FTS5 data survives daemon restarts |
| Streaming | Hermes stream_delta_callback is bridged to Charm's SSE emitter for real-time token output |
| Threaded Streaming | Because Hermes executes synchronously, the adapter wraps run_conversation in a background thread and bridges stream_delta_callback to Charm Runner via a thread-safe Queue, ensuring real-time token output |
| Tool usage | Hermes tool_start_callback / tool_complete_callback trigger Charm's tool usage tracking |
| Headless mode | Agent runs with quiet_mode=True — no TUI spinners or terminal chrome |
| Model flexibility | Any Hermes-supported provider (OpenRouter, OpenAI, Anthropic, local endpoints) works via env vars |
| Lazy Configuration | If entry_point points to a factory function, the adapter automatically injects environment variables like model before instantiation |
Configuration
charm.yaml
version: "0.4.2"
persona:
name: "My Hermes Agent"
description: "My custom hermes agent"
interface:
input:
type: object
properties:
query:
type: string
output:
type: string
runtime:
adapter:
type: "hermes"
entry_point: "src.main:agent"
lifecycle: "daemon"
capabilities:
manages_own_history: true
environment_variables:
models:
- OPENROUTER_API_KEY
Environment Variables
| Variable | Description |
|---|---|
OPENROUTER_API_KEY |
Default LLM provider key |
CHARM_HERMES_MODEL |
Override the model (e.g., anthropic/claude-sonnet-4-20250514) |
CHARM_HERMES_BASE_URL |
Override the LLM API endpoint |
Docker Runtime Image
For production deployments, use the pre-built runtime image:
runtime:
custom_image: "ghcr.io/charmaios/charm-runner-hermes:latest"
Or build locally:
docker build -t charm-runner-hermes .
For Plugin Developers
This repo demonstrates the standard Charm adapter plugin pattern:
- Inherit the contract — implement
invoke(),stream(),get_state(),set_tools(). - Register via entry points — declare
[project.entry-points."charm.adapters"]inpyproject.toml. - Redirect state — use
CHARM_WORKSPACE_DIRfor any persistent data. - Run headless — suppress all interactive UI when inside the runner.
See the Custom Adapters Guide for the full specification.
License
MIT
Metadata
Release files for charm-adapter-hermes 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 | Provenance | Actions |
|---|---|---|---|---|
| charm_adapter_hermes-0.1.0.tar.gz | 8.4 kB | With provenance | Details for charm_adapter_hermes-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| charm_adapter_hermes-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for charm_adapter_hermes-0.1.0-py3-none-any.whl |
Total release size: 15.8 kB
Release files / charm_adapter_hermes-0.1.0.tar.gz
| Download URL | charm_adapter_hermes-0.1.0.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0611baaa48d9d1c2d349613d140720509af61d5b0e01f8f47fa5879010d33499
|
|
BLAKE2b-256 checksum How to use checksums |
3edbe19593bcbc2193af4eec574581bb8dc2158faa472753d68a11dec8b208fb
|
| 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 Sep 13, 2026.
Transparency logRelease files / charm_adapter_hermes-0.1.0-py3-none-any.whl
| Download URL | charm_adapter_hermes-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cdf5a20a442388029f18cbcedb465727dedadb86bb85b7db5e002e040fcc4ee
|
|
BLAKE2b-256 checksum How to use checksums |
21b7ebc9175d48f96e3070fe0438ef81fbd52bbeb7a2a77e2c7b94643fff838c
|
| 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 Sep 13, 2026.
Transparency logSecurity for charm-adapter-hermes 0.1.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for charm_adapter_hermes-0.1.0.tar.gz
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 Sep 13, 2026.
Transparency logA 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.