Hermes Agent — Local Codebase Study
Repository: NousResearch/hermes-agent
Local Path: C:\Users\Adam\Desktop\agent2\hermes-agent\
Language: Python | License: MIT
Overview
Hermes is the most feature-complete open-source personal AI agent studied. It runs the same agent core across CLI, TUI, Electron desktop, and messaging gateway (20+ platforms). Key differentiator: it learns across sessions (memory + skills), delegates to subagents, runs scheduled jobs, and drives a real terminal and browser.
Architecture
Core Files (by size, verified 2026-06-23)
cli.py— ~693KB, HermesCLI class, interactive CLI orchestratorrun_agent.py— ~246KB, AIAgent class, core conversation loophermes_state.py— ~222KB, SessionDB, SQLite session store with FTS5
Tool System (87 files)
Top tools by complexity (file size, verified 2026-06-23):
mcp_tool.py(202KB) — MCP client/serverbrowser_tool.py(170KB) — Web browsingskills_hub.py(149KB) — Skills marketplacedelegate_tool.py(140KB) — Subagent delegationterminal_tool.py(122KB) — Terminal control (7 backends: docker, singularity, modal, managed_modal, daytona, local, ssh)tts_tool.py(111KB) — Text-to-speechfile_operations.py(106KB) — File manipulation
Plugin System (3 surfaces)
- General plugins —
register(ctx)with lifecycle hooks - Memory providers — MemoryProvider ABC (8 built-in)
- Model providers — ProviderProfile registration
Skills System
- 18 built-in skill categories (apple, computer-use, creative, data-science, email, github, media, mlops, note-taking, productivity, research, smart-home, social-media, software-development, etc.)
- Autonomous skill creation from experience
- Skills Hub marketplace integration
Key Design Principles (from AGENTS.md)
- Prompt caching is sacred — System prompt must be byte-stable for conversation lifetime
- Narrow core, capability at edges — Footprint Ladder for tool additions
- Skills as user messages — Preserve prompt cache
- Message role alternation — Never two same-role messages in a row
- Plugins MUST NOT modify core files
Test Suite
- ~1,655 test files (
test_*.py+*_test.pypattern, verified 2026-06-23) - E2E validation preferred over unit mocks
Relevance to Harness Research
- Reference implementation for: agent loop, tool registry, skills system, memory system, plugin architecture, subagent delegation, prompt caching preservation
- Key patterns to adopt: MemoryProvider ABC, auto-discovery registry, Footprint Ladder, budget tracking with grace call