How ryuma-1/hermes-agent works
Hermes Agent is a self-improving, multi-provider AI agent used through a CLI/TUI or messaging gateway. A user submits a turn; the conversation loop builds context, calls a model, dispatches tools, and returns a response. The README also documents learning and memory, scheduled automations, subagents, multiple terminal backends, and research trajectory workflows, so these appear as distinct capability branches. Edges rely on README statements or SOURCE INDEX references; unsampled implementation details and runtime wiring are not inferred.
Main entry points: conversation_loop.py Conversation Loop · signal.py Messaging Gateway · cli.py CLI · context_compressor.py Context Compression
Components 29
User Interfaces
- CLI
cli.py - Terminal UI
ui-tui/src/app/turnController.ts - ACP Adapter
acp_adapter/server.py - Console Commands
hermes_cli/console_engine.py - ACP Command
hermes_cli/subcommands/acp.py
Agent Runtime
- Conversation Loop
agent/conversation_loop.py - Prompt Builder
agent/prompt_builder.py - Turn Context
agent/turn_context.py - Runtime Helpers
agent/agent_runtime_helpers.py - Tool Execution
agent/tool_executor.py - Subagents
agent/subagent_lifecycle.py - Trajectory Research
agent/trajectory.py - Redaction
agent/redact.py
Learning and Context
- Context Compression
agent/context_compressor.py - Context Engine
agent/context_engine.py - Conversation Compression
agent/conversation_compression.py - Memory and Skills
agent/memory_manager.py
Gateway and Operations
- Messaging Gateway
gateway/platforms/signal.py - Configuration
hermes_cli/config.py - Model Selection
hermes_cli/model_switch.py - Scheduled Automations
cron/scheduler_worker_env.py - Signal Platform
gateway/platforms/signal.py - Gateway Status
gateway/status.py - Shared Constants
hermes_constants.py - Process Compatibility
hermes_cli/_subprocess_compat.py
Models and Tools
- Model Metadata
agent/model_metadata.py - Auxiliary Model Client
agent/auxiliary_client.py - Terminal Backends
tools/environments/local.py
Other components
- User
Connections 30
- User → CLI: starts chat
README.md - User → Terminal UI: uses terminal
README.md - User → Messaging Gateway: messages agent
README.md - CLI → Conversation Loop: submits turn
- Terminal UI → Conversation Loop: submits turn
- Messaging Gateway → Conversation Loop: routes turns
- Conversation Loop → Prompt Builder: builds prompt
agent/conversation_loop.py - Conversation Loop → Turn Context: uses context
agent/conversation_loop.py - Conversation Loop → Model Metadata: selects model
agent/conversation_loop.py - Conversation Loop → Tool Execution: dispatches tools
README.md - Conversation Loop → Context Compression: compresses context
agent/conversation_loop.py - Context Engine → Context Compression: default engine
agent/context_engine.py - Conversation Loop → Conversation Compression: supports compression
- Conversation Loop → Memory and Skills: uses learned context
README.md - Memory and Skills → User: models user
README.md - Context Compression → Auxiliary Model Client: requests summaries
agent/context_compressor.py - Model Selection → Model Metadata: chooses provider
README.md - Configuration → Model Selection: configures models
README.md - Tool Execution → Terminal Backends: runs commands
README.md - Scheduled Automations → Messaging Gateway: delivers scheduled jobs
README.md - Conversation Loop → Subagents: spawns workstreams
README.md - Conversation Loop → Trajectory Research: records trajectories
README.md - ACP Command → ACP Adapter: starts adapter
acp_adapter/server.py - Messaging Gateway → Signal Platform: supports platform
README.md - Messaging Gateway → Gateway Status: reports status
- Conversation Loop → Runtime Helpers: uses runtime helpers
agent/conversation_loop.py - Conversation Loop → Redaction: sanitizes context
agent/conversation_loop.py - CLI → Console Commands: offers console
- Configuration → Shared Constants: uses shared constants
hermes_cli/config.py - Gateway Status → Process Compatibility: uses compatibility helpers
hermes_cli/_subprocess_compat.py