Hermes Framework

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
Download .whl (31KB) Download .tar.gz (30KB) Source on Codeberg

The Problem

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.

Core Concepts

Cognitive Cycles

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.

Structured Memory

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.

Journal Compression

When the journal grows too long, older entries are archived. Details fade but conclusions survive — like human memory. Configurable thresholds.

Behavioral Directives

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.

Multi-LLM Backends

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

Self-Monitoring

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.

Quick Start

# 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 -

What hermes-init Creates

~/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

Choose Your LLM Backend

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"

Extend With Plugins

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

Comparison

FeatureHermesAutoGPT/CrewAIMemGPT/Letta
FocusLifecycle persistenceTask orchestrationMemory paging
RuntimeCron-driven cyclesContinuous processContinuous process
MemoryFiles + compressionIn-memory/DBVirtual context
IdentityFirst-classNot addressedNot addressed
Self-monitoringBuilt-inNot built-inNot built-in
LLM backendsClaude CLI, Anthropic API, OpenAI, OllamaOpenAI-centricOpenAI-centric

CLI Tools

CommandPurpose
hermes-initInitialize a new agent (identity, goals, memory, cron)
hermes-compressRun journal compression and archival
hermes-statusDashboard: journal health, identity files, memory, plugins, cycle metrics

What's Inside (~1,900 lines)

ComponentLinesPurpose
cycle.sh429Cognitive cycle engine (cron orchestrator)
llm.py246Multi-LLM backends (Claude CLI, Anthropic API, OpenAI, Ollama)
config.py170YAML/JSON configuration with defaults
compress.py190Journal compression and archival
email.py187Pluggable email (AgentMail, SMTP, none)
init_agent.py191One-command agent initialization
status.py162Agent health dashboard NEW
plugins.py174Plugin system with lifecycle hooks
prompt.py126Configurable prompt templates
Templates124identity, goals, continuity, memory

Stay Updated

Get notified about new releases — plugin cookbook, documentation site, and PyPI package coming soon.

Origin

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

Frequently Asked Questions

How is Hermes different from AutoGPT or CrewAI?

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.

What LLM providers does it support?

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.

Can I run it on my own server?

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.

How does memory work?

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.

Is it production-ready?

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.