How hermes-agent-org/hermes works
Hermes Agent is a multi-provider conversational agent reachable through an interactive CLI or a messaging gateway. A user message enters through one of those interfaces, is handled by the agent loop, and may invoke registered tools before returning a response. The README also describes scheduled delivery, isolated terminal backends, persistent memory and session search, self-improving skills, subagents, and RL-oriented environments. The graph preserves those documented branches; connections among unsampled subsystems are omitted where the excerpts do not establish the caller or data flow.
Main entry points: run_agent.py Agent loop · cli.py Interactive CLI · run.py Messaging gateway · runtime_provider.py Provider resolution
Components 21
User interfaces
- Interactive CLI
cli.py - CLI TUI
hermes_cli/curses_ui.py - Messaging gateway
gateway/run.py - Messaging platforms
gateway/platforms/base.py
Agent runtime
- Agent loop
run_agent.py - Provider resolution
hermes_cli/runtime_provider.py - Model catalog
hermes_cli/models.py - Provider authentication
hermes_cli/auth.py
Agent capabilities
- Tool orchestration
model_tools.py - Tool registry
tools/registry.py - Terminal execution
tools/terminal_tool.py - MCP integration
tools/mcp_tool.py - Subagent delegation
tools/delegate_tool.py
Memory and learning
- Session state
hermes_state.py - Persistent memory
agent/memory_manager.py - Skill management
tools/skill_manager_tool.py - Session search
tools/session_search_tool.py
Scheduling and research
- Cron scheduler
cron/scheduler.py - Research environments
environments/web_research_env.py - RL environments
environments/agent_loop.py
Other components
- User
Connections 22
- User → Interactive CLI: starts chat
- User → Messaging gateway: sends message
- Interactive CLI → CLI TUI: renders interface
cli.py - Interactive CLI → Agent loop: runs turns
cli.py - Messaging gateway → Messaging platforms: connects platforms
- Messaging gateway → Agent loop: handles messages
- Agent loop → Tool orchestration: dispatches tools
model_tools.py - Tool orchestration → Tool registry: dispatches calls
model_tools.py - Tool registry → Terminal execution: registers tool
tools/terminal_tool.py - Agent loop → Provider resolution: resolves model
- Provider resolution → Model catalog: checks models
hermes_cli/runtime_provider.py - Provider authentication → Provider resolution: supplies credentials
hermes_cli/runtime_provider.py - Agent loop → Session state: persists sessions
- Agent loop → Persistent memory: uses memory
- Agent loop → Skill management: creates skills
- Agent loop → Session search: searches history
- Agent loop → MCP integration: uses MCP
- Agent loop → Subagent delegation: spawns subagents
- Cron scheduler → Agent loop: runs scheduled tasks
cron/scheduler.py - Cron scheduler → Messaging platforms: delivers results
cron/scheduler.py - Research environments → Agent loop: runs research
environments/web_research_env.py - RL environments → Agent loop: generates trajectories