agentleFS
Hashi-Ai-DevHashi-Ai-Dev/HermitDoc/skills/hermes-concepts/SKILL.md

hermes-concepts

Skill4 starsChanged 7 months agoMITView on GitHub

Use when understanding Hermes architecture, concepts, or design. Covers: session system, context management, compression, bootstrap files, agent loop, lifecycle, profiles, checkpointing, context injection. Triggers on: concept, architecture, session, context, bootstrap, compression, lifecycle, how hermes works.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a session starts, context is assembled in this order:

    line 69
  2. Distinctive:

    When context reaches threshold, Hermes compresses:

    line 95

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Hermes Concepts Reference

Deep dive into Hermes Agent's core concepts and architecture.

Agent Loop

The core Hermes execution cycle:

  1. User Input → Message, voice, or platform event
  2. Context Assembly → Bootstrap files + session history + memory
  3. LLM Inference → Model generates response
  4. Tool Calls → Execute tools as needed
  5. Response → Send back to user/platform
  6. State Update → Update session, memory, compression if needed
  7. Loop → Continue until task complete or max_turns

Session System

Sessions track conversation context:

~/.hermes/sessions/
├── session-2026-05-18-abc123.json    # Active session
├── session-2026-05-17-def456.json    # Past sessions
└── ...

Session Lifecycle

CommandAction
Starthermes chat → new session ID
Resumehermes --resume <id> → reload session
Compress/compress → summarize context
EndSession stored, new session on reset

Session Metadata

{
  "id": "session-2026-05-18-abc123",
  "created": "2026-05-18T10:00:00Z",
  "last_active": "2026-05-18T14:30:00Z",
  "model": "anthropic/claude-sonnet-4",
  "profile": "default",
  "source": "cli",
  "message_count": 47,
  "compressed": false
}

Context Management

Context Assembly Order

When a session starts, context is assembled in this order:

  1. System prompt (from Hermes core)
  2. SOUL.md (persona)
  3. USER.md (user profile)
  4. AGENTS.md (operating instructions)
  5. Bootstrap files (IDENTITY.md, HEARTBEAT.md, MEMORY.md, TOOLS.md)
  6. Memory entries (from session_search)
  7. Session history (conversation turns)
  8. Current input

Context Window

Context window is limited by model's context_length:

ModelContext Window
Claude 3.5 Sonnet200K tokens
Gemini 2.0 Flash1M tokens
DeepSeek Chat V364K tokens
Llama 3.1128K tokens

Hermes manages context automatically via compression.

Compression

When context reaches threshold, Hermes compresses:

compression:
  enabled: true
  threshold: 0.50    # compress at 50% of context
  target_ratio: 0.20  # compress to 20% of original

Compression Process

  1. Identify least-recent relevant messages
  2. Generate summary of those messages
  3. Replace message sequence with summary
  4. Preserve critical context (user prefs, active tasks)
  5. Continue session with compressed history

Manual Compression

/compress   # Force immediate compression
/reset     # Clear and start fresh (no compression)

Bootstrap Files

Injected on first turn of each session:

FilePurpose
SOUL.mdPersona, tone, boundaries
USER.mdUser profile and preferences
AGENTS.mdOperating instructions
IDENTITY.mdName, emoji, display info
HEARTBEAT.mdPeriodic background tasks
MEMORY.mdPersistent memory entries
TOOLS.mdTool notes and usage patterns

These files live in ~/.hermes/ and are loaded at session start.

Agent Loop Lifecycle

┌─────────────────────────────────────────────────┐
│                 Session Start                    │
│  Load SOUL.md, USER.md, bootstrap files           │
│  Load memory, session history                    │
└────────────────────┬────────────────────────────┘
                     │
         ┌───────────▼───────────┐
         │   User Input          │
         └───────────┬───────────┘
                     │
         ┌───────────▼───────────┐
         │   Context Assembly    │◄── Session history
         │   + Memory            │◄── session_search
         │   + Bootstrap files   │
         └───────────┬───────────┘
                     │
         ┌───────────▼───────────┐
         │   LLM Inference       │
         │   (tool calls)        │
         └───────────┬───────────┘
                     │
         ┌───────────▼───────────┐
         │   Tool Execution      │
         │   (terminal, file,    │
         │    web, etc.)         │
         └───────────┬───────────┘
                     │
              ┌──────┴──────┐
              │ Compressed? │─── Yes ──► Compress and continue
              └──────┬──────┘
                     │ No
         ┌───────────▼───────────┐
         │   Response Output     │
         │   (text, voice,       │
         │    platform msg)     │
         └───────────┬───────────┘
                     │
         ┌───────────▼───────────┐
         │   Max turns reached?  │─── Yes ──► End session
         └───────────┬───────────┘
                     │ No
                     └──► Back to User Input

Checkpoints

Filesystem snapshots for rollback:

hermes config set checkpoints.enabled true
hermes config set checkpoints.max_snapshots 50
# Create manual checkpoint
/rollback

# List checkpoints
ls ~/.hermes/checkpoints/

# Restore checkpoint
/rollback 2  # restore 2nd most recent

Profiles

Isolated configurations and state:

~/.hermes/
├── config.yaml           # Default config
├── profiles/
│   ├── dev/
│   │   ├── config.yaml
│   │   ├── SOUL.md
│   │   ├── skills/
│   │   └── sessions/
│   └── prod/
│       └── ...

Profile Switching

hermes chat --profile dev
hermes profile use dev

Agent vs Subagent

AspectHermes AgentSubagent (delegate_task)
SessionFull session with historyFresh, isolated context
ToolsAll enabled toolsetsConfigurable subset
User interactionCan ask questionsCannot (self-contained)
LifespanLong-livedTask-scoped
MemoryCross-sessionSession-only
Use caseOngoing assistanceParallel work, isolation

References

Structured reference docs:

  • Decision Flow — Agent loop visualization
  • Session Lifecycle — Session management
  • Context Assembly — Context priority order

Related skills:

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.