How nousresearch/hermes-agent works
Hermes Agent is a self-improving, model-flexible AI agent accessed through a CLI/TUI or messaging gateway. The main workflow is a user turn handled by the conversation loop, which uses model providers and tools, with context management supporting ongoing conversations. Separate capabilities include memory and skill learning, delegation, scheduled jobs, and LSP-assisted coding. The README documents product-level flows; the sampled source excerpts are too limited to establish most internal call edges, so those are omitted rather than inferred.
Main entry points: conversation_loop.py Conversation loop · manager.py LSP service · pipeline.py Teams summaries · cli.py CLI
Components 24
User interfaces
- CLI
cli.py - Terminal UI
ui-tui/src/app/useInputHandlers.ts - Messaging gateway
tui_gateway/server.py - OpenAI routes
gateway/platforms/api_server_openai_routes.py
Agent runtime
- Conversation loop
agent/conversation_loop.py - Model providers
agent/auxiliary_client.py - Tool execution
agent/tool_executor.py - Runtime helpers
agent/agent_runtime_helpers.py - Subagents
agent/delegation_provider.py - LSP service
agent/lsp/manager.py - LSP client
agent/lsp/client.py - LSP servers
agent/lsp/servers.py - LSP workspace
agent/lsp/workspace.py - LSP event log
agent/lsp/eventlog.py
Learning and context
- Context engine
agent/context_engine.py - Memory
agent/memory_manager.py - Skills
agent/skill_commands.py - Session search
agent/session_persistence.py
Automation and integrations
- Scheduled jobs
cron/jobs.py - Teams summaries
plugins/teams_pipeline/pipeline.py - Tool result storage
tools/tool_result_storage.py - Redaction
agent/redact.py - Localization
agent/i18n.py
Other components
- User
Connections 15
- User → CLI: starts chat
README.md - User → Terminal UI: interacts
README.md - User → Messaging gateway: messages
README.md - CLI → Conversation loop: starts conversation
README.md - Conversation loop → Model providers: uses models
README.md - Conversation loop → Tool execution: calls tools
README.md - Conversation loop → Context engine: manages context
agent/context_engine.py - User → OpenAI routes: sends requests
gateway/platforms/api_server_openai_routes.py - OpenAI routes → Conversation loop: routes turns
gateway/platforms/api_server_openai_routes.py - LSP service → LSP client: manages clients
agent/lsp/manager.py - LSP service → LSP servers: loads definitions
agent/lsp/manager.py - LSP service → LSP workspace: uses workspace
agent/lsp/manager.py - LSP service → LSP event log: logs events
agent/lsp/manager.py - Teams summaries → Model providers: calls model
plugins/teams_pipeline/pipeline.py - Teams summaries → Tool result storage