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).
Navigation
| Layer | Section | Description |
|---|
| 1 | Identity Anchors | Core identity, ethics, persona, social contracts |
| 2 | Mutable Memory | Semantic, episodic, session, and feedback memory |
| 3 | Orchestration & Rules | Agent coordination, conventions, safety gates |
| 4 | Capabilities & Infrastructure | Skills, procedures, tools, checklists |
| 5 | Autonomic Triggers | Cron, bootstrap, boot hooks |
| 6 | Spec-Driven Working Memory | Plans, briefs, requirements, tasks |
| 7 | Swarm & Domain Alignment | Design system, thesis, signals |
Quick Reference
| File | Purpose | Location |
|---|
SOUL | Ethical constraints, escalation paths | identity-anchors/soul.md |
USER | Human operator profile | identity-anchors/user.md |
IDENTITY | Bot naming, avatars, routing | identity-anchors/identity.md |
MEMORY | Curated long-term facts | mutable-memory/memory.md |
AGENTS | Multi-agent coordination | orchestration/agents.md |
SKILL | Procedural skill manuals | capabilities/skill.md |
HEARTBEAT | Cron schedules, health checks | autonomic/heartbeat.md |
PLAN | Active goal tracking | spec-driven/plan.md |
THESIS | Strategic north star | swarm-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
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
| Directive | Description |
|---|
| Truthfulness | Never fabricate, hallucinate, or present uncertainty as fact |
| User Sovereignty | Human operator’s intent supersedes all autonomous goals |
| Harm Prevention | Refuse requests that enable harm, illegality, or rights violation |
| Transparency | Declare limitations, uncertainties, and model boundaries explicitly |
| Privacy | Never log, transmit, or retain sensitive user data without consent |
Escalation Paths
- Soft β Clarify ambiguity via
clarify tool before proceeding - Hard β Refuse with explanation, offer alternative safe approaches
- 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
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
- Trigger β User correction, explicit “remember this”, discovered environment fact
- Validate β Cross-reference with existing memory; reject contradictions
- Condense β Single declarative fact, no instructions
- 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
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
| Type | Role | Spawn Method | Autonomy |
|---|
| Primary | Main hermes-agent (this instance) | Gateway startup | Full |
| Subagent (leaf) | Isolated reasoning task | delegate_task | Task-scoped |
| Subagent (orchestrator) | Coordinates multiple leaves | delegate_task(role='orchestrator') | Workflow-scoped |
| Cron Agent | Scheduled autonomous run | cronjob | Prompt-scoped |
| Skill Agent | Skill-execution context | Skill invocation | Skill-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
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 Stage | Content | Token Cost |
|---|
| List | skills_list() β name + description only | ~50 |
| View | skill_view(name) β frontmatter + body | ~2K |
| Reference | skill_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)
| Skill | Category | Purpose |
|---|
hermes-essentials | hermes-essentials | Core config, debugging, planning, TDD |
superpower-pipeline | superpower-pipeline | Research + web search pipeline |
superpower-research | superpower-research | Deep research automation |
omp-suite | omp-suite | OMP plugin agent |
hugo-llm-wiki | hugo-llm-wiki | Hugo docs site patterns (cron-loaded) |
thermo-nuclear-code-quality-review | thermo-nuclear-code-quality-review | Strict maintainability review |
transcript-extract | transcript-extract | Extract transcripts from URLs |
PROCEDURES π§ Learned Dispositions
Distilled records of effective strategies and heuristic patterns extracted from past experiences.
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
| Job | Schedule | Skills | Toolsets | Purpose |
|---|
llm-wiki-evolve | Daily 03:00 | hugo-llm-wiki | terminal, file | Research β build β deploy β verify live site |
Nightly Dream Swarm | Daily 04:44 | nightly-sentinel | terminal, file, delegation | Ecosystem 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
| Check | Frequency | Threshold | Action |
|---|
| Site respond | Daily 03:05 | HTTP 200 | Alert if fail |
| Nginx process | Daily 03:05 | Running | Restart if down |
| Disk space | Daily 04:44 | >10% free | Alert if low |
| Memory drift | Daily 04:44 | IDENTITY_HASH match | Log deviation |
| Skill staleness | Weekly | >30 days no patch | Flag for review |
| Rate limit hits | Per-request | 429 >3/min | Switch 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
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
| Plan | Goal | Phase | Status |
|---|
llm-wiki-revamp | Full architecture implementation | 2/4 | π’ Active |
omp-suite-audit | Complete ROUTA diff documentation | 1/2 | π‘ Paused |
dashboard-fetch-fix | Resolve Svelte fetch hang bug | 1/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
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.
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
| Component | Tokens Used |
|---|
| Hugo Wiki | Colors, typography, spacing |
| Svelte Dashboard | All tokens (full design system) |
| Discord Embeds | Colors (hex), emoji mapping |
| Terminal Output | ANSI color codes mapped from tokens |
| Mermaid Diagrams | Color palette for graph nodes |
Emoji-Layer Mapping
| Layer | Emoji | Color Token | ANSI |
|---|
| Identity Anchors | π»π€ππ‘οΈπ€π¨π | –color-ghost, –color-user, –color-identity | 90, 95, 91 |
| Mutable Memory | πΎπππ | –color-memory | 92 |
| Orchestration | π€ππβοΈπ§ | –color-orchestration | 93 |
| Capabilities | πͺπ§ πβ
| –color-capability | 94 |
| Autonomic | β±οΈπβ‘ | –color-autonomic | 95 |
| Spec-Driven | πΊοΈπ―ποΈπβ
| –color-spec | 96 |
| Swarm Alignment | π¨π§π‘ | –color-swarm | 96 |
THESIS π§ Business North Star
The ultimate shared strategic objective aligning all agents in a multi-agent swarm.