How lokesh-dadhich/hermes-agent works
Hermes Agent is a multi-surface, self-improving AI assistant. A user can start through the CLI/TUI, messaging gateway, or ACP editor integration; requests enter the agent’s conversation loop, which prepares context, calls a model, and can dispatch tools before returning a response. The README also documents distinct learning, automation, delegation, and research capabilities. The sampled sources confirm ACP session/server behavior and context-engine responsibilities; other subsystem links below reflect README-level product descriptions, not inspection of their unsampled implementations.
Main entry points: conversation_loop.py Conversation loop · tui_gateway/server.py Messaging gateway · console_engine.py CLI / TUI · acp_adapter/server.py ACP server
Components 18
User surfaces
- CLI / TUI
hermes_cli/console_engine.py - Messaging gateway
tui_gateway/server.py - ACP server
acp_adapter/server.py - ACP sessions
acp_adapter/session.py
Agent runtime
- Conversation loop
agent/conversation_loop.py - Context engine
agent/context_engine.py - Context compressor
agent/context_compressor.py - Model providers
agent/provider_registry.py - Tool execution
agent/tool_executor.py - Terminal backends
tools/environments/local.py
Agent capabilities
- Learning and skills
agent/learning_graph.py
Memory and state
- Agent memory
agent/memory_manager.py - Session history
hermes_state_sessions.py
Automation and research
- Scheduled jobs
cron/jobs.py - Subagents
tools/async_delegation.py - Research trajectories
agent/trajectory.py
Other components
- User
- Model service
Connections 19
- User → CLI / TUI: starts chat
- User → Messaging gateway: messages
- User → ACP server: uses editor
- CLI / TUI → Conversation loop: starts turns
- Messaging gateway → Conversation loop: routes requests
agent/conversation_loop.py - ACP server → ACP sessions: manages sessions
acp_adapter/server.py - ACP sessions → Conversation loop: runs agent
acp_adapter/session.py - Conversation loop → Context engine: manages context
agent/conversation_loop.py - Context engine → Context compressor: uses default
agent/context_engine.py - Conversation loop → Model providers: selects provider
- Model providers → Model service: sends requests
- Conversation loop → Tool execution: dispatches tools
- Tool execution → Terminal backends: executes commands
- Conversation loop → Session history: records history
- Conversation loop → Agent memory: uses learned memory
- Conversation loop → Learning and skills: creates skills
- Scheduled jobs → Messaging gateway: delivers jobs
- Conversation loop → Subagents: delegates work
- Conversation loop → Research trajectories: generates traces