How jsha09/hermes-agent works
Hermes Agent is a self-improving, multi-surface AI agent. The principal workflow is: a user submits a turn through CLI, TUI, desktop, or messaging; the runtime assembles context, calls a selected model, dispatches tools, persists state, and streams a result back. Major documented branches include learning and skill creation, scheduled automation, isolated subagents, remote terminal backends, voice/search integrations, and trajectory generation. The tree and excerpts establish module responsibilities, but several cross-module arrows remain inferred from documented capabilities rather than sampled callers.
Components 22
User Surfaces
- CLI And TUI
hermes_cli/console_engine.py - Desktop App
apps/desktop/src/app/chat/index.tsx - Messaging Gateway
agent/transports
Agent Runtime
- Turn Runtime
agent/turn_facade.py - Context Engine
agent/context_engine.py - Provider Registry
agent/provider_registry.py - Tool Dispatch
agent/tool_executor.py - Stream Delivery
agent/stream_delivery.py
State And Learning
- Session Storage
agent/session_persistence.py - Memory Manager
agent/memory_manager.py - Learning Loop
agent/learning_graph.py - Skills System
agent/skill_bundles.py - Plugin Storage
plugins/plugin_storage.py
External Integrations
- Terminal Backends
agent/terminal_env_registry.py - Search And Media
agent/web_search_registry.py - Voice Services
agent/transcription_registry.py - Model Providers
Automation And Research
- Cron Scheduler
agent/periodic_scheduler.py - Subagent Lifecycle
agent/subagent_lifecycle.py - Trajectory Research
agent/trajectory.py
Other components
- User
- Messaging And Cloud Services
Connections 27
- User → CLI And TUI: submits turns
- User → Desktop App: submits turns
- User → Messaging Gateway: sends messages
- CLI And TUI → Turn Runtime: starts turns
- Desktop App → Turn Runtime: starts turns
- Messaging Gateway → Turn Runtime: starts turns
- Turn Runtime → Context Engine: manages context
- Turn Runtime → Provider Registry: requests models
- Turn Runtime → Tool Dispatch: dispatches tools
- Turn Runtime → Session Storage: persists sessions
- Turn Runtime → Stream Delivery: streams results
- Stream Delivery → CLI And TUI: delivers output
- Stream Delivery → Desktop App: delivers output
- Stream Delivery → Messaging Gateway: delivers output
- Provider Registry → Model Providers: calls models
- Tool Dispatch → Terminal Backends: runs commands
- Tool Dispatch → Search And Media: uses integrations
- Tool Dispatch → Voice Services: uses voice
- Context Engine → Memory Manager: uses memory context
- Learning Loop → Memory Manager: updates memory
- Learning Loop → Skills System: creates skills
- Skills System → Plugin Storage: stores plugin data
- Cron Scheduler → Turn Runtime: starts jobs
- Cron Scheduler → Messaging And Cloud Services: delivers schedules
- Subagent Lifecycle → Turn Runtime: runs delegated turns
- Trajectory Research → Turn Runtime: records trajectories
- Messaging Gateway → Messaging And Cloud Services: connects platforms