Skip to content

feat: add Hermes Agent as a first-class backend and transcript source#114

Open
fgscaglioni wants to merge 3 commits into
microsoft:mainfrom
fgscaglioni:feat/hermes-agent-backend
Open

feat: add Hermes Agent as a first-class backend and transcript source#114
fgscaglioni wants to merge 3 commits into
microsoft:mainfrom
fgscaglioni:feat/hermes-agent-backend

Conversation

@fgscaglioni

Copy link
Copy Markdown

This adds full support for Nous Research's Hermes Agent across all three SkillOpt layers — core model backend, sleep-cycle backend, and transcript harvesting.

Core model layer (skillopt/model/):

  • Register the Hermes CLI as a chat backend (hermes_chat) alongside the existing Claude, Codex, Qwen, and MiniMax backends.
  • All chat entry points (optimizer, target, messages, deployment) route through the Hermes adapter.

Sleep-cycle backend (skillopt_sleep/backend.py):

  • Add HermesBackend extending CliBackend, driving hermes --profile chat -Q -q for attempt / judge / reflect calls.
  • CLI output is filtered to strip notices, warnings, and traceback debris so the pipeline sees only the model response.
  • Registered under get_backend("hermes") with aliases hermes_chat and hermes_cli.

Transcript harvesting (skillopt_sleep/harvest_hermes.py):

  • New harvest source reads Hermes session data from ~/.hermes/state.db (SQLite), building SessionDigest objects from sessions + messages.
  • Skips engine-internal sessions (temp dirs matching skillopt_sleep_*) so the mine step only sees real user sessions.
  • Supports the standard harvest contract: scope, since, limit, project.

Config additions (skillopt_sleep/config.py):

  • memory_filename — controls the project memory file name. Defaults to "CLAUDE.md" for backward compatibility. Set to "AGENTS.md" for Codex and Hermes.
  • hermes_home — path to Hermes state directory, defaults to ~/.hermes, overridable via $HERMES_HOME.

Tests:

  • 7 new tests in TestHermesBackendCli covering backend registration, command construction, error capture, output filtering, and env vars.

Backward compatible — defaults unchanged, all existing backends intact.

This adds full support for Nous Research's Hermes Agent across all three
SkillOpt layers — core model backend, sleep-cycle backend, and transcript
harvesting.

Core model layer (skillopt/model/):
- Register the Hermes CLI as a chat backend (hermes_chat) alongside the
  existing Claude, Codex, Qwen, and MiniMax backends.
- All chat entry points (optimizer, target, messages, deployment) route
  through the Hermes adapter.

Sleep-cycle backend (skillopt_sleep/backend.py):
- Add HermesBackend extending CliBackend, driving hermes --profile
  <name> chat -Q -q for attempt / judge / reflect calls.
- CLI output is filtered to strip notices, warnings, and traceback
  debris so the pipeline sees only the model response.
- Registered under get_backend("hermes") with aliases hermes_chat and
  hermes_cli.

Transcript harvesting (skillopt_sleep/harvest_hermes.py):
- New harvest source reads Hermes session data from ~/.hermes/state.db
  (SQLite), building SessionDigest objects from sessions + messages.
- Skips engine-internal sessions (temp dirs matching skillopt_sleep_*)
  so the mine step only sees real user sessions.
- Supports the standard harvest contract: scope, since, limit, project.

Config additions (skillopt_sleep/config.py):
- memory_filename — controls the project memory file name.
  Defaults to "CLAUDE.md" for backward compatibility.
  Set to "AGENTS.md" for Codex and Hermes.
- hermes_home — path to Hermes state directory, defaults to
  ~/.hermes, overridable via $HERMES_HOME.

Tests:
- 7 new tests in TestHermesBackendCli covering backend registration,
  command construction, error capture, output filtering, and env vars.

Backward compatible — defaults unchanged, all existing backends intact.
@fgscaglioni

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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