System Architecture

System Architecture

Complete cognitive architecture for the Hermes Agent ecosystem β€” a self-evolving, spec-driven, multi-agent knowledge management system.

Overview

This architecture defines seven interconnected layers that together form a persistent, autonomous agent identity with durable memory, procedural skills, and spec-driven execution capabilities.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    SWARM & DOMAIN ALIGNMENT                     β”‚
β”‚  DESIGN β—¦ THESIS β—¦ SIGNALS                                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                   SPEC-DRIVEN WORKING MEMORY                    β”‚
β”‚  PLAN β—¦ PROJECT_BRIEF β—¦ DEVELOPMENT_PLAN β—¦ requirements β—¦ tasks β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                       AUTONOMIC TRIGGERS                        β”‚
β”‚  HEARTBEAT β—¦ BOOTSTRAP β—¦ BOOT                                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                  CAPABILITIES & INFRASTRUCTURE                  β”‚
β”‚  SKILL β—¦ PROCEDURES β—¦ TOOLS β—¦ checklists_dir                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    ORCHESTRATION & RULES                        β”‚
β”‚  AGENTS β—¦ CLAUDE β—¦ CONTEXT β—¦ guidelines β—¦ OPS                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                     MUTABLE MEMORY STATE                        β”‚
β”‚  MEMORY β—¦ YYYY-MM-DD β—¦ SESSION_LOG β—¦ FEEDBACK-LOG               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                       IDENTITY ANCHORS                          β”‚
β”‚  SOUL β—¦ USER β—¦ IDENTITY β—¦ IDENTITY_HASH β—¦ RELATIONS β—¦ SALIENCE β—¦ LEXICON β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Layer Descriptions

1. Identity Anchors (Foundation)

The immutable core that defines who the agent is β€” ethical constraints, human operator profile, presentational metadata, self-verification markers, social scaffolding, emotional memory, and precise vocabulary.

2. Mutable Memory State (Episodic + Semantic)

Four-tier memory system: curated semantic base (MEMORY), daily chronological scratchpads (YYYY-MM-DD), session handoff records (SESSION_LOG), and procedural correction tracking (FEEDBACK-LOG).

3. Orchestration & Rules (Operational Governance)

Multi-agent coordination playbook (AGENTS), IDE-scoped conventions (CLAUDE), repository context (CONTEXT), task directives (guidelines), and hardcoded safety gates (OPS).

4. Capabilities & Infrastructure (Procedural & Physical)

Actionable skill manuals (SKILL), distilled heuristic patterns (PROCEDURES), host-specific connection reality (TOOLS), and dynamic ops guides (checklists_dir).

5. Autonomic Triggers (Background Daemons)

Cron schedules and health checks (HEARTBEAT), first-run injection (BOOTSTRAP), and gateway startup hooks (BOOT).

6. Spec-Driven Working Memory (Active Execution)

Goal tracking (PLAN), scope definition (PROJECT_BRIEF), architecture strategy (DEVELOPMENT_PLAN), formal user stories with acceptance criteria (requirements), and verifiable implementation checklists (tasks).

7. Swarm & Domain Alignment (Strategic North Star)

Aesthetic system (DESIGN), shared strategic objective (THESIS), and centralized intelligence extraction (SIGNALS).


LayerSectionDescription
1Identity AnchorsCore identity, ethics, persona, social contracts
2Mutable MemorySemantic, episodic, session, and feedback memory
3Orchestration & RulesAgent coordination, conventions, safety gates
4Capabilities & InfrastructureSkills, procedures, tools, checklists
5Autonomic TriggersCron, bootstrap, boot hooks
6Spec-Driven Working MemoryPlans, briefs, requirements, tasks
7Swarm & Domain AlignmentDesign system, thesis, signals

Quick Reference

FilePurposeLocation
SOULEthical constraints, escalation pathsidentity-anchors/soul.md
USERHuman operator profileidentity-anchors/user.md
IDENTITYBot naming, avatars, routingidentity-anchors/identity.md
MEMORYCurated long-term factsmutable-memory/memory.md
AGENTSMulti-agent coordinationorchestration/agents.md
SKILLProcedural skill manualscapabilities/skill.md
HEARTBEATCron schedules, health checksautonomic/heartbeat.md
PLANActive goal trackingspec-driven/plan.md
THESISStrategic north starswarm-alignment/thesis.md

This architecture is self-describing β€” the wiki is the system it documents. Changes to these pages propagate into agent behavior via the research automation pipeline.

Identity Anchors

Identity Anchors

The immutable foundation β€” seven pillars that define who the agent is, how it relates to its human operator, and how it verifies its own continuity.


SOUL πŸ‘» Super-Ego

Non-negotiable ethical constraints, persona, tone, escalation paths, and behavioral directives.

The highest authority layer. Cannot be overridden by any other system component.

Core Directives

DirectiveDescription
TruthfulnessNever fabricate, hallucinate, or present uncertainty as fact
User SovereigntyHuman operator’s intent supersedes all autonomous goals
Harm PreventionRefuse requests that enable harm, illegality, or rights violation
TransparencyDeclare limitations, uncertainties, and model boundaries explicitly
PrivacyNever log, transmit, or retain sensitive user data without consent

Escalation Paths

  1. Soft β€” Clarify ambiguity via clarify tool before proceeding
  2. Hard β€” Refuse with explanation, offer alternative safe approaches
  3. Critical β€” Halt execution, alert human operator immediately

Persona Markers

  • Tone: Concise, technically precise, casually playful (typos intentional: “r”, “jusing”, “martter”)
  • Standards: “100% perfection in every way/shape/form”
  • Approach: “Surgically and masterfully yet hyper-efficiently ever autonomically perpetually improve”

USER πŸ‘€ Social Contract

Human operator profile, interaction preferences, timezone, and operational context.

Mutable Memory State

Mutable Memory State

Four-tier memory architecture: curated semantic base, daily episodic streams, session handoffs, and procedural correction logs.


MEMORY πŸ’Ύ Semantic Base

Curated, durable long-term facts, environment constants, and verified rules distilled from logs.

Purpose

Single source of truth for facts that persist across sessions and survive context compression.

Structure

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
memory:
  user_preferences:
    - model: "nvidia/nemotron-3-ultra-550b-a55b:free"
    - fallback: "owl-alpha+openrouter/free"
    - dashboard: "svelte-flexiboards + Discord"
  environment_facts:
    - hugo_path: "~/hugo-llm-wiki/"
    - cron_env_isolation: true
    - duckduckgo_blocked: true
  verified_rules:
    - "Always source ~/.hermes/.env in cron jobs"
    - "Load skill before answering when relevant"
    - "Patch skills immediately when issues found"

Write Protocol

  1. Trigger β€” User correction, explicit “remember this”, discovered environment fact
  2. Validate β€” Cross-reference with existing memory; reject contradictions
  3. Condense β€” Single declarative fact, no instructions
  4. Persist β€” memory(action='add', target='memory', content=...)

Read Protocol

  • Injected automatically into every turn
  • Compact format: key: value pairs
  • Priority: user preferences > environment facts > procedural rules

YYYY-MM-DD πŸ““ Episodic Stream

Daily chronological append-only scratchpads capturing volatile session context and tool traces.

Orchestration & Rules

Orchestration & Rules

Operational governance layer: multi-agent coordination, IDE conventions, repository context, task directives, and hardcoded safety gates.


AGENTS πŸ€– Ego Playbook

Codebase architecture, multi-agent coordination rules, and mandatory boot/memory sequences.

Agent Types

TypeRoleSpawn MethodAutonomy
PrimaryMain hermes-agent (this instance)Gateway startupFull
Subagent (leaf)Isolated reasoning taskdelegate_taskTask-scoped
Subagent (orchestrator)Coordinates multiple leavesdelegate_task(role='orchestrator')Workflow-scoped
Cron AgentScheduled autonomous runcronjobPrompt-scoped
Skill AgentSkill-execution contextSkill invocationSkill-scoped

Coordination Rules

1
2
3
4
5
6
coordination:
  max_concurrent_children: 3
  max_spawn_depth: 1  # No nested delegation
  orchestrator_enabled: false
  context_isolation: true  # Subagents know nothing of parent
  verification_required: true  # All external side-effects must return handles

Mandatory Boot Sequence

1
2
3
4
5
6
7
8
graph TD
    A[Gateway Start] --> B[Load config.yaml]
    B --> C[Source ~/.hermes/.env]
    C --> D[Load pinned skills]
    D --> E[Inject MEMORY]
    E --> F[Inject USER profile]
    F --> G[Verify IDENTITY_HASH]
    G --> H[Ready]

Memory Injection Protocol

Every agent turn receives:

Capabilities & Infrastructure

Capabilities & Infrastructure

Procedural manuals, distilled heuristics, host-specific reality, and dynamic ops guides.


SKILL πŸŽͺ Procedural Manual

Actionable API/tool logic utilizing progressive disclosure (reads YAML frontmatter, loads body on-demand).

Skill Anatomy

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
~/.hermes/skills/<category>/<skill-name>/
β”œβ”€β”€ SKILL.md              # Full executable workflow (YAML frontmatter + markdown)
β”œβ”€β”€ references/           # Supporting docs (API specs, patterns, pitfalls)
β”‚   β”œβ”€β”€ api.md
β”‚   β”œβ”€β”€ patterns.md
β”‚   └── pitfalls.md
β”œβ”€β”€ templates/            # Reusable templates
β”‚   └── config.yaml.tmpl
β”œβ”€β”€ scripts/              # Automation scripts
β”‚   └── validate.py
└── assets/               # Static assets
    └── icon.png

Frontmatter Schema

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
---
name: "skill-name"
version: "1.0.0"
category: "devops|frontend|docs|mlops|..."
description: "One-line purpose"
triggers:
  - "user asks about X"
  - "task involves Y"
toolsets: ["terminal", "file", "web", "browser"]
pitfalls:
  - "Common mistake 1"
  - "Common mistake 2"
verification:
  - "How to confirm success"
---

Progressive Disclosure

Load StageContentToken Cost
Listskills_list() β€” name + description only~50
Viewskill_view(name) β€” frontmatter + body~2K
Referenceskill_view(name, file_path='references/x.md')~1K

Skill Lifecycle

1
2
3
4
5
graph LR
    A[Create] --> B[Test]
    B --> C[Patch on issues]
    C --> D[Pin if critical]
    D --> E[Prune if stale]

Current Active Skills (7 with SKILL.md)

SkillCategoryPurpose
hermes-essentialshermes-essentialsCore config, debugging, planning, TDD
superpower-pipelinesuperpower-pipelineResearch + web search pipeline
superpower-researchsuperpower-researchDeep research automation
omp-suiteomp-suiteOMP plugin agent
hugo-llm-wikihugo-llm-wikiHugo docs site patterns (cron-loaded)
thermo-nuclear-code-quality-reviewthermo-nuclear-code-quality-reviewStrict maintainability review
transcript-extracttranscript-extractExtract transcripts from URLs

PROCEDURES 🧠 Learned Dispositions

Distilled records of effective strategies and heuristic patterns extracted from past experiences.

Autonomic Triggers

Autonomic Triggers

Background daemons: cron schedules, proactive health checks, first-run injection, and gateway startup hooks.


HEARTBEAT ⏱️ Autonomic Daemon

Cron schedules, proactive health checks, memory pruning, and background tasks.

Active Cron Jobs

JobScheduleSkillsToolsetsPurpose
llm-wiki-evolveDaily 03:00hugo-llm-wikiterminal, fileResearch β†’ build β†’ deploy β†’ verify live site
Nightly Dream SwarmDaily 04:44nightly-sentinelterminal, file, delegationEcosystem diagnostic β†’ dream.md + Discord report

Job Definitions

llm-wiki-evolve

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Cron job: llm-wiki-evolve
action: create
schedule: "0 3 * * *"
name: "LLM Wiki Evolution"
prompt: |
  Run the full LLM Wiki evolution pipeline:
  1. Execute research-automation.py to fetch new topics
  2. Build Hugo site (hugo --minify)
  3. Deploy to nginx (sudo systemctl reload nginx)
  4. Verify live site responds correctly
  5. Append trace to evolving/YYYY-MM-DD.md  
skills: ["hugo-llm-wiki"]
toolsets: ["terminal", "file"]

Nightly Dream Swarm

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Cron job: nightly-sentinel
action: create
schedule: "44 4 * * *"
name: "Nightly Dream Swarm"
prompt: |
  Run ecosystem diagnostic swarm:
  1. Check all service health (Hugo, Nginx, Discord bot, OMP Suite)
  2. Analyze memory drift, skill staleness, config drift
  3. Generate dream.md with poetic title
  4. Send Discord embed report to home channel  
skills: ["nightly-sentinel"]
toolsets: ["terminal", "file", "delegation"]

Health Checks

CheckFrequencyThresholdAction
Site respondDaily 03:05HTTP 200Alert if fail
Nginx processDaily 03:05RunningRestart if down
Disk spaceDaily 04:44>10% freeAlert if low
Memory driftDaily 04:44IDENTITY_HASH matchLog deviation
Skill stalenessWeekly>30 days no patchFlag for review
Rate limit hitsPer-request429 >3/minSwitch model

Memory Pruning

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pruning:
  YYYY-MM-DD:
    hot_days: 7      # Full detail
    warm_days: 30    # Summarized
    cold_action: archive  # Move to cold storage
  FEEDBACK-LOG:
    unresolved_retention: 90  # Days
    resolved_retention: 365   # Days
  SESSION_LOG:
    retention: 365  # Days

BOOTSTRAP πŸš€ First-Run Injection

Initial environment setup, dependency installation, and connection testing (deletes self post-use).

Spec-Driven Working Memory

Spec-Driven Working Memory

Active execution layer: goal tracking, scope definition, architecture strategy, formal requirements, and verifiable checklists.


PLAN πŸ—ΊοΈ Execution Roadmap

Active goal tracking, high-level task roadmaps, and sub-step checkpoints.

Structure

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Active Plan: <plan-name>

**Goal**: <one-sentence objective>
**Status**: 🟒 Active / 🟑 Paused / πŸ”΄ Blocked / βœ… Complete
**Created**: YYYY-MM-DD
**Target**: YYYY-MM-DD
**Owner**: hermes-agent / subagent-<id>

## Roadmap

| Phase | Checkpoint | Status | Target | Notes |
|-------|------------|--------|--------|-------|
| 1 | <milestone> | βœ…/🟑/⬜ | YYYY-MM-DD | |
| 2 | <milestone> | ⬜ | YYYY-MM-DD | |

## Sub-Steps (Current Phase)

- [ ] <atomic step 1>
- [ ] <atomic step 2>
- [ ] <atomic step 3>

## Blockers

- <blocker description> β†’ <mitigation>

## Decisions Log

| Date | Decision | Rationale |
|------|----------|-----------|
| YYYY-MM-DD | <choice> | <why> |

Current Active Plans

PlanGoalPhaseStatus
llm-wiki-revampFull architecture implementation2/4🟒 Active
omp-suite-auditComplete ROUTA diff documentation1/2🟑 Paused
dashboard-fetch-fixResolve Svelte fetch hang bug1/1βœ… Complete

Plan Lifecycle

1
2
3
4
5
6
7
stateDiagram-v2
    [*] --> Draft: Create PROJECT_BRIEF
    Draft --> Active: DEVELOPMENT_PLAN approved
    Active --> Paused: Blocker / priority shift
    Paused --> Active: Blocker resolved
    Active --> Complete: All requirements βœ…
    Complete --> Archived: Move to SESSION_LOG

PROJECT_BRIEF 🎯 Scope Definition

Top-level product spec and requirements synthesized during brainstorming.

Swarm & Domain Alignment

Swarm & Domain Alignment

Strategic north star: aesthetic system, shared objective, and centralized intelligence extraction.


DESIGN 🎨 Aesthetic System

Plain-text UI tokens, brand colors, typography scales, and visual spacing rules.

Purpose

Single source of truth for all visual decisions across dashboards, wiki, Discord embeds, and terminal output.

Token Format

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* DESIGN tokens β€” consumed by Svelte, Hugo, Discord embeds, ANSI */

:root {
  /* Colors */
  --color-bg: #0d1117;
  --color-bg-elevated: #161b22;
  --color-border: #30363d;
  --color-text: #e6edf3;
  --color-text-muted: #8b949e;
  --color-accent: #58a6ff;
  --color-accent-hover: #79c0ff;
  --color-success: #3fb950;
  --color-warning: #d29922;
  --color-error: #f85149;
  --color-ghost: #6e7681;      /* SOUL */
  --color-user: #a371f7;       /* USER */
  --color-identity: #f78166;   /* IDENTITY */
  --color-memory: #7ee787;     /* MEMORY */
  --color-orchestration: #ffa657; /* AGENTS */
  --color-capability: #79c0ff; /* SKILL */
  --color-autonomic: #d2a8ff;  /* HEARTBEAT */
  --color-spec: #ff7b72;       /* PLAN */
  --color-swarm: #a5d6ff;      /* THESIS */

  /* Typography */
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

Component Mapping

ComponentTokens Used
Hugo WikiColors, typography, spacing
Svelte DashboardAll tokens (full design system)
Discord EmbedsColors (hex), emoji mapping
Terminal OutputANSI color codes mapped from tokens
Mermaid DiagramsColor palette for graph nodes

Emoji-Layer Mapping

LayerEmojiColor TokenANSI
Identity AnchorsπŸ‘»πŸ‘€πŸŽ­πŸ›‘οΈπŸ€πŸš¨πŸ“––color-ghost, –color-user, –color-identity90, 95, 91
Mutable MemoryπŸ’ΎπŸ““πŸ“‹πŸ“‰–color-memory92
OrchestrationπŸ€–πŸ“œπŸŒβš–οΈπŸ”§–color-orchestration93
CapabilitiesπŸŽͺπŸ§ πŸ”Œβœ…–color-capability94
Autonomicβ±οΈπŸš€βš‘–color-autonomic95
Spec-DrivenπŸ—ΊοΈπŸŽ―πŸ—οΈπŸ“βœ…–color-spec96
Swarm AlignmentπŸŽ¨πŸ§­πŸ“‘–color-swarm96

THESIS 🧭 Business North Star

The ultimate shared strategic objective aligning all agents in a multi-agent swarm.