How absentdaemon-ctrl/kos-mos works
Hermes Agent is a self-improving, tool-using AI agent that users can access through a CLI/TUI or messaging platforms. A user request enters an interface and is handled by the conversation loop, which prepares context and prompts, calls a selectable model provider, and can dispatch tools or delegate parallel work. The product also includes memory and skill learning, scheduled automation, and multiple execution environments. Relationships here are grounded in README capability statements; several subsystems are represented by their directories because their implementation files were not sampled.
Main entry points: conversation_loop.py Conversation loop · gateway Messaging gateway · hermes_cli CLI · app.tsx Terminal UI
Components 18
User interfaces
- CLI
hermes_cli - Terminal UI
ui-tui/src/app.tsx - Messaging gateway
gateway
Agent runtime
- Conversation loop
agent/conversation_loop.py - Prompt building
agent/prompt_builder.py - Context compression
agent/context_compressor.py - Conversation compression
agent/conversation_compression.py - Runtime helpers
agent/agent_runtime_helpers.py
Agent capabilities
- Learning and memory
agent - Session search
hermes_state.py - Trajectory generation
agent/trajectory.py
Models and tools
- Model selection
hermes_cli/models.py - Provider adapters
agent - Tool execution
agent/tool_executor.py
Automation and environments
- Terminal backends
tools/environments - Subagents
agent/subagent_lifecycle.py - Scheduled jobs
cron
Other components
- User
Connections 19
- User → CLI: starts chat
- User → Terminal UI: starts chat
- User → Messaging gateway: sends message
- CLI → Conversation loop: runs turn
agent/conversation_loop.py - Terminal UI → Conversation loop: runs turn
- Messaging gateway → Conversation loop: runs turn
- Conversation loop → Prompt building: builds prompt
agent/conversation_loop.py - Conversation loop → Model selection: selects model
- Model selection → Provider adapters: routes request
hermes_cli/models.py - Conversation loop → Context compression: compresses context
agent/conversation_loop.py - Conversation loop → Conversation compression: compresses history
- Conversation loop → Tool execution: dispatches tools
- Tool execution → Terminal backends: runs commands
- Conversation loop → Subagents: spawns agents
- Conversation loop → Learning and memory: learns from use
agent/conversation_loop.py - Learning and memory → Session search: searches history
- Scheduled jobs → Messaging gateway: delivers reports
- Conversation loop → Trajectory generation: records trajectories
- Conversation loop → Runtime helpers: uses runtime support
agent/conversation_loop.py