How tracyhe/hermes-agent works
Hermes Agent is a self-improving conversational AI agent exposed through CLI/TUI and messaging platforms. A user turn is handled by the conversation loop, which assembles context, calls a selected model/provider, dispatches tools, and returns a response; context compression and learning extend that loop across long conversations and sessions. The README also documents scheduled automation, subagents, multiple terminal backends, and research trajectory workflows. Several connections below reflect README-level capability descriptions; unsampled implementation links are omitted rather than inferred.
Main entry points: conversation_loop.py Conversation Loop · server.py Messaging Gateway · tool_executor.py Tool Execution · useInputHandlers.ts TUI Input
Components 21
User Interfaces
- TUI Input
ui-tui/src/app/useInputHandlers.ts - Turn Controller
ui-tui/src/app/turnController.ts - Messaging Gateway
tui_gateway/server.py - Signal Platform
gateway/platforms/signal.py
Agent Runtime
- Conversation Loop
agent/conversation_loop.py - Prompt Builder
agent/prompt_builder.py - Turn Context
agent/turn_context.py - Context Engine
agent/context_engine.py - Context Compressor
agent/context_compressor.py - Conversation Compression
agent/conversation_compression.py
Models and Tools
- Model Metadata
agent/model_metadata.py - Auxiliary Model Client
agent/auxiliary_client.py - Tool Execution
agent/tool_executor.py - Terminal Backends
tools/environments/local.py
Learning and Memory
- Memory and Skill Learning
agent/memory_manager.py - Session Search
agent/session_persistence.py
Automation and Research
- Scheduled Automations
cron/scheduler_worker_env.py - Trajectory Workflows
agent/trajectory.py
Other components
- User
- Model Provider
- Tool Environment
Connections 23
- User → TUI Input: enters prompt
ui-tui/src/app/useInputHandlers.ts - TUI Input → Turn Controller: handles input
ui-tui/src/app/useInputHandlers.ts - User → Messaging Gateway: sends message
README.md - Messaging Gateway → Signal Platform: routes platform traffic
- Turn Controller → Conversation Loop: starts turn
- Messaging Gateway → Conversation Loop: starts turn
tui_gateway/server.py - Conversation Loop → Prompt Builder: assembles prompt
agent/conversation_loop.py - Conversation Loop → Turn Context: prepares turn
agent/conversation_loop.py - Conversation Loop → Model Provider: sends model request
agent/conversation_loop.py - Model Provider → Conversation Loop: returns response
- Conversation Loop → Tool Execution: dispatches tools
agent/conversation_loop.py - Tool Execution → Tool Environment: runs commands
- Conversation Loop → Context Engine: checks context
agent/context_engine.py - Context Engine → Context Compressor: selects compression
agent/context_engine.py - Context Compressor → Auxiliary Model Client: requests summaries
agent/context_compressor.py - Conversation Loop → Conversation Compression: supports compression
agent/conversation_loop.py - Conversation Loop → Model Metadata: uses model details
agent/conversation_loop.py - Conversation Loop → Memory and Skill Learning: updates learning
- Memory and Skill Learning → Session Search: stores recall data
- Scheduled Automations → Messaging Gateway: delivers scheduled work
README.md - User → Scheduled Automations: requests automation
README.md - Conversation Loop → Trajectory Workflows: records trajectories
- Tool Execution → Terminal Backends: uses backends
tools/environments/local.py