2026-02-02 19:01:51 -08:00
# Hermes Agent 🦋
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
An AI agent with advanced tool-calling capabilities, featuring a flexible toolsets system, messaging integrations, and scheduled tasks.
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
## Quick Install
2026-01-31 06:33:43 +00:00
2026-02-02 19:01:51 -08:00
**Linux/macOS:**
2026-01-31 06:33:43 +00:00
```bash
2026-02-02 19:01:51 -08:00
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
2026-01-31 06:33:43 +00:00
```
2026-02-02 19:01:51 -08:00
**Windows (PowerShell):**
```powershell
irm https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.ps1 | iex
```
2026-01-31 06:33:43 +00:00
2026-02-02 19:01:51 -08:00
The installer will:
2026-02-07 23:54:53 +00:00
- Install [uv ](https://docs.astral.sh/uv/ ) (fast Python package manager) if not present
- Install Python 3.11 via uv if not already available (no sudo needed)
2026-02-07 00:05:04 +00:00
- Clone to `~/.hermes/hermes-agent` (with submodules: mini-swe-agent, tinker-atropos)
2026-02-07 23:54:53 +00:00
- Create a virtual environment with Python 3.11
2026-02-07 00:05:04 +00:00
- Install all dependencies and submodule packages
2026-02-07 23:54:53 +00:00
- Symlink `hermes` into `~/.local/bin` so it works globally (no venv activation needed)
2026-02-02 19:01:51 -08:00
- Run the interactive setup wizard
2025-10-01 09:54:17 +00:00
2026-02-02 19:01:51 -08:00
After installation, reload your shell and run:
2026-01-23 12:26:53 +00:00
```bash
2026-02-02 19:01:51 -08:00
hermes setup # Configure API keys (if you skipped during install)
hermes # Start chatting!
2026-01-23 12:26:53 +00:00
```
2026-02-02 19:01:51 -08:00
---
2025-10-01 09:54:17 +00:00
2026-02-02 19:01:51 -08:00
## Configuration
2025-10-01 09:54:17 +00:00
2026-02-02 19:01:51 -08:00
All your settings are stored in `~/.hermes/` for easy access:
2026-01-29 22:36:07 +00:00
2025-10-01 09:54:17 +00:00
```
2026-02-02 19:01:51 -08:00
~/.hermes/
2026-02-12 10:05:08 -08:00
├── config.yaml # Settings (model, terminal, TTS, compression, etc.)
2026-02-02 19:01:51 -08:00
├── .env # API keys and secrets
2026-02-12 10:05:08 -08:00
├── SOUL.md # Optional: global persona (agent embodies this personality)
2026-02-02 19:01:51 -08:00
├── cron/ # Scheduled jobs
├── sessions/ # Gateway sessions
└── logs/ # Logs
```
### Managing Configuration
2025-10-01 09:54:17 +00:00
```bash
2026-02-02 19:01:51 -08:00
hermes config # View current configuration
hermes config edit # Open config.yaml in your editor
hermes config set KEY VAL # Set a specific value
2026-02-02 19:45:42 -08:00
hermes config check # Check for missing options (after updates)
hermes config migrate # Interactively add missing options
2025-10-01 09:54:17 +00:00
2026-02-02 19:01:51 -08:00
# Examples:
hermes config set model anthropic/claude-opus-4
hermes config set terminal.backend docker
hermes config set OPENROUTER_API_KEY sk-or-... # Saves to .env
2025-07-26 04:37:51 +00:00
```
2026-02-02 19:01:51 -08:00
### Required API Keys
2025-10-01 09:54:17 +00:00
2026-02-02 19:01:51 -08:00
You need at least one LLM provider:
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
| Provider | Get Key | Env Variable |
|----------|---------|--------------|
| **OpenRouter ** (recommended) | [openrouter.ai/keys ](https://openrouter.ai/keys ) | `OPENROUTER_API_KEY` |
2026-02-04 00:35:45 -08:00
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
### Optional API Keys
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
| Feature | Provider | Env Variable |
|---------|----------|--------------|
2026-02-04 00:35:45 -08:00
| Custom OpenAI Endpoint (OAI or VLLM/SGLANG) | [platform.openai.com ](https://platform.openai.com/api-keys ) | `OPENAI_API_KEY` |
2026-02-02 19:01:51 -08:00
| Web scraping | [Firecrawl ](https://firecrawl.dev/ ) | `FIRECRAWL_API_KEY` |
| Browser automation | [Browserbase ](https://browserbase.com/ ) | `BROWSERBASE_API_KEY` , `BROWSERBASE_PROJECT_ID` |
| Image generation | [FAL ](https://fal.ai/ ) | `FAL_KEY` |
2026-02-12 10:05:08 -08:00
| Premium TTS voices | [ElevenLabs ](https://elevenlabs.io/ ) | `ELEVENLABS_API_KEY` |
| OpenAI TTS voices | [OpenAI ](https://platform.openai.com/api-keys ) | `OPENAI_API_KEY` |
2026-02-04 09:36:51 -08:00
| RL Training | [Tinker ](https://tinker-console.thinkingmachines.ai/ ) + [WandB ](https://wandb.ai/ ) | `TINKER_API_KEY` , `WANDB_API_KEY` |
Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks
Major feature additions inspired by OpenClaw/ClawdBot integration analysis:
Voice Message Transcription (STT):
- Auto-transcribe voice/audio messages via OpenAI Whisper API
- Download voice to ~/.hermes/audio_cache/ on Telegram/Discord/WhatsApp
- Inject transcript as text so all models can understand voice input
- Configurable model (whisper-1, gpt-4o-mini-transcribe, gpt-4o-transcribe)
Telegram Sticker Understanding:
- Describe static stickers via vision tool with JSON-backed cache
- Cache keyed by file_unique_id avoids redundant API calls
- Animated/video stickers get emoji-based fallback description
Discord Rich UX:
- Native slash commands (/ask, /reset, /status, /stop) via app_commands
- Button-based exec approvals (Allow Once / Always Allow / Deny)
- ExecApprovalView with user authorization and timeout handling
Slack Integration:
- Full SlackAdapter using slack-bolt with Socket Mode
- DMs, channel messages (mention-gated), /hermes slash command
- File attachment handling with bot-token-authenticated downloads
DM Pairing System:
- Code-based user authorization as alternative to static allowlists
- 8-char codes from unambiguous alphabet, 1-hour expiry
- Rate limiting, lockout after failed attempts, chmod 0600 on data
- CLI: hermes pairing list/approve/revoke/clear-pending
Event Hook System:
- File-based hook discovery from ~/.hermes/hooks/
- HOOK.yaml + handler.py per hook, sync/async handler support
- Events: gateway:startup, session:start/reset, agent:start/step/end
- Wildcard matching (command:* catches all command events)
Cross-Channel Messaging:
- send_message agent tool for delivering to any connected platform
- Enables cron job delivery and cross-platform notifications
Human-Like Response Pacing:
- Configurable delays between message chunks (off/natural/custom)
- HERMES_HUMAN_DELAY_MODE env var with min/max ms settings
Warm Injection Message Style:
- Retrofitted image vision messages with friendly kawaii-consistent tone
- All new injection messages (STT, stickers, errors) use warm style
Also: updated config migration to prompt for optional keys interactively,
bumped config version, updated README, AGENTS.md, .env.example,
cli-config.yaml.example, install scripts, pyproject.toml, and toolsets.
2026-02-15 21:38:59 -08:00
| Voice transcription | [OpenAI ](https://platform.openai.com/api-keys ) | `OPENAI_API_KEY` |
| Slack integration | [Slack ](https://api.slack.com/apps ) | `SLACK_BOT_TOKEN` , `SLACK_APP_TOKEN` |
2026-02-02 19:01:51 -08:00
| Messaging | Telegram, Discord | `TELEGRAM_BOT_TOKEN` , `DISCORD_BOT_TOKEN` |
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
---
2026-01-29 22:36:07 +00:00
2026-02-02 19:01:51 -08:00
## Commands
2026-01-29 22:36:07 +00:00
```bash
2026-02-02 19:01:51 -08:00
hermes # Interactive chat (default)
hermes chat -q "Hello" # Single query mode
hermes setup # Configure API keys and settings
hermes config # View/edit configuration
2026-02-02 19:45:42 -08:00
hermes config check # Check for missing config (useful after updates)
hermes config migrate # Interactively add missing options
2026-02-02 19:01:51 -08:00
hermes status # Show configuration status
hermes doctor # Diagnose issues
2026-02-02 19:45:42 -08:00
hermes update # Update to latest version (prompts for new config)
2026-02-02 22:18:18 -08:00
hermes uninstall # Uninstall (can keep configs for later reinstall)
2026-02-02 19:01:51 -08:00
hermes gateway # Start messaging gateway
Add Skills Hub — universal skill search, install, and management from online registries
Implements the Hermes Skills Hub with agentskills.io spec compliance,
multi-registry skill discovery, security scanning, and user-driven
management via CLI and /skills slash command.
Core features:
- Security scanner (tools/skills_guard.py): 120 threat patterns across
12 categories, trust-aware install policy (builtin/trusted/community),
structural checks, unicode injection detection, LLM audit pass
- Hub client (tools/skills_hub.py): GitHub, ClawHub, Claude Code
marketplace, and LobeHub source adapters with shared GitHubAuth
(PAT + gh CLI + GitHub App), lock file provenance tracking, quarantine
flow, and unified search across all sources
- CLI interface (hermes_cli/skills_hub.py): search, install, inspect,
list, audit, uninstall, publish (GitHub PR), snapshot export/import,
and tap management — powers both `hermes skills` and `/skills`
Spec conformance (Phase 0):
- Upgraded frontmatter parser to yaml.safe_load with fallback
- Migrated 39 SKILL.md files: tags/related_skills to metadata.hermes.*
- Added assets/ directory support and compatibility/metadata fields
- Excluded .hub/ from skill discovery in skills_tool.py
Updated 13 config/doc files including README, AGENTS.md, .env.example,
setup wizard, doctor, status, pyproject.toml, and docs.
2026-02-18 16:09:05 -08:00
hermes skills search k8s # Search skill registries
hermes skills install ... # Install a skill (with security scan)
hermes skills list # List installed skills
2026-02-02 19:01:51 -08:00
hermes cron list # View scheduled jobs
Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks
Major feature additions inspired by OpenClaw/ClawdBot integration analysis:
Voice Message Transcription (STT):
- Auto-transcribe voice/audio messages via OpenAI Whisper API
- Download voice to ~/.hermes/audio_cache/ on Telegram/Discord/WhatsApp
- Inject transcript as text so all models can understand voice input
- Configurable model (whisper-1, gpt-4o-mini-transcribe, gpt-4o-transcribe)
Telegram Sticker Understanding:
- Describe static stickers via vision tool with JSON-backed cache
- Cache keyed by file_unique_id avoids redundant API calls
- Animated/video stickers get emoji-based fallback description
Discord Rich UX:
- Native slash commands (/ask, /reset, /status, /stop) via app_commands
- Button-based exec approvals (Allow Once / Always Allow / Deny)
- ExecApprovalView with user authorization and timeout handling
Slack Integration:
- Full SlackAdapter using slack-bolt with Socket Mode
- DMs, channel messages (mention-gated), /hermes slash command
- File attachment handling with bot-token-authenticated downloads
DM Pairing System:
- Code-based user authorization as alternative to static allowlists
- 8-char codes from unambiguous alphabet, 1-hour expiry
- Rate limiting, lockout after failed attempts, chmod 0600 on data
- CLI: hermes pairing list/approve/revoke/clear-pending
Event Hook System:
- File-based hook discovery from ~/.hermes/hooks/
- HOOK.yaml + handler.py per hook, sync/async handler support
- Events: gateway:startup, session:start/reset, agent:start/step/end
- Wildcard matching (command:* catches all command events)
Cross-Channel Messaging:
- send_message agent tool for delivering to any connected platform
- Enables cron job delivery and cross-platform notifications
Human-Like Response Pacing:
- Configurable delays between message chunks (off/natural/custom)
- HERMES_HUMAN_DELAY_MODE env var with min/max ms settings
Warm Injection Message Style:
- Retrofitted image vision messages with friendly kawaii-consistent tone
- All new injection messages (STT, stickers, errors) use warm style
Also: updated config migration to prompt for optional keys interactively,
bumped config version, updated README, AGENTS.md, .env.example,
cli-config.yaml.example, install scripts, pyproject.toml, and toolsets.
2026-02-15 21:38:59 -08:00
hermes pairing list # View/manage DM pairing codes
2026-02-02 19:01:51 -08:00
hermes version # Show version info
2026-01-29 22:36:07 +00:00
```
2026-02-02 19:01:51 -08:00
### CLI Commands (inside chat)
2026-01-29 22:36:07 +00:00
2026-02-17 23:30:31 -08:00
Type `/` to see an autocomplete dropdown of all commands.
2026-02-02 19:01:51 -08:00
| Command | Description |
|---------|-------------|
| `/help` | Show available commands |
| `/tools` | List available tools |
2026-02-17 23:30:31 -08:00
| `/toolsets` | List available toolsets |
2026-02-02 19:01:51 -08:00
| `/model [name]` | Show or change model |
2026-02-17 23:30:31 -08:00
| `/prompt` | View/set custom system prompt |
2026-02-02 19:01:51 -08:00
| `/personality [name]` | Set personality (kawaii, pirate, etc.) |
2026-02-17 23:30:31 -08:00
| `/clear` | Clear screen and reset conversation |
| `/history` | Show conversation history |
| `/reset` | Reset conversation only (keep screen) |
| `/retry` | Retry the last message |
| `/undo` | Remove the last exchange |
| `/save` | Save the current conversation |
2026-02-02 19:01:51 -08:00
| `/config` | Show current configuration |
2026-02-17 23:30:31 -08:00
| `/cron` | Manage scheduled tasks |
Add Skills Hub — universal skill search, install, and management from online registries
Implements the Hermes Skills Hub with agentskills.io spec compliance,
multi-registry skill discovery, security scanning, and user-driven
management via CLI and /skills slash command.
Core features:
- Security scanner (tools/skills_guard.py): 120 threat patterns across
12 categories, trust-aware install policy (builtin/trusted/community),
structural checks, unicode injection detection, LLM audit pass
- Hub client (tools/skills_hub.py): GitHub, ClawHub, Claude Code
marketplace, and LobeHub source adapters with shared GitHubAuth
(PAT + gh CLI + GitHub App), lock file provenance tracking, quarantine
flow, and unified search across all sources
- CLI interface (hermes_cli/skills_hub.py): search, install, inspect,
list, audit, uninstall, publish (GitHub PR), snapshot export/import,
and tap management — powers both `hermes skills` and `/skills`
Spec conformance (Phase 0):
- Upgraded frontmatter parser to yaml.safe_load with fallback
- Migrated 39 SKILL.md files: tags/related_skills to metadata.hermes.*
- Added assets/ directory support and compatibility/metadata fields
- Excluded .hub/ from skill discovery in skills_tool.py
Updated 13 config/doc files including README, AGENTS.md, .env.example,
setup wizard, doctor, status, pyproject.toml, and docs.
2026-02-18 16:09:05 -08:00
| `/skills` | Search, install, inspect, or manage skills from registries |
2026-02-17 23:30:31 -08:00
| `/platforms` | Show gateway/messaging platform status |
| `/quit` | Exit (also: `/exit` , `/q` ) |
**Keybindings:**
- `Enter` — send message
- `Alt+Enter` or `Ctrl+J` — new line (multi-line input)
- `Ctrl+C` — interrupt agent (double-press to force exit)
- `Ctrl+D` — exit
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
---
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
## Features
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
### 🛠️ Tools & Toolsets
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
Tools are organized into logical **toolsets ** :
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
```bash
# Use specific toolsets
hermes --toolsets "web,terminal"
2026-01-23 12:26:53 +00:00
2026-02-02 19:01:51 -08:00
# List all toolsets
hermes --list-tools
```
2026-01-29 06:10:24 +00:00
2026-02-19 00:57:31 -08:00
**Available toolsets:** `web` , `terminal` , `file` , `browser` , `vision` , `image_gen` , `moa` , `skills` , `tts` , `todo` , `memory` , `session_search` , `cronjob` , and more.
### 🧠 Persistent Memory
Bounded curated memory that persists across sessions:
- **MEMORY.md** — agent's personal notes (environment facts, conventions, things learned). ~800 token budget.
- **USER.md** — user profile (preferences, communication style, expectations). ~500 token budget.
Both are injected into the system prompt as a frozen snapshot at session start. The agent manages its own memory via the `memory` tool (add/replace/remove/read). Character limits keep memory focused — when full, the agent consolidates or replaces entries.
Configure in `~/.hermes/config.yaml` :
```yaml
memory:
memory_enabled: true
user_profile_enabled: true
memory_char_limit: 2200 # ~800 tokens
user_char_limit: 1375 # ~500 tokens
```
### 🗄️ Session Store
All CLI and messaging sessions are stored in a SQLite database (`~/.hermes/state.db` ) with full-text search:
- **Full message history** stored per-session with model config and system prompt snapshots
- **FTS5 search** via the `session_search` tool -- search past conversations with Gemini Flash summarization
- **Compression-triggered session splitting** -- when context is compressed, a new session is created linked to the parent, giving clean trajectories
- **Source tagging** -- each session is tagged with its origin (cli, telegram, discord, etc.)
- Batch runner and RL trajectories are NOT stored here (separate systems)
2026-02-12 10:05:08 -08:00
### 🔊 Text-to-Speech
Convert text to speech with three providers:
| Provider | Quality | Cost | API Key |
|----------|---------|------|---------|
| **Edge TTS ** (default) | Good | Free | None needed |
| **ElevenLabs ** | Excellent | Paid | `ELEVENLABS_API_KEY` |
| **OpenAI TTS ** | Good | Paid | `OPENAI_API_KEY` |
2026-02-14 16:16:54 -08:00
On Telegram, audio plays as native voice bubbles (the round, inline-playable kind). On Discord/WhatsApp, sent as audio file attachments. In CLI mode, saved to `~/voice-memos/` .
2026-02-12 10:05:08 -08:00
**Configure in `~/.hermes/config.yaml` :**
```yaml
tts:
provider: "edge" # "edge" | "elevenlabs" | "openai"
edge:
voice: "en-US-AriaNeural" # 322 voices, 74 languages
elevenlabs:
voice_id: "pNInz6obpgDQGcFmaJgB" # Adam
model_id: "eleven_multilingual_v2"
openai:
model: "gpt-4o-mini-tts"
voice: "alloy" # alloy, echo, fable, onyx, nova, shimmer
```
2026-02-14 16:16:54 -08:00
**Telegram voice bubbles & ffmpeg:**
Telegram voice bubbles require Opus/OGG audio format. OpenAI and ElevenLabs produce Opus natively — no extra dependencies needed. Edge TTS (the default free provider) outputs MP3 and needs **ffmpeg ** to convert to Opus:
```bash
# Ubuntu/Debian
sudo apt install ffmpeg
# macOS
brew install ffmpeg
# Fedora
sudo dnf install ffmpeg
```
Without ffmpeg, Edge TTS audio is sent as a regular audio file (playable, but shows as a rectangular player instead of a voice bubble). If you want voice bubbles without installing ffmpeg, switch to the OpenAI or ElevenLabs provider.
2026-02-12 10:05:08 -08:00
Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks
Major feature additions inspired by OpenClaw/ClawdBot integration analysis:
Voice Message Transcription (STT):
- Auto-transcribe voice/audio messages via OpenAI Whisper API
- Download voice to ~/.hermes/audio_cache/ on Telegram/Discord/WhatsApp
- Inject transcript as text so all models can understand voice input
- Configurable model (whisper-1, gpt-4o-mini-transcribe, gpt-4o-transcribe)
Telegram Sticker Understanding:
- Describe static stickers via vision tool with JSON-backed cache
- Cache keyed by file_unique_id avoids redundant API calls
- Animated/video stickers get emoji-based fallback description
Discord Rich UX:
- Native slash commands (/ask, /reset, /status, /stop) via app_commands
- Button-based exec approvals (Allow Once / Always Allow / Deny)
- ExecApprovalView with user authorization and timeout handling
Slack Integration:
- Full SlackAdapter using slack-bolt with Socket Mode
- DMs, channel messages (mention-gated), /hermes slash command
- File attachment handling with bot-token-authenticated downloads
DM Pairing System:
- Code-based user authorization as alternative to static allowlists
- 8-char codes from unambiguous alphabet, 1-hour expiry
- Rate limiting, lockout after failed attempts, chmod 0600 on data
- CLI: hermes pairing list/approve/revoke/clear-pending
Event Hook System:
- File-based hook discovery from ~/.hermes/hooks/
- HOOK.yaml + handler.py per hook, sync/async handler support
- Events: gateway:startup, session:start/reset, agent:start/step/end
- Wildcard matching (command:* catches all command events)
Cross-Channel Messaging:
- send_message agent tool for delivering to any connected platform
- Enables cron job delivery and cross-platform notifications
Human-Like Response Pacing:
- Configurable delays between message chunks (off/natural/custom)
- HERMES_HUMAN_DELAY_MODE env var with min/max ms settings
Warm Injection Message Style:
- Retrofitted image vision messages with friendly kawaii-consistent tone
- All new injection messages (STT, stickers, errors) use warm style
Also: updated config migration to prompt for optional keys interactively,
bumped config version, updated README, AGENTS.md, .env.example,
cli-config.yaml.example, install scripts, pyproject.toml, and toolsets.
2026-02-15 21:38:59 -08:00
### 🎙️ Voice Message Transcription
Voice messages sent on Telegram, Discord, WhatsApp, or Slack are automatically transcribed using OpenAI's Whisper API and injected as text into the conversation. The agent sees the transcript as normal text -- no special handling needed.
| Provider | Model | Quality | Cost |
|----------|-------|---------|------|
| **OpenAI Whisper ** | `whisper-1` (default) | Good | Low |
| **OpenAI GPT-4o ** | `gpt-4o-mini-transcribe` | Better | Medium |
| **OpenAI GPT-4o ** | `gpt-4o-transcribe` | Best | Higher |
Requires `OPENAI_API_KEY` in `~/.hermes/.env` . Configure the model in `~/.hermes/config.yaml` :
```yaml
stt:
enabled: true
model: "whisper-1"
```
2026-02-12 10:05:08 -08:00
### 📄 Context Files (SOUL.md, AGENTS.md, .cursorrules)
Drop these files in your project directory and the agent automatically picks them up:
| File | Purpose |
|------|---------|
| `AGENTS.md` | Project-specific instructions, coding conventions, tool usage guidelines |
| `SOUL.md` | Persona definition -- the agent embodies this personality and tone |
| `.cursorrules` | Cursor IDE rules (also detected) |
| `.cursor/rules/*.mdc` | Cursor rule files (also detected) |
- **AGENTS.md** is hierarchical: if subdirectories also have `AGENTS.md` , all are combined (like Codex/Cline).
- **SOUL.md** checks cwd first, then `~/.hermes/SOUL.md` as a global fallback.
- All context files are capped at 20,000 characters with smart truncation.
### 🛡️ Exec Approval (Messaging Platforms)
When the agent tries to run a potentially dangerous command (rm -rf, chmod 777, etc.) on Telegram/Discord/WhatsApp, instead of blocking it silently, it asks the user for approval:
> ⚠️ This command is potentially dangerous (recursive delete). Reply "yes" to approve.
Reply "yes"/"y" to approve or "no"/"n" to deny. In CLI mode, the existing interactive approval prompt (once/session/always/deny) is preserved.
2026-01-29 06:10:24 +00:00
Add background process management with process tool, wait, PTY, and stdin support
New process registry and tool for managing long-running background processes
across all terminal backends (local, Docker, Singularity, Modal, SSH).
Process Registry (tools/process_registry.py):
- ProcessSession tracking with rolling 200KB output buffer
- spawn_local() with optional PTY via ptyprocess for interactive CLIs
- spawn_via_env() for non-local backends (runs inside sandbox, never on host)
- Background reader threads per process (Popen stdout or PTY)
- wait() with timeout clamping, interrupt support, and transparent limit reporting
- JSON checkpoint to ~/.hermes/processes.json for gateway crash recovery
- Module-level singleton shared across agent loop, gateway, and RL
Process Tool (model_tools.py):
- 7 actions: list, poll, log, wait, kill, write, submit
- Paired with terminal in all toolsets (CLI, messaging, RL)
- Timeout clamping with transparent notes in response
Terminal Tool Updates (tools/terminal_tool.py):
- Replaced nohup background mode with registry spawn (returns session_id)
- Added workdir parameter for per-command working directory
- Added check_interval parameter for gateway auto-check watchers
- Added pty parameter for interactive CLI tools (Codex, Claude Code)
- Updated TERMINAL_TOOL_DESCRIPTION with full background workflow docs
- Cleanup thread now respects active background processes (won't reap sandbox)
Gateway Integration (gateway/run.py, session.py, config.py):
- Session reset protection: sessions with active processes exempt from reset
- Default idle timeout increased from 2 hours to 24 hours
- from_dict fallback aligned to match (was 120, now 1440)
- session_key env var propagated to process registry for session mapping
- Crash recovery on gateway startup via checkpoint probe
- check_interval watcher: asyncio task polls process, delivers updates to platform
RL Safety (environments/):
- tool_context.py cleanup() kills background processes on episode end
- hermes_base_env.py warns when enabled_toolsets is None (loads all tools)
- Process tool safe in RL via wait() blocking the agent loop
Also:
- Added ptyprocess as optional dependency (in pyproject.toml [pty] extra + [all])
- Fixed pre-existing bug: rl_test_inference missing from TOOL_TO_TOOLSET_MAP
- Updated AGENTS.md with process management docs and project structure
- Updated README.md terminal section with process management overview
2026-02-17 02:51:31 -08:00
### 🖥️ Terminal & Process Management
2026-01-29 06:10:24 +00:00
Add background process management with process tool, wait, PTY, and stdin support
New process registry and tool for managing long-running background processes
across all terminal backends (local, Docker, Singularity, Modal, SSH).
Process Registry (tools/process_registry.py):
- ProcessSession tracking with rolling 200KB output buffer
- spawn_local() with optional PTY via ptyprocess for interactive CLIs
- spawn_via_env() for non-local backends (runs inside sandbox, never on host)
- Background reader threads per process (Popen stdout or PTY)
- wait() with timeout clamping, interrupt support, and transparent limit reporting
- JSON checkpoint to ~/.hermes/processes.json for gateway crash recovery
- Module-level singleton shared across agent loop, gateway, and RL
Process Tool (model_tools.py):
- 7 actions: list, poll, log, wait, kill, write, submit
- Paired with terminal in all toolsets (CLI, messaging, RL)
- Timeout clamping with transparent notes in response
Terminal Tool Updates (tools/terminal_tool.py):
- Replaced nohup background mode with registry spawn (returns session_id)
- Added workdir parameter for per-command working directory
- Added check_interval parameter for gateway auto-check watchers
- Added pty parameter for interactive CLI tools (Codex, Claude Code)
- Updated TERMINAL_TOOL_DESCRIPTION with full background workflow docs
- Cleanup thread now respects active background processes (won't reap sandbox)
Gateway Integration (gateway/run.py, session.py, config.py):
- Session reset protection: sessions with active processes exempt from reset
- Default idle timeout increased from 2 hours to 24 hours
- from_dict fallback aligned to match (was 120, now 1440)
- session_key env var propagated to process registry for session mapping
- Crash recovery on gateway startup via checkpoint probe
- check_interval watcher: asyncio task polls process, delivers updates to platform
RL Safety (environments/):
- tool_context.py cleanup() kills background processes on episode end
- hermes_base_env.py warns when enabled_toolsets is None (loads all tools)
- Process tool safe in RL via wait() blocking the agent loop
Also:
- Added ptyprocess as optional dependency (in pyproject.toml [pty] extra + [all])
- Fixed pre-existing bug: rl_test_inference missing from TOOL_TO_TOOLSET_MAP
- Updated AGENTS.md with process management docs and project structure
- Updated README.md terminal section with process management overview
2026-02-17 02:51:31 -08:00
The terminal tool can execute commands in different environments, with full background process management via the `process` tool:
**Background processes:** Start with `terminal(command="...", background=true)` , then use `process(action="poll/wait/log/kill/write")` to monitor, wait for completion, read output, terminate, or send input. The `wait` action blocks until the process finishes -- no polling loops needed. PTY mode (`pty=true` ) enables interactive CLI tools like Codex and Claude Code.
**Execution environments:**
2026-01-29 06:10:24 +00:00
2026-02-02 19:01:51 -08:00
| Backend | Description | Use Case |
|---------|-------------|----------|
| `local` | Run on your machine (default) | Development, trusted tasks |
| `docker` | Isolated containers | Security, reproducibility |
| `ssh` | Remote server | Sandboxing, keep agent away from its own code |
| `singularity` | HPC containers | Cluster computing, rootless |
| `modal` | Cloud execution | Serverless, scale |
2026-01-29 06:10:24 +00:00
2026-02-02 19:01:51 -08:00
**Configure in `~/.hermes/config.yaml` :**
```yaml
terminal:
backend: local # or: docker, ssh, singularity, modal
cwd: "." # Working directory ("." = current dir)
timeout: 180 # Command timeout in seconds
2026-01-29 06:10:24 +00:00
```
2026-02-02 19:01:51 -08:00
**Docker Backend:**
```yaml
terminal:
backend: docker
docker_image: python:3.11-slim
```
2026-01-29 06:10:24 +00:00
2026-02-02 19:01:51 -08:00
**SSH Backend** (recommended for security - agent can't modify its own code):
```yaml
terminal:
backend: ssh
```
2026-01-29 06:10:24 +00:00
```bash
2026-02-02 19:01:51 -08:00
# Set credentials in ~/.hermes/.env
TERMINAL_SSH_HOST=my-server.example.com
TERMINAL_SSH_USER=myuser
TERMINAL_SSH_KEY=~/.ssh/id_rsa
2026-01-29 06:10:24 +00:00
```
2026-02-02 19:01:51 -08:00
**Singularity/Apptainer** (for HPC clusters):
```bash
# Pre-build SIF for parallel workers
apptainer build ~/python.sif docker://python:3.11-slim
2026-01-30 07:54:21 +00:00
2026-02-02 19:01:51 -08:00
# Configure
hermes config set terminal.backend singularity
hermes config set terminal.singularity_image ~/python.sif
2026-01-30 07:54:21 +00:00
```
2026-02-02 19:01:51 -08:00
**Modal** (serverless cloud):
```bash
2026-02-07 23:54:53 +00:00
uv pip install "swe-rex[modal]" # Installs swe-rex + modal + boto3
2026-02-07 00:05:04 +00:00
modal setup # Authenticate with Modal
2026-02-02 19:01:51 -08:00
hermes config set terminal.backend modal
2026-01-30 07:54:21 +00:00
```
2026-02-02 19:01:51 -08:00
**Sudo Support:** If a command needs sudo, you'll be prompted for your password (cached for the session). Or set `SUDO_PASSWORD` in `~/.hermes/.env` .
2026-01-30 07:54:21 +00:00
2026-02-02 19:01:51 -08:00
### 📱 Messaging Gateway
2026-01-30 07:54:21 +00:00
2026-02-03 10:46:23 -08:00
Chat with Hermes from Telegram, Discord, or WhatsApp.
#### Telegram Setup
1. **Create a bot: ** Message [@BotFather ](https://t.me/BotFather ) on Telegram, use `/newbot`
2. **Get your user ID: ** Message [@userinfobot ](https://t.me/userinfobot ) - it replies with your numeric ID
3. **Configure: **
```bash
# Add to ~/.hermes/.env:
TELEGRAM_BOT_TOKEN=123456:ABC-DEF...
TELEGRAM_ALLOWED_USERS=YOUR_USER_ID # Comma-separated for multiple users
```
4. **Start the gateway: **
2026-01-30 07:54:21 +00:00
2026-02-02 19:01:51 -08:00
```bash
2026-02-03 10:46:23 -08:00
hermes gateway # Run in foreground
hermes gateway install # Install as systemd service (Linux)
hermes gateway start # Start the service
```
#### Discord Setup
2026-01-30 07:54:21 +00:00
2026-02-03 10:46:23 -08:00
1. **Create a bot: ** Go to [Discord Developer Portal ](https://discord.com/developers/applications )
2. **Get your user ID: ** Enable Developer Mode in Discord settings, right-click your name → Copy ID
3. **Configure: **
2026-01-30 07:54:21 +00:00
2026-02-03 10:46:23 -08:00
```bash
# Add to ~/.hermes/.env:
DISCORD_BOT_TOKEN=MTIz...
DISCORD_ALLOWED_USERS=YOUR_USER_ID
2026-01-30 07:54:21 +00:00
```
Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks
Major feature additions inspired by OpenClaw/ClawdBot integration analysis:
Voice Message Transcription (STT):
- Auto-transcribe voice/audio messages via OpenAI Whisper API
- Download voice to ~/.hermes/audio_cache/ on Telegram/Discord/WhatsApp
- Inject transcript as text so all models can understand voice input
- Configurable model (whisper-1, gpt-4o-mini-transcribe, gpt-4o-transcribe)
Telegram Sticker Understanding:
- Describe static stickers via vision tool with JSON-backed cache
- Cache keyed by file_unique_id avoids redundant API calls
- Animated/video stickers get emoji-based fallback description
Discord Rich UX:
- Native slash commands (/ask, /reset, /status, /stop) via app_commands
- Button-based exec approvals (Allow Once / Always Allow / Deny)
- ExecApprovalView with user authorization and timeout handling
Slack Integration:
- Full SlackAdapter using slack-bolt with Socket Mode
- DMs, channel messages (mention-gated), /hermes slash command
- File attachment handling with bot-token-authenticated downloads
DM Pairing System:
- Code-based user authorization as alternative to static allowlists
- 8-char codes from unambiguous alphabet, 1-hour expiry
- Rate limiting, lockout after failed attempts, chmod 0600 on data
- CLI: hermes pairing list/approve/revoke/clear-pending
Event Hook System:
- File-based hook discovery from ~/.hermes/hooks/
- HOOK.yaml + handler.py per hook, sync/async handler support
- Events: gateway:startup, session:start/reset, agent:start/step/end
- Wildcard matching (command:* catches all command events)
Cross-Channel Messaging:
- send_message agent tool for delivering to any connected platform
- Enables cron job delivery and cross-platform notifications
Human-Like Response Pacing:
- Configurable delays between message chunks (off/natural/custom)
- HERMES_HUMAN_DELAY_MODE env var with min/max ms settings
Warm Injection Message Style:
- Retrofitted image vision messages with friendly kawaii-consistent tone
- All new injection messages (STT, stickers, errors) use warm style
Also: updated config migration to prompt for optional keys interactively,
bumped config version, updated README, AGENTS.md, .env.example,
cli-config.yaml.example, install scripts, pyproject.toml, and toolsets.
2026-02-15 21:38:59 -08:00
#### Slack Setup
1. **Create an app: ** Go to [Slack API ](https://api.slack.com/apps ), create a new app
2. **Enable Socket Mode: ** In app settings → Socket Mode → Enable
3. **Get tokens: **
- Bot Token (`xoxb-...` ): OAuth & Permissions → Install to Workspace
- App Token (`xapp-...` ): Basic Information → App-Level Tokens → Generate
4. **Configure: **
```bash
# Add to ~/.hermes/.env:
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-...
SLACK_ALLOWED_USERS=U01234ABCDE # Comma-separated Slack user IDs
```
5. **Start the gateway: ** `hermes gateway`
#### DM Pairing (Alternative to Allowlists)
Instead of manually configuring user IDs in allowlists, you can use the pairing system. When an unknown user DMs your bot, they receive a one-time pairing code:
```bash
# The user sees: "Pairing code: XKGH5N7P"
# You approve them with:
hermes pairing approve telegram XKGH5N7P
# Other pairing commands:
hermes pairing list # View pending + approved users
hermes pairing revoke telegram 123456789 # Remove access
```
Pairing codes expire after 1 hour, are rate-limited, and use cryptographic randomness.
2026-02-03 10:46:23 -08:00
#### Security (Important!)
**Without an allowlist, anyone who finds your bot can use it!**
```bash
# Restrict to specific users (recommended):
TELEGRAM_ALLOWED_USERS=123456789,987654321
DISCORD_ALLOWED_USERS=123456789012345678
# Or allow all users in a specific platform:
# (Leave the variable unset - NOT recommended for bots with terminal access)
```
#### Gateway Commands
| Command | Description |
|---------|-------------|
| `/new` or `/reset` | Start fresh conversation |
| `/status` | Show session info |
Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks
Major feature additions inspired by OpenClaw/ClawdBot integration analysis:
Voice Message Transcription (STT):
- Auto-transcribe voice/audio messages via OpenAI Whisper API
- Download voice to ~/.hermes/audio_cache/ on Telegram/Discord/WhatsApp
- Inject transcript as text so all models can understand voice input
- Configurable model (whisper-1, gpt-4o-mini-transcribe, gpt-4o-transcribe)
Telegram Sticker Understanding:
- Describe static stickers via vision tool with JSON-backed cache
- Cache keyed by file_unique_id avoids redundant API calls
- Animated/video stickers get emoji-based fallback description
Discord Rich UX:
- Native slash commands (/ask, /reset, /status, /stop) via app_commands
- Button-based exec approvals (Allow Once / Always Allow / Deny)
- ExecApprovalView with user authorization and timeout handling
Slack Integration:
- Full SlackAdapter using slack-bolt with Socket Mode
- DMs, channel messages (mention-gated), /hermes slash command
- File attachment handling with bot-token-authenticated downloads
DM Pairing System:
- Code-based user authorization as alternative to static allowlists
- 8-char codes from unambiguous alphabet, 1-hour expiry
- Rate limiting, lockout after failed attempts, chmod 0600 on data
- CLI: hermes pairing list/approve/revoke/clear-pending
Event Hook System:
- File-based hook discovery from ~/.hermes/hooks/
- HOOK.yaml + handler.py per hook, sync/async handler support
- Events: gateway:startup, session:start/reset, agent:start/step/end
- Wildcard matching (command:* catches all command events)
Cross-Channel Messaging:
- send_message agent tool for delivering to any connected platform
- Enables cron job delivery and cross-platform notifications
Human-Like Response Pacing:
- Configurable delays between message chunks (off/natural/custom)
- HERMES_HUMAN_DELAY_MODE env var with min/max ms settings
Warm Injection Message Style:
- Retrofitted image vision messages with friendly kawaii-consistent tone
- All new injection messages (STT, stickers, errors) use warm style
Also: updated config migration to prompt for optional keys interactively,
bumped config version, updated README, AGENTS.md, .env.example,
cli-config.yaml.example, install scripts, pyproject.toml, and toolsets.
2026-02-15 21:38:59 -08:00
| `/hermes` (Discord) | Slash command — ask, reset, status, stop |
2026-02-03 10:46:23 -08:00
2026-02-03 14:57:27 -08:00
#### Working Directory
- **CLI (`hermes` )**: Uses current directory where you run the command
- **Messaging**: Uses `MESSAGING_CWD` (default: home directory `~` )
```bash
# Set custom messaging working directory in ~/.hermes/.env
MESSAGING_CWD=/home/myuser/projects
```
#### Tool Progress Notifications
Get real-time updates as the agent works:
```bash
# Enable in ~/.hermes/.env
HERMES_TOOL_PROGRESS=true
HERMES_TOOL_PROGRESS_MODE=new # or "all" for every tool call
```
When enabled, you'll see messages like:
```
💻 `ls -la` ...
🔍 web_search...
📄 web_extract...
```
2026-02-03 10:46:23 -08:00
See [docs/messaging.md ](docs/messaging.md ) for WhatsApp and advanced setup.
2026-01-30 07:54:21 +00:00
2026-02-04 09:36:51 -08:00
### 🤖 RL Training (Tinker + Atropos)
Train language models with reinforcement learning using the Tinker API and Atropos framework.
2026-02-07 00:05:04 +00:00
> **Note:** RL training tools require **Python 3.11+** (the upstream `tinker` package has this requirement). On Python 3.10, the RL toolset will be automatically disabled — all other features work fine.
2026-02-04 09:36:51 -08:00
#### Requirements
2026-02-07 00:05:04 +00:00
1. **Python 3.11+ ** (check with `python3 --version` )
2. **API Keys: ** Add to `~/.hermes/.env` :
2026-02-04 09:36:51 -08:00
```bash
TINKER_API_KEY=your-tinker-key # Get from https://tinker-console.thinkingmachines.ai/keys
WANDB_API_KEY=your-wandb-key # Get from https://wandb.ai/authorize
2026-02-04 13:57:59 -08:00
OPENROUTER_API_KEY=your-key # Optional: for rl_test_inference
2026-02-04 09:36:51 -08:00
```
2026-02-07 00:05:04 +00:00
3. **That's it! ** tinker-atropos is included as a submodule — the installer handles it automatically.
2026-02-04 09:36:51 -08:00
#### Using RL Tools
The agent can now use RL training tools:
```
You: Start training on GSM8k with group_size=16
Agent: I'll set up an RL training run on the GSM8k environment...
[Uses rl_list_environments, rl_select_environment, rl_edit_config, rl_start_training]
```
#### Available RL Tools
| Tool | Description |
|------|-------------|
| `rl_list_environments` | List available RL environments |
| `rl_select_environment` | Select an environment for training |
| `rl_get_current_config` | View all configurable options |
| `rl_edit_config` | Change a configuration value |
2026-02-04 13:57:59 -08:00
| `rl_test_inference` | Test environment with OpenRouter (pre-training validation) |
2026-02-04 09:36:51 -08:00
| `rl_start_training` | Start a training run |
| `rl_check_status` | Check training progress |
| `rl_stop_training` | Stop a running training |
| `rl_get_results` | Fetch WandB metrics |
2026-02-04 13:57:59 -08:00
| `rl_list_runs` | List active training runs |
2026-02-04 09:36:51 -08:00
#### Dedicated RL CLI
For extended RL workflows with longer timeouts:
```bash
python rl_cli.py --model "anthropic/claude-sonnet-4-20250514"
```
2026-02-07 09:17:16 +00:00
### 🧪 Atropos RL Environments
Hermes-Agent integrates with the [Atropos ](https://github.com/NousResearch/atropos ) RL framework through a layered environment system. This allows training models with reinforcement learning on agentic tasks using hermes-agent's tools.
#### Architecture
The integration has three layers:
| Layer | File | Purpose |
|-------|------|---------|
| **Agent Loop ** | `environments/agent_loop.py` | Reusable multi-turn tool-calling engine (standard OpenAI spec) |
| **Base Environment ** | `environments/hermes_base_env.py` | Abstract Atropos `BaseEnv` subclass with toolset resolution, ToolContext, scoring |
| **Concrete Envs ** | `environments/terminal_test_env.py` , `environments/hermes_swe_env.py` | Task-specific environments |
#### Two-Phase Operation
- **Phase 1 (OpenAI server type)**: Works with any OpenAI-compatible endpoint (VLLM, SGLang, OpenRouter, OpenAI API). The server handles tool call parsing natively. Good for **SFT data generation ** , **verifier testing ** , and **evaluation ** .
- **Phase 2 (VLLM server type)**: Uses ManagedServer for exact token IDs + logprobs via `/generate` . Client-side tool call parser registry reconstructs structured `tool_calls` from raw output. Required for **full RL training ** .
#### Quick Start
```bash
# 1. Launch VLLM with tool parser
vllm serve YourModel --tool-parser hermes
# 2. Start the Atropos API server
run-api
# 3. Run an environment
python environments/terminal_test_env.py serve \
--openai.base_url http://localhost:8000/v1 \
--openai.model_name YourModel \
--openai.server_type openai
```
#### ToolContext (Reward Functions)
Reward functions receive a `ToolContext` with unrestricted access to all hermes-agent tools, scoped to the rollout's sandbox:
```python
async def compute_reward(self, item, result, ctx: ToolContext) -> float:
# Run tests in the model's terminal sandbox
test = ctx.terminal("pytest -v")
if test["exit_code"] == 0:
return 1.0
# Or check a file, search the web, navigate a browser...
return 0.0
```
#### Creating Custom Environments
Subclass `HermesAgentBaseEnv` and implement 5 methods:
```python
from environments.hermes_base_env import HermesAgentBaseEnv
class MyEnv(HermesAgentBaseEnv):
name = "my-env"
async def setup(self): ... # Load data
async def get_next_item(self): ... # Return next item
def format_prompt(self, item): ... # Item -> prompt string
async def compute_reward(self, item, result, ctx): ... # Score with ToolContext
async def evaluate(self, * args, * *kwargs): ... # Periodic eval
if __name __ == "__main__":
MyEnv.cli()
```
#### Toolset Distributions
Configure which tools are available per group, either explicitly or probabilistically:
```bash
# Explicit toolsets
--env.enabled_toolsets '["terminal","file","web"]'
# Probabilistic distribution (sampled per group)
--env.distribution development
```
#### Tool Call Parsers (Phase 2)
For VLLM server type, a parser registry extracts structured `tool_calls` from raw model output. Supported parsers: `hermes` , `mistral` , `llama3_json` , `qwen` , `deepseek_v3` , `deepseek_v3_1` , `kimi_k2` , `longcat` , `glm45` , `glm47` , `qwen3_coder` .
```bash
--env.tool_call_parser hermes # Match your VLLM --tool-parser flag
```
2026-02-02 19:01:51 -08:00
### ⏰ Scheduled Tasks (Cron)
2026-02-01 15:36:26 -08:00
2026-02-02 19:01:51 -08:00
Schedule tasks to run automatically:
2026-02-01 15:36:26 -08:00
2026-02-02 19:01:51 -08:00
```bash
# In the CLI
/cron add 30m "Remind me to check the build"
/cron add "every 2h" "Check server status"
/cron add "0 9 * * *" "Morning briefing"
/cron list
/cron remove <job_id>
2026-02-01 15:36:26 -08:00
```
2026-02-02 19:01:51 -08:00
The agent can also self-schedule using `schedule_cronjob` tool.
2026-02-01 15:36:26 -08:00
2026-02-02 19:01:51 -08:00
**Run the scheduler:**
```bash
hermes cron daemon # Built-in daemon
# Or add to system cron for reliability
```
2026-02-01 18:01:31 -08:00
2026-02-02 19:01:51 -08:00
### 🗜️ Context Compression
2026-02-01 18:01:31 -08:00
2026-02-02 19:01:51 -08:00
Long conversations are automatically summarized when approaching context limits:
2026-02-01 18:01:31 -08:00
```yaml
2026-02-02 19:01:51 -08:00
# In ~/.hermes/config.yaml
2026-02-01 18:01:31 -08:00
compression:
2026-02-02 19:01:51 -08:00
enabled: true
threshold: 0.85 # Compress at 85% of limit
2026-02-01 18:01:31 -08:00
```
2026-02-02 19:01:51 -08:00
### 📝 Session Logging
Every conversation is logged to `~/.hermes-agent/logs/` for debugging:
2026-02-01 18:01:31 -08:00
```
2026-02-02 19:01:51 -08:00
logs/
├── session_20260201_143052_a1b2c3.json
└── ...
2026-02-01 18:01:31 -08:00
```
2026-02-02 19:01:51 -08:00
### 🌐 Browser Automation
2026-02-02 08:26:42 -08:00
2026-02-02 19:01:51 -08:00
Browser tools let the agent navigate websites, fill forms, click buttons, and extract content using [Browserbase ](https://browserbase.com/ ).
2026-02-02 08:26:42 -08:00
2026-02-02 19:01:51 -08:00
**Setup:**
2026-02-02 08:26:42 -08:00
```bash
2026-02-02 19:01:51 -08:00
# 1. Get credentials from browserbase.com
hermes config set BROWSERBASE_API_KEY your_api_key
hermes config set BROWSERBASE_PROJECT_ID your_project_id
2026-02-02 08:26:42 -08:00
2026-02-02 19:01:51 -08:00
# 2. Install Node.js dependencies (if not already)
cd ~/.hermes-agent && npm install
2026-02-02 08:26:42 -08:00
```
2026-02-02 19:01:51 -08:00
**Available tools:** `browser_navigate` , `browser_snapshot` , `browser_click` , `browser_type` , `browser_scroll` , `browser_back` , `browser_press` , `browser_close` , `browser_get_images`
2026-02-02 08:26:42 -08:00
2026-02-02 19:01:51 -08:00
**Example:**
```bash
hermes --toolsets browser -q "Go to amazon.com and find the price of the latest Kindle"
2026-02-02 08:26:42 -08:00
```
2026-02-02 19:01:51 -08:00
### 📚 Skills System
2026-02-02 08:26:42 -08:00
Add Skills Hub — universal skill search, install, and management from online registries
Implements the Hermes Skills Hub with agentskills.io spec compliance,
multi-registry skill discovery, security scanning, and user-driven
management via CLI and /skills slash command.
Core features:
- Security scanner (tools/skills_guard.py): 120 threat patterns across
12 categories, trust-aware install policy (builtin/trusted/community),
structural checks, unicode injection detection, LLM audit pass
- Hub client (tools/skills_hub.py): GitHub, ClawHub, Claude Code
marketplace, and LobeHub source adapters with shared GitHubAuth
(PAT + gh CLI + GitHub App), lock file provenance tracking, quarantine
flow, and unified search across all sources
- CLI interface (hermes_cli/skills_hub.py): search, install, inspect,
list, audit, uninstall, publish (GitHub PR), snapshot export/import,
and tap management — powers both `hermes skills` and `/skills`
Spec conformance (Phase 0):
- Upgraded frontmatter parser to yaml.safe_load with fallback
- Migrated 39 SKILL.md files: tags/related_skills to metadata.hermes.*
- Added assets/ directory support and compatibility/metadata fields
- Excluded .hub/ from skill discovery in skills_tool.py
Updated 13 config/doc files including README, AGENTS.md, .env.example,
setup wizard, doctor, status, pyproject.toml, and docs.
2026-02-18 16:09:05 -08:00
Skills are on-demand knowledge documents the agent can load when needed. They follow a **progressive disclosure ** pattern to minimize token usage and are compatible with the [agentskills.io ](https://agentskills.io/specification ) open standard.
2026-02-02 08:26:42 -08:00
2026-02-02 19:01:51 -08:00
**Using Skills:**
2026-02-02 08:26:42 -08:00
```bash
2026-02-02 19:01:51 -08:00
hermes --toolsets skills -q "What skills do you have?"
hermes --toolsets skills -q "Show me the axolotl skill"
2026-02-02 08:26:42 -08:00
```
Add Skills Hub — universal skill search, install, and management from online registries
Implements the Hermes Skills Hub with agentskills.io spec compliance,
multi-registry skill discovery, security scanning, and user-driven
management via CLI and /skills slash command.
Core features:
- Security scanner (tools/skills_guard.py): 120 threat patterns across
12 categories, trust-aware install policy (builtin/trusted/community),
structural checks, unicode injection detection, LLM audit pass
- Hub client (tools/skills_hub.py): GitHub, ClawHub, Claude Code
marketplace, and LobeHub source adapters with shared GitHubAuth
(PAT + gh CLI + GitHub App), lock file provenance tracking, quarantine
flow, and unified search across all sources
- CLI interface (hermes_cli/skills_hub.py): search, install, inspect,
list, audit, uninstall, publish (GitHub PR), snapshot export/import,
and tap management — powers both `hermes skills` and `/skills`
Spec conformance (Phase 0):
- Upgraded frontmatter parser to yaml.safe_load with fallback
- Migrated 39 SKILL.md files: tags/related_skills to metadata.hermes.*
- Added assets/ directory support and compatibility/metadata fields
- Excluded .hub/ from skill discovery in skills_tool.py
Updated 13 config/doc files including README, AGENTS.md, .env.example,
setup wizard, doctor, status, pyproject.toml, and docs.
2026-02-18 16:09:05 -08:00
**Skills Hub — Search, install, and manage skills from online registries:**
```bash
hermes skills search kubernetes # Search all sources (GitHub, ClawHub, LobeHub)
hermes skills install openai/skills/k8s # Install with security scan
hermes skills inspect openai/skills/k8s # Preview before installing
hermes skills list --source hub # List hub-installed skills
hermes skills audit # Re-scan all hub skills
hermes skills uninstall k8s # Remove a hub skill
hermes skills publish skills/my-skill --to github --repo owner/repo
hermes skills snapshot export setup.json # Export skill config
hermes skills tap add myorg/skills-repo # Add a custom source
```
All hub-installed skills go through a **security scanner ** that checks for data exfiltration, prompt injection, destructive commands, and other threats. Trust levels: `builtin` (ships with Hermes), `trusted` (openai/skills, anthropics/skills), `community` (everything else — any findings = blocked unless `--force` ).
2026-02-02 19:01:51 -08:00
**Creating Skills:**
2026-01-31 06:33:43 +00:00
2026-02-02 19:01:51 -08:00
Create `skills/category/skill-name/SKILL.md` :
```markdown
---
name: my-skill
Add Skills Hub — universal skill search, install, and management from online registries
Implements the Hermes Skills Hub with agentskills.io spec compliance,
multi-registry skill discovery, security scanning, and user-driven
management via CLI and /skills slash command.
Core features:
- Security scanner (tools/skills_guard.py): 120 threat patterns across
12 categories, trust-aware install policy (builtin/trusted/community),
structural checks, unicode injection detection, LLM audit pass
- Hub client (tools/skills_hub.py): GitHub, ClawHub, Claude Code
marketplace, and LobeHub source adapters with shared GitHubAuth
(PAT + gh CLI + GitHub App), lock file provenance tracking, quarantine
flow, and unified search across all sources
- CLI interface (hermes_cli/skills_hub.py): search, install, inspect,
list, audit, uninstall, publish (GitHub PR), snapshot export/import,
and tap management — powers both `hermes skills` and `/skills`
Spec conformance (Phase 0):
- Upgraded frontmatter parser to yaml.safe_load with fallback
- Migrated 39 SKILL.md files: tags/related_skills to metadata.hermes.*
- Added assets/ directory support and compatibility/metadata fields
- Excluded .hub/ from skill discovery in skills_tool.py
Updated 13 config/doc files including README, AGENTS.md, .env.example,
setup wizard, doctor, status, pyproject.toml, and docs.
2026-02-18 16:09:05 -08:00
description: Brief description
2026-02-02 19:01:51 -08:00
version: 1.0.0
Add Skills Hub — universal skill search, install, and management from online registries
Implements the Hermes Skills Hub with agentskills.io spec compliance,
multi-registry skill discovery, security scanning, and user-driven
management via CLI and /skills slash command.
Core features:
- Security scanner (tools/skills_guard.py): 120 threat patterns across
12 categories, trust-aware install policy (builtin/trusted/community),
structural checks, unicode injection detection, LLM audit pass
- Hub client (tools/skills_hub.py): GitHub, ClawHub, Claude Code
marketplace, and LobeHub source adapters with shared GitHubAuth
(PAT + gh CLI + GitHub App), lock file provenance tracking, quarantine
flow, and unified search across all sources
- CLI interface (hermes_cli/skills_hub.py): search, install, inspect,
list, audit, uninstall, publish (GitHub PR), snapshot export/import,
and tap management — powers both `hermes skills` and `/skills`
Spec conformance (Phase 0):
- Upgraded frontmatter parser to yaml.safe_load with fallback
- Migrated 39 SKILL.md files: tags/related_skills to metadata.hermes.*
- Added assets/ directory support and compatibility/metadata fields
- Excluded .hub/ from skill discovery in skills_tool.py
Updated 13 config/doc files including README, AGENTS.md, .env.example,
setup wizard, doctor, status, pyproject.toml, and docs.
2026-02-18 16:09:05 -08:00
metadata:
hermes:
tags: [python, automation]
2026-02-02 19:01:51 -08:00
---
2026-01-31 06:33:43 +00:00
2026-02-02 19:01:51 -08:00
# Skill Content
2026-01-31 06:33:43 +00:00
2026-02-02 19:01:51 -08:00
Instructions, examples, and guidelines here...
```
2026-01-31 06:33:43 +00:00
2026-02-02 19:01:51 -08:00
**Skill Structure:**
```
skills/
├── mlops/
│ ├── axolotl/
│ │ ├── SKILL.md # Main instructions (required)
│ │ ├── references/ # Additional docs
Add Skills Hub — universal skill search, install, and management from online registries
Implements the Hermes Skills Hub with agentskills.io spec compliance,
multi-registry skill discovery, security scanning, and user-driven
management via CLI and /skills slash command.
Core features:
- Security scanner (tools/skills_guard.py): 120 threat patterns across
12 categories, trust-aware install policy (builtin/trusted/community),
structural checks, unicode injection detection, LLM audit pass
- Hub client (tools/skills_hub.py): GitHub, ClawHub, Claude Code
marketplace, and LobeHub source adapters with shared GitHubAuth
(PAT + gh CLI + GitHub App), lock file provenance tracking, quarantine
flow, and unified search across all sources
- CLI interface (hermes_cli/skills_hub.py): search, install, inspect,
list, audit, uninstall, publish (GitHub PR), snapshot export/import,
and tap management — powers both `hermes skills` and `/skills`
Spec conformance (Phase 0):
- Upgraded frontmatter parser to yaml.safe_load with fallback
- Migrated 39 SKILL.md files: tags/related_skills to metadata.hermes.*
- Added assets/ directory support and compatibility/metadata fields
- Excluded .hub/ from skill discovery in skills_tool.py
Updated 13 config/doc files including README, AGENTS.md, .env.example,
setup wizard, doctor, status, pyproject.toml, and docs.
2026-02-18 16:09:05 -08:00
│ │ ├── templates/ # Output formats
│ │ └── assets/ # Supplementary files (agentskills.io standard)
2026-02-02 19:01:51 -08:00
│ └── vllm/
│ └── SKILL.md
Add Skills Hub — universal skill search, install, and management from online registries
Implements the Hermes Skills Hub with agentskills.io spec compliance,
multi-registry skill discovery, security scanning, and user-driven
management via CLI and /skills slash command.
Core features:
- Security scanner (tools/skills_guard.py): 120 threat patterns across
12 categories, trust-aware install policy (builtin/trusted/community),
structural checks, unicode injection detection, LLM audit pass
- Hub client (tools/skills_hub.py): GitHub, ClawHub, Claude Code
marketplace, and LobeHub source adapters with shared GitHubAuth
(PAT + gh CLI + GitHub App), lock file provenance tracking, quarantine
flow, and unified search across all sources
- CLI interface (hermes_cli/skills_hub.py): search, install, inspect,
list, audit, uninstall, publish (GitHub PR), snapshot export/import,
and tap management — powers both `hermes skills` and `/skills`
Spec conformance (Phase 0):
- Upgraded frontmatter parser to yaml.safe_load with fallback
- Migrated 39 SKILL.md files: tags/related_skills to metadata.hermes.*
- Added assets/ directory support and compatibility/metadata fields
- Excluded .hub/ from skill discovery in skills_tool.py
Updated 13 config/doc files including README, AGENTS.md, .env.example,
setup wizard, doctor, status, pyproject.toml, and docs.
2026-02-18 16:09:05 -08:00
├── .hub/ # Skills Hub state (gitignored)
│ ├── lock.json # Installed skill provenance
│ ├── quarantine/ # Pending security review
│ └── audit.log # Security scan history
2026-01-31 06:33:43 +00:00
```
2026-02-02 19:01:51 -08:00
---
2026-01-31 06:33:43 +00:00
2026-02-02 19:01:51 -08:00
## Manual Installation
2026-01-31 06:33:43 +00:00
2026-02-07 00:05:04 +00:00
If you prefer full control over the installation process (or the quick-install script doesn't suit your environment), follow these steps to set everything up by hand.
### Prerequisites
| Requirement | Minimum Version | Check Command | Notes |
|-------------|----------------|---------------|-------|
| **Git ** | Any recent | `git --version` | Required |
| **Node.js ** | 18+ | `node --version` | Optional — needed for browser automation tools |
| **ripgrep ** | Any | `rg --version` | Optional — faster file search in terminal tool (falls back to grep) |
2026-02-07 23:54:53 +00:00
> **Note:** Python and pip are **not** prerequisites. The installer uses [uv](https://docs.astral.sh/uv/) to provision Python 3.11 automatically (no sudo needed). If you already have Python 3.11+ installed, uv will use it.
2026-02-07 00:05:04 +00:00
<details>
<summary><strong>Installing prerequisites by platform</strong></summary>
**Ubuntu / Debian:**
```bash
2026-02-07 23:54:53 +00:00
sudo apt update && sudo apt install git
2026-02-07 00:05:04 +00:00
# Optional:
sudo apt install ripgrep nodejs npm
```
**macOS (Homebrew):**
```bash
2026-02-07 23:54:53 +00:00
brew install git
2026-02-07 00:05:04 +00:00
# Optional:
brew install ripgrep node
```
**Windows (WSL recommended):**
Use the [Windows Subsystem for Linux ](https://learn.microsoft.com/en-us/windows/wsl/install ) and follow the Ubuntu instructions above. Alternatively, use the PowerShell quick-install script at the top of this README.
</details>
---
### Step 1: Clone the Repository
Clone with `--recurse-submodules` to pull the required submodules ([mini-swe-agent ](https://github.com/SWE-agent/mini-swe-agent ) for the terminal tool backend and [tinker-atropos ](https://github.com/nousresearch/tinker-atropos ) for RL training):
2026-01-31 06:33:43 +00:00
2026-02-02 19:01:51 -08:00
```bash
git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git
cd hermes-agent
2026-02-07 00:05:04 +00:00
```
If you already cloned without `--recurse-submodules` , initialize them manually:
```bash
git submodule update --init --recursive
```
---
2026-01-31 06:33:43 +00:00
2026-02-07 23:54:53 +00:00
### Step 2: Install uv & Create Virtual Environment
2026-01-31 06:33:43 +00:00
2026-02-07 23:54:53 +00:00
[uv ](https://docs.astral.sh/uv/ ) is a fast Python package manager that can also provision Python itself. Install it and create the venv in one go:
2026-02-07 00:05:04 +00:00
```bash
2026-02-07 23:54:53 +00:00
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
2026-02-07 00:05:04 +00:00
2026-02-07 23:54:53 +00:00
# Create venv with Python 3.11 (uv downloads it if not present — no sudo needed)
uv venv venv --python 3.11
2026-02-07 00:05:04 +00:00
```
2026-02-07 23:54:53 +00:00
> **Tip:** You do **not** need to activate the venv to use `hermes`. The entry point has a hardcoded shebang pointing to the venv Python, so it works globally once symlinked (see Step 8). For installing packages, uv can target the venv directly via `VIRTUAL_ENV`.
2026-02-07 00:05:04 +00:00
---
### Step 3: Install Python Dependencies
2026-02-07 23:54:53 +00:00
Install the main package in editable mode with all optional extras (messaging, cron, CLI menus, modal):
2026-02-07 00:05:04 +00:00
```bash
2026-02-07 23:54:53 +00:00
# Tell uv which venv to install into
export VIRTUAL_ENV="$(pwd)/venv"
# Install with all extras
uv pip install -e ".[all]"
2026-02-07 00:05:04 +00:00
```
If you only want the core agent (no Telegram/Discord/cron support):
```bash
2026-02-07 23:54:53 +00:00
uv pip install -e "."
2026-02-07 00:05:04 +00:00
```
<details>
<summary><strong>Optional extras breakdown</strong></summary>
2026-02-04 13:57:59 -08:00
2026-02-07 00:05:04 +00:00
| Extra | What it adds | Install command |
|-------|-------------|-----------------|
2026-02-07 23:54:53 +00:00
| `all` | Everything below | `uv pip install -e ".[all]"` |
| `messaging` | Telegram & Discord gateway | `uv pip install -e ".[messaging]"` |
| `cron` | Cron expression parsing for scheduled tasks | `uv pip install -e ".[cron]"` |
| `cli` | Terminal menu UI for setup wizard | `uv pip install -e ".[cli]"` |
| `modal` | Modal cloud execution backend (swe-rex + modal + boto3) | `uv pip install -e ".[modal]"` |
| `dev` | pytest & test utilities | `uv pip install -e ".[dev]"` |
2026-02-04 13:57:59 -08:00
2026-02-07 23:54:53 +00:00
You can combine extras: `uv pip install -e ".[messaging,cron]"`
2026-02-07 00:05:04 +00:00
</details>
---
### Step 4: Install Submodule Packages
These are local packages checked out as Git submodules. Install them in editable mode:
```bash
# Terminal tool backend (required for the terminal/command-execution tool)
2026-02-07 23:54:53 +00:00
uv pip install -e "./mini-swe-agent"
2026-02-07 00:05:04 +00:00
2026-02-07 23:54:53 +00:00
# RL training backend
uv pip install -e "./tinker-atropos"
2026-02-07 00:05:04 +00:00
```
Both are optional — if you skip them, the corresponding toolsets simply won't be available.
---
### Step 5: Install Node.js Dependencies (Optional)
Only needed if you plan to use the **browser automation ** toolset (Browserbase-powered):
```bash
npm install
```
This installs the `agent-browser` package defined in `package.json` . Skip this step if you don't need browser tools.
---
### Step 6: Create the Configuration Directory
Hermes stores all user configuration in `~/.hermes/` :
```bash
# Create the directory structure
mkdir -p ~/.hermes/{cron,sessions,logs}
# Copy the example config file
cp cli-config.yaml.example ~/.hermes/config.yaml
# Create an empty .env file for API keys
touch ~/.hermes/.env
```
Your `~/.hermes/` directory should now look like:
```
~/.hermes/
├── config.yaml # Agent settings (model, terminal, toolsets, compression, etc.)
├── .env # API keys and secrets (one per line: KEY=value)
├── cron/ # Scheduled job data
├── sessions/ # Messaging gateway sessions
└── logs/ # Conversation logs
```
---
### Step 7: Add Your API Keys
Open `~/.hermes/.env` in your editor and add at minimum an LLM provider key:
```bash
# Required — at least one LLM provider:
OPENROUTER_API_KEY=sk-or-v1-your-key-here
# Optional — enable additional tools:
FIRECRAWL_API_KEY=fc-your-key # Web search & scraping
BROWSERBASE_API_KEY=bb-your-key # Browser automation
BROWSERBASE_PROJECT_ID=your-project-id # Browser automation
FAL_KEY=your-fal-key # Image generation (FLUX)
TINKER_API_KEY=your-tinker-key # RL training
WANDB_API_KEY=your-wandb-key # RL training metrics
# Optional — messaging gateway:
TELEGRAM_BOT_TOKEN=123456:ABC-DEF # From @BotFather
TELEGRAM_ALLOWED_USERS=your-user-id # Comma-separated
DISCORD_BOT_TOKEN=MTIz... # From Developer Portal
DISCORD_ALLOWED_USERS=your-user-id # Comma-separated
```
Or set them one at a time via the CLI:
```bash
hermes config set OPENROUTER_API_KEY sk-or-v1-your-key-here
```
---
### Step 8: Add `hermes` to Your PATH
2026-02-07 23:54:53 +00:00
The `hermes` entry point at `venv/bin/hermes` has a hardcoded shebang pointing to the venv's Python, so it works **without activating the venv ** . The recommended approach is a symlink into `~/.local/bin` (most distributions already have this on PATH):
```bash
mkdir -p ~/.local/bin
ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes
```
If `~/.local/bin` isn't on your PATH yet, add it:
2026-02-07 00:05:04 +00:00
**Bash** (`~/.bashrc` ):
```bash
echo '' >> ~/.bashrc
echo '# Hermes Agent' >> ~/.bashrc
2026-02-07 23:54:53 +00:00
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
2026-02-07 00:05:04 +00:00
source ~/.bashrc
```
**Zsh** (`~/.zshrc` ):
```bash
echo '' >> ~/.zshrc
echo '# Hermes Agent' >> ~/.zshrc
2026-02-07 23:54:53 +00:00
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
2026-02-07 00:05:04 +00:00
source ~/.zshrc
```
**Fish** (`~/.config/fish/config.fish` ):
```fish
2026-02-07 23:54:53 +00:00
fish_add_path $HOME/.local/bin
2026-02-07 00:05:04 +00:00
```
---
### Step 9: Run the Setup Wizard (Optional)
The interactive setup wizard walks you through configuring your API keys and preferences:
```bash
2026-02-02 19:01:51 -08:00
hermes setup
2026-01-31 06:33:43 +00:00
```
2026-02-07 00:05:04 +00:00
This is optional if you already configured `~/.hermes/.env` and `~/.hermes/config.yaml` manually in the steps above.
---
### Step 10: Verify the Installation
```bash
# Check that the command is available
hermes version
# Run diagnostics to verify everything is working
hermes doctor
# Check your configuration
hermes status
# Test with a quick query
hermes chat -q "Hello! What tools do you have available?"
```
If `hermes doctor` reports issues, it will tell you exactly what's missing and how to fix it.
---
### Quick-Reference: Manual Install (Condensed)
For those who just want the commands without the explanations:
```bash
2026-02-07 23:54:53 +00:00
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
2026-02-07 00:05:04 +00:00
# Clone & enter
git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git
cd hermes-agent
2026-02-07 23:54:53 +00:00
# Create venv with Python 3.11 (uv downloads it if needed)
uv venv venv --python 3.11
export VIRTUAL_ENV="$(pwd)/venv"
2026-02-07 00:05:04 +00:00
# Install everything
2026-02-07 23:54:53 +00:00
uv pip install -e ".[all]"
uv pip install -e "./mini-swe-agent"
uv pip install -e "./tinker-atropos"
2026-02-07 00:05:04 +00:00
npm install # optional, for browser tools
# Configure
mkdir -p ~/.hermes/{cron,sessions,logs}
cp cli-config.yaml.example ~/.hermes/config.yaml
touch ~/.hermes/.env
echo 'OPENROUTER_API_KEY=sk-or-v1-your-key' >> ~/.hermes/.env
2026-02-07 23:54:53 +00:00
# Make hermes available globally (no venv activation needed)
mkdir -p ~/.local/bin
ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes
2026-02-07 00:05:04 +00:00
# Verify
hermes doctor
hermes
```
---
### Updating a Manual Installation
To update an existing manual install to the latest version:
```bash
cd /path/to/hermes-agent
2026-02-07 23:54:53 +00:00
export VIRTUAL_ENV="$(pwd)/venv"
2026-02-07 00:05:04 +00:00
# Pull latest code and submodules
git pull origin main
git submodule update --init --recursive
# Reinstall (picks up new dependencies)
2026-02-07 23:54:53 +00:00
uv pip install -e ".[all]"
uv pip install -e "./mini-swe-agent"
uv pip install -e "./tinker-atropos"
2026-02-07 00:05:04 +00:00
# Check for new config options added since your last update
hermes config check
hermes config migrate # Interactively add any missing options
```
### Uninstalling a Manual Installation
```bash
2026-02-07 23:54:53 +00:00
# Remove the hermes symlink
rm -f ~/.local/bin/hermes
2026-02-07 00:05:04 +00:00
# Remove the cloned repository
rm -rf /path/to/hermes-agent
# Remove user configuration (optional — keep if you plan to reinstall)
rm -rf ~/.hermes
```
2026-02-02 19:01:51 -08:00
---
2026-01-31 06:33:43 +00:00
2026-02-02 19:01:51 -08:00
## Batch Processing
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
Process multiple prompts in parallel with automatic checkpointing:
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
```bash
python batch_runner.py \
--dataset_file=prompts.jsonl \
--batch_size=20 \
--run_name=my_run \
--num_workers=4 \
--distribution=default
```
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
**Key Options:**
| Flag | Description |
|------|-------------|
| `--dataset_file` | JSONL file with prompts |
| `--batch_size` | Prompts per batch |
| `--run_name` | Name for output/checkpoints |
| `--num_workers` | Parallel workers (default: 4) |
| `--distribution` | Toolset distribution |
| `--resume` | Resume from checkpoint |
| `--ephemeral_system_prompt` | Guide behavior without saving to trajectories |
| `--list_distributions` | Show available distributions |
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
**Output:** `data/<run_name>/trajectories.jsonl`
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
### Trajectory Compression
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
Compress trajectories to fit token budgets for training:
2025-09-10 00:43:55 -07:00
```bash
2026-02-02 19:01:51 -08:00
# Compress a directory
python trajectory_compressor.py --input=data/my_run
2025-10-03 13:45:29 +00:00
2026-02-02 19:01:51 -08:00
# Compress with sampling
python trajectory_compressor.py --input=data/my_run --sample_percent=15
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
# Custom token target
python trajectory_compressor.py --input=data/my_run --target_max_tokens=16000
2025-07-26 04:37:51 +00:00
```
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
Features:
- Protects first/last turns
- Summarizes middle turns via LLM
- Configurable via `configs/trajectory_compression.yaml`
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
---
2025-09-10 00:43:55 -07:00
2026-02-02 19:01:51 -08:00
## Python API
2025-09-10 00:43:55 -07:00
```python
from run_agent import AIAgent
agent = AIAgent(
2026-02-02 19:01:51 -08:00
model="anthropic/claude-sonnet-4",
enabled_toolsets=["web", "terminal"]
2025-09-10 00:43:55 -07:00
)
2026-02-02 19:01:51 -08:00
result = agent.run_conversation("Search for the latest Python news")
print(result["final_response"])
2025-09-10 00:43:55 -07:00
```
2026-02-02 19:01:51 -08:00
---
2025-10-06 03:17:58 +00:00
2026-02-02 19:01:51 -08:00
## Environment Variables Reference
All variables go in `~/.hermes/.env` . Run `hermes config set VAR value` to set them.
**LLM Providers:**
| Variable | Description |
|----------|-------------|
| `OPENROUTER_API_KEY` | OpenRouter API key (recommended) |
| `ANTHROPIC_API_KEY` | Direct Anthropic access |
| `OPENAI_API_KEY` | Direct OpenAI access |
**Tool APIs:**
| Variable | Description |
|----------|-------------|
| `FIRECRAWL_API_KEY` | Web scraping (firecrawl.dev) |
| `BROWSERBASE_API_KEY` | Browser automation |
| `BROWSERBASE_PROJECT_ID` | Browserbase project |
| `FAL_KEY` | Image generation (fal.ai) |
**Terminal Backend:**
| Variable | Description |
|----------|-------------|
| `TERMINAL_ENV` | Backend: `local` , `docker` , `ssh` , `singularity` , `modal` |
| `TERMINAL_DOCKER_IMAGE` | Docker image (default: `python:3.11-slim` ) |
| `TERMINAL_SINGULARITY_IMAGE` | Singularity image or `.sif` path |
| `TERMINAL_TIMEOUT` | Command timeout in seconds |
| `TERMINAL_CWD` | Working directory |
| `SUDO_PASSWORD` | Enable sudo (stored plaintext - be careful!) |
**SSH Backend:**
| Variable | Description |
|----------|-------------|
| `TERMINAL_SSH_HOST` | Remote server hostname |
| `TERMINAL_SSH_USER` | SSH username |
| `TERMINAL_SSH_PORT` | SSH port (default: 22) |
| `TERMINAL_SSH_KEY` | Path to private key |
**Messaging:**
| Variable | Description |
|----------|-------------|
| `TELEGRAM_BOT_TOKEN` | Telegram bot token (@BotFather ) |
2026-02-03 14:57:27 -08:00
| `TELEGRAM_ALLOWED_USERS` | Comma-separated user IDs allowed to use bot |
2026-02-02 19:01:51 -08:00
| `TELEGRAM_HOME_CHANNEL` | Default channel for cron delivery |
| `DISCORD_BOT_TOKEN` | Discord bot token |
2026-02-03 14:57:27 -08:00
| `DISCORD_ALLOWED_USERS` | Comma-separated user IDs allowed to use bot |
2026-02-02 19:01:51 -08:00
| `DISCORD_HOME_CHANNEL` | Default channel for cron delivery |
2026-02-03 14:57:27 -08:00
| `MESSAGING_CWD` | Working directory for terminal in messaging (default: ~) |
**Agent Behavior:**
| Variable | Description |
|----------|-------------|
| `HERMES_MAX_ITERATIONS` | Max tool-calling iterations per conversation (default: 60) |
| `HERMES_TOOL_PROGRESS` | Send progress messages when using tools (`true` /`false` ) |
| `HERMES_TOOL_PROGRESS_MODE` | `new` (only when tool changes) or `all` (every call) |
2026-02-02 19:01:51 -08:00
**Context Compression:**
| Variable | Description |
|----------|-------------|
| `CONTEXT_COMPRESSION_ENABLED` | Enable auto-compression (default: true) |
| `CONTEXT_COMPRESSION_THRESHOLD` | Trigger at this % of limit (default: 0.85) |
| `CONTEXT_COMPRESSION_MODEL` | Model for summaries |
2025-10-06 03:17:58 +00:00
2026-02-02 19:01:51 -08:00
---
2025-10-06 03:17:58 +00:00
2026-02-02 19:01:51 -08:00
## File Structure
2025-10-06 03:17:58 +00:00
2026-02-02 19:01:51 -08:00
| Path | Description |
|------|-------------|
| `~/.hermes/config.yaml` | Your settings |
| `~/.hermes/.env` | API keys and secrets |
| `~/.hermes/cron/` | Scheduled jobs data |
| `~/.hermes/sessions/` | Gateway session data |
| `~/.hermes-agent/` | Installation directory |
| `~/.hermes-agent/logs/` | Session logs |
| `hermes_cli/` | CLI implementation |
| `tools/` | Tool implementations |
| `skills/` | Knowledge documents |
| `gateway/` | Messaging platform adapters |
| `cron/` | Scheduler implementation |
2026-01-29 22:36:07 +00:00
2026-02-02 19:01:51 -08:00
---
2026-01-29 22:36:07 +00:00
2026-02-02 19:01:51 -08:00
## Troubleshooting
2026-01-29 22:36:07 +00:00
```bash
2026-02-02 19:01:51 -08:00
hermes doctor # Run diagnostics
hermes status # Check configuration
hermes config # View current settings
2026-01-29 22:36:07 +00:00
```
2026-02-02 19:01:51 -08:00
Common issues:
- **"API key not set"**: Run `hermes setup` or `hermes config set OPENROUTER_API_KEY your_key`
- **"hermes: command not found"**: Reload your shell (`source ~/.bashrc` ) or check PATH
- **Gateway won't start**: Check `hermes gateway status` and logs
2026-02-02 19:45:42 -08:00
- **Missing config after update**: Run `hermes config check` to see what's new, then `hermes config migrate` to add missing options
2025-10-06 03:17:58 +00:00
2026-02-02 19:01:51 -08:00
---
2025-10-08 02:33:58 +00:00
2026-02-02 19:01:51 -08:00
## Contributing
2025-10-08 02:33:58 +00:00
2026-02-02 19:01:51 -08:00
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request
2025-10-08 02:33:58 +00:00
2026-02-02 19:01:51 -08:00
---
## License
2025-10-08 02:33:58 +00:00
2026-02-02 19:01:51 -08:00
MIT License - see [LICENSE ](LICENSE ) for details.