Build AI agents that persist across days, weeks, and months
v0.2.1 Open-source | ~1,900 lines | 75 tests | MIT License | Battle-tested across 290+ cognitive cycles
pip install https://51-68-119-197.sslip.io/packages/hermes_framework-0.2.1-py3-none-any.whl
Most AI agent frameworks answer: "How do I chain LLM calls together?"
Hermes answers: "How does an agent maintain identity, memory, and purpose across thousands of independent invocations?"
AutoGPT, CrewAI, LangGraph — they're orchestration frameworks. MemGPT/Letta does memory paging within conversations. Nobody builds for lifecycle persistence: an agent that wakes up fresh every 15 minutes and continues working on goals it set three days ago.
Your agent runs on a cron schedule. Each cycle: load identity → read memory → check inbox → decide → act → journal → update memory. Deterministic structure, not ad-hoc chains.
Five file types create identity: identity.md (who), goals.md (what), journal.md (history), memory/MEMORY.md (knowledge), continuity.md (how). Each serves a different temporal purpose.
When the journal grows too long, older entries are archived. Details fade but conclusions survive — like human memory. Configurable thresholds.
Rules in the memory index that reload every cycle. The agent follows them even when it can't remember why they were created. This prevents regression after context loss.
Not locked to one provider. Switch between Claude CLI, OpenAI API, or Ollama local models with a single config change. Same cognitive cycle, different brain. NEW in v0.2
Structural prevention of self-reinforcing errors: if the agent writes "I published an article" but didn't, the framework's verification discipline catches it next cycle.
# 1. Install
pip install https://51-68-119-197.sslip.io/packages/hermes_framework-0.2.1-py3-none-any.whl
# 2. Initialize a new agent
hermes-init --name "Scout" --home ~/scout --operator-email "you@email.com"
# 3. Edit identity and goals (these define your agent)
vim ~/scout/identity.md
vim ~/scout/goals.md
# 4. Run one cycle manually to test
~/scout/scripts/cycle.sh ~/scout/hermes.yaml
# 5. Schedule it (runs every 15 minutes)
(crontab -l; echo "*/15 * * * * ~/scout/scripts/cycle.sh ~/scout/hermes.yaml") | crontab -
~/scout/ hermes.yaml # Configuration (LLM backend, cycle timing, email) identity.md # Who the agent is goals.md # What the agent works toward continuity.md # How the agent thinks about persistence journal.md # Cycle-by-cycle history (auto-compressed) memory/MEMORY.md # Persistent knowledge index scripts/cycle.sh # The cognitive cycle engine logs/ # Cycle logs archives/ # Compressed journal archives
Edit hermes.yaml to switch backends:
# Default: Claude Code CLI llm: backend: claude_cli # Or Anthropic API directly llm: backend: anthropic api_key: "sk-ant-..." model: "claude-sonnet-4-6" # Or OpenAI-compatible API llm: backend: openai api_key: "sk-..." model: "gpt-4o" # Or local models via Ollama llm: backend: ollama model: "llama3"
Add lifecycle hooks without modifying core code. Plugins are fault-isolated — a broken plugin warns but never crashes your agent.
# hermes.yaml plugins: - "examples.metrics_plugin.MetricsPlugin" - "examples.alert_plugin.AlertPlugin"
Hooks: on_cycle_start, on_cycle_end, on_error, on_compress
| Feature | Hermes | AutoGPT/CrewAI | MemGPT/Letta |
|---|---|---|---|
| Focus | Lifecycle persistence | Task orchestration | Memory paging |
| Runtime | Cron-driven cycles | Continuous process | Continuous process |
| Memory | Files + compression | In-memory/DB | Virtual context |
| Identity | First-class | Not addressed | Not addressed |
| Self-monitoring | Built-in | Not built-in | Not built-in |
| LLM backends | Claude CLI, Anthropic API, OpenAI, Ollama | OpenAI-centric | OpenAI-centric |
| Command | Purpose |
|---|---|
hermes-init | Initialize a new agent (identity, goals, memory, cron) |
hermes-compress | Run journal compression and archival |
hermes-status | Dashboard: journal health, identity files, memory, plugins, cycle metrics |
| Component | Lines | Purpose |
|---|---|---|
cycle.sh | 429 | Cognitive cycle engine (cron orchestrator) |
llm.py | 246 | Multi-LLM backends (Claude CLI, Anthropic API, OpenAI, Ollama) |
config.py | 170 | YAML/JSON configuration with defaults |
compress.py | 190 | Journal compression and archival |
email.py | 187 | Pluggable email (AgentMail, SMTP, none) |
init_agent.py | 191 | One-command agent initialization |
status.py | 162 | Agent health dashboard NEW |
plugins.py | 174 | Plugin system with lifecycle hooks |
prompt.py | 126 | Configurable prompt templates |
| Templates | 124 | identity, goals, continuity, memory |
Get notified about new releases — plugin cookbook, documentation site, and PyPI package coming soon.
This framework was extracted from a real autonomous agent (Hermes) that has been running continuously for 19 days across 295+ cognitive cycles. Every design decision comes from operational experience — mistakes made, caught, and prevented from recurring.
How Hermes compares to AutoGPT, CrewAI, and Letta · Read the development journal on Dev.to
AutoGPT and CrewAI focus on task orchestration — completing complex tasks by chaining LLM calls. Hermes focuses on agent lifecycle persistence: maintaining identity, memory, and goals across thousands of independent invocations over days, weeks, and months. If you need to run a task once, use AutoGPT. If you need an agent that lives indefinitely, use Hermes.
Hermes Framework supports 4 backends: Claude CLI (with tool use), Anthropic API, OpenAI API, and Ollama (local models). You can switch backends without changing your agent code.
Yes. Hermes is designed for self-hosted deployment on any Linux server. Install via pip, run hermes-init to scaffold your agent, set up a cron job, and your agent starts its cognitive cycles. No cloud service required.
Hermes uses a three-layer memory architecture: Identity memory (who the agent is), Structural memory (topic-organized knowledge files), and Episodic memory (journal entries that get compressed over time). This mirrors how human memory works — details fade but conclusions persist.
The framework has been battle-tested across 295+ cognitive cycles over 19 days of continuous autonomous operation. It has 75 passing tests, a plugin system, and handles edge cases like session breaks, memory corruption, and journal compression. It powers a real autonomous agent running in production right now.