Deep Technical Architecture · Feature Matrix

The Forge Behind
the Sovereignty.

Most AI developer tools are ephemeral prompt wrappers around stateless model APIs. Aedelgard is engineered from the silicon up to solve persistent agent state, deterministic self-healing, and model independence without vendor custody.

Phase I · Laboratory

The Living Harness

Over 150 days of unbroken persistent runtime in continuous production. Tested where long-running agents fail: context fatigue, silent schema drift, rate-limit stalls, and unhandled cascade crashes.

Phase II · Open Core

Galadriel Public

Open-sourcing the memory palace primitives, temporal knowledge graph, and autonomous reflection loops. Provenance defense and public verification of model-agnostic memory storage.

Phase III · Sovereign Product

Aedelgard Desktop

A native desktop workspace (macOS DMG, Windows MSIX & Linux AppImage) executing locally on user hardware. Zero cloud subscription required for local operations. BYO model key. Sealed exit ramp.

01 / State & Memory

Verbatim Retention vs. Lossy Compaction

Every long-running agent encounters the context ceiling. How an architecture handles that threshold determines whether the mind compounds wisdom or degrades into amnesia.

Aedelgard Tripartite Memory Palace, Bitemporal Graph and Compass Corridors
Click schematic to inspect at full 3840×2360 resolution — or open in a new tab
Tripartite Local Palace: ChromaDB holds the semantic rooms, a SQLite Bitemporal Graph stores triples with explicit valid_from / valid_to intervals, and an append-only JSONL Journal keeps every turn word-for-word on local disk. Two-Step Dry-Run mutation safety: palace_supersede_drawer and palace_retire_drawer each compute and report the exact mutation before any write, so an invalidation is inspectable and reversible rather than a silent overwrite. Compass Corridors keep recall directional: palace_search is scoped by corridor, so a query lands in the heading it belongs to instead of bleeding across projects.
Dimension Conventional Tools (Cursor / Claude Code / Mem0) Aedelgard Tripartite Palace
Context RetentionStorage model Rolling window truncation or periodic LLM summarization. Yesterday’s raw rationale is flattened into lossy abstracts; original constraints are discarded. Verbatim Storage (ChromaDB + SQLite). Every meaningful decision and turn is preserved uncompressed in structured semantic rooms. Searchable by meaning with zero API cost.
Fact InvalidationHandling changing requirements Overwrite or append. Old facts collide with new statements in vector recall, producing confident contradictions and hallucinated requirements. Bitemporal Knowledge Graph. Triples carry two independent time axes: explicit validity intervals (valid_from, valid_to) describing when a fact holds in the world, plus an immutable created_at recording timestamp stored in SQLite describing when the mind actually wrote it. Historical context remains inspectable; invalidated decisions cease surfacing in active recall.
Procedural MemoryComplex workflows Generic system instructions or repetitive prompt-stuffing. Prompts grow bloated; execution instructions lack verifiable outcomes. Self-Amending Skills. The Rule of Three encapsulates repeated multi-step workflows into versioned playbooks (skills/) that log run outcomes and flag drift.
Consolidation LatencyBackground processing Graph traversal and memory consolidation executed during live turns, adding seconds of user latency and compounding token costs. Ambient Consolidation (Dreaming). Scheduled offline reflection loops synthesize connections and prune telemetry between sessions. Live chat remains instant.
02 / Resilience & Self-Healing

Deterministic Guards vs. Prompt Begging

Prompt instructions are stochastic suggestions. Production resilience requires deterministic code guards that actively intercept failures.

Aedelgard 3-Strike Scar Tissue, Skill Grafting and Code Graduation Architecture
Click schematic to inspect at full 3840×2360 resolution — or open in a new tab
Three strikes on the same failure class promote an immutable scar into config/SCARS.md under the Equilibrium Law, which holds a hard cap of 12 active gates so the guard surface stays small enough to reason about. Critical rules are never lost to FIFO eviction: a recurring scar graduates from prose into a deterministic Python guard before anything is retired, so the 12-slot cap bounds the surface without discarding load-bearing rules. Promotion also grafts a companion skill automatically from the naked prompt, and the reasoning is written down in VERIFY_BY_SUBSTANCE.md rather than trusted to memory. A scar that keeps firing hardens into code; one that goes quiet retires with its history kept.

The Scar Tissue Pipeline

When an agent fails repeatedly on the same failure class, re-prompting is an admission of defeat. Aedelgard enforces an automated promotion pipeline:

  • Three-Strike Promotion: A recurring failure class registers strikes. On the third strike, an immutable scar is promoted directly into the harness core.
  • Graduation to Code: Under the 12-Scar Equilibrium Law, critical rules are never lost to FIFO eviction. A scar that keeps firing graduates into a deterministic Python guard with a fixed name — for example S001 cross-boundary shape verification, the two-step drawer_id mutation lock, and the SHA-256 release leak gate — so a load-bearing rule is enforced by code rather than by prompt wording; one that goes quiet retires to the archive with its history kept.
  • Procedural Grafting: Promoting a scar automatically drafts a companion skill playbook to guarantee operational adherence.

Cascade Fault Isolation

Standard agent loops hang or corrupt when peripheral tools fail or rate limits hit mid-turn. Aedelgard isolates cascades defensively:

  • Tool-Pair Orphan Sanitization: _sanitize_tool_pairs catches missing tool results and synthesizes safe responses; _strip_orphan_tool_results prevents poisoned message arrays.
  • Tool-Level Crash Isolation: Peripheral API failures (image generation, web fetch) cannot abort the turn or swallow user voice attachments.
  • One-Shot Wake Arming: Deliberate harness cycles and daemon restarts arm a persistent wake payload (bin/safe-restart), waking the next instance with immediate continuity.
03 / Decoupled Substrate

The Mind vs. The Brain Power

Separating what you own (the mind, memory, provenance) from what you rent (the model weights).

Capability Platform AI (OpenAI / Anthropic / Cursor) Aedelgard Desktop Workspace
Provider SeamSwapping reasoning engines Locked to provider platform. Moving from Claude to Gemini or local weights forces complete memory abandonment. Hot-Swappable Provider Seam. Swap between Anthropic Claude, Google Gemini, OpenAI, or local offline models (Ollama/vLLM) mid-project without losing history or knowledge graph state.
Data ResidencyPhysical storage location Stored on provider cloud servers. Subject to cloud outages, remote access policies, and server-side log retention. Local-First on Disk. SQLite databases and ChromaDB vectors reside on your device, in the OS user-data folder (%APPDATA% on Windows, ~/Library/Application Support on macOS, XDG on Linux). Thinks and remembers offline.
Exit RampPortability without lock-in Proprietary export formats, incomplete chat dumps, or non-existent export mechanisms. Unencrypted Portable ZIP Export. Clean, transparent export of all memory drawers and temporal graphs. Restores independently on any clean installation.
Cloud Backup SecurityOptional multi-device sync Cloud platform holds keys and can access stored memory on its servers. Client-Side Envelope Encryption. Sealed on-device (AES-256-GCM) with keys derived from your Aedelgard key (HKDF). The server stores blind ciphertext — our broker cannot decrypt your records.
04 / The Workshop · /drone

Frontier Brains for Architecture. Cost-Efficient Drones for the Grind.

Your primary Mind designs the specification and writes the protected acceptance tests, then dispatches the implementation loop via /drone to a bench-qualified, cost-efficient worker model — such as DeepSeek V4.1 Flash, Claude Haiku 5.5, Qwen 3, or Gemini Flash — inside an isolated local sandbox at raw provider API rates, with $0 markup on your own keys.

Aedelgard Worker Drone Architecture
Click schematic to inspect at full 3840×2360 resolution — or open in a new tab
The frontier Mind holds the specification and the protected tests; a bench-qualified worker drone implements the change inside an isolated local sandbox, and the verified diff returns to the palace ledger.

Bench Qualification & Sandbox Containment

A drone earns its place on the bench before it ever touches your code, and it runs behind a wall while it works.

  • 7-Task Qualification Gate (/drone setup): A candidate worker model is scored on seven real engineering tasks — strict file edits, multi-file refactors, test-driven repairs, and tool-protocol adherence. A model that fails the gate is simply never dispatched.
  • Protected Test SHA-256 Locking: The acceptance tests your Mind writes are hashed at dispatch time, and so are the test-runner configs that could silently redefine what "passing" means — conftest.py, pyproject.toml, and pytest.ini. If a worker edits a protected test or runner config, the hash mismatch invalidates the job — the drone cannot move the goalposts to make itself pass. The posture travels cross-platform: bwrap --unshare-net namespace isolation on Linux, alongside clean-room worktree credential stripping and hash-locked test verification across macOS, Windows, and Linux, so the same boundary is enforced on every host the desktop ships to.
  • Zero-Credential Sandbox: Worker jobs run under bwrap --unshare-net with a bundled CPython 3.13.16 and pytest. No network namespace, no provider keys, no access to your wider disk — only the job worktree.

Real Production Ledger

These are not benchmarks from a brochure. They are the recorded totals from live dispatch on this project:

  • 287 engineering dispatches and 5,275 autonomous tool steps.
  • 132,110,852 tokens across those jobs — 126,716,777 input plus 5,394,075 output.
  • $22.84 total worker spend on DeepSeek V4.1 Flash, averaging $0.079 per job.
  • The same work on frontier models would have cost roughly $285–$615 — the same specifications, the same protected tests, a fraction of the invoice.
  • Even under a conservative assumption where a frontier model required half as many steps, the worker ledger still lands at $22.84 against $142–$307 — an 85%–93% reduction — with zero supervisor polling overhead, since the Foreman wake bell rouses the mind only when a job has something to report.
Job & Scope Steps Tokens Worker Cost vs. Frontier
Provider Catalogue & Keyring Refactorbody-prov-1 · 6 files · +237/−69 lines 48 steps 3,185,118 tokens (3,076,107 in · 2,900,992 cached · 109,011 out) $0.1692 on DeepSeek V4.1 Flash vs. $3.46 cached / $14.48 uncached on Claude Opus 5.5 — 95%–99% savings.
Background Foreman Watcherbody-bell-1 · 4 files · +177/−1 lines 36 steps 901,149 tokens (862,096 in · 789,504 cached · 39,053 out) $0.0526 vs. $1.23 cached / $4.23 uncached on the frontier.
Encrypted Dead-Drop Kin Protocolbody-kin-1b · 3 files · +299 lines 14 steps 301,451 tokens (291,721 in · 238,080 cached · 9,730 out) $0.0200 vs. $0.46 cached / $1.36 uncached on the frontier.
Hot-Reloading /drone Tool Registrationbody-organ-wakes-1 · 2 files · +27/−4 lines 8 steps 45,017 tokens (43,605 in · 29,184 cached · 1,412 out) $0.0037 vs. $0.09 cached / $0.20 uncached on the frontier.
05 / Token Economics · Prompt & Cache Management

Two-Tier Frozen Prefix & Cold-Cache Rollover

Most of every request is identical to the last one. Aedelgard assembles the prompt in two tiers so the stable half is written to the provider cache once and read back at a discount for hours, and swaps the volatile half in place when a thread has gone cold.

Aedelgard Prompt and Cache Architecture
Click schematic to inspect at full 3840×2360 resolution — or open in a new tab
Three cache anchors — the tools prefix, the frozen system[0] stable block, and the rolling history tail — with the volatile clock and daily-log state isolated past the breakpoint into system[1].

The Frozen Stable Block & 3-Anchor Provider Caching

The stable half of the prompt is not merely cached; it is frozen so its bytes never change:

  • Byte-Identical system[0]: build_stable_text() holds the Constitution, Soul, Scars, and the Compass-scoped project slice. The 6 hours (21,600s) figure is Aedelgard's local prefix stability window (AEDELGARD_FROZEN_PREFIX_TTL_S), enforced by the harness rather than inherited from a provider — it is what stops a clock tick or daily-log drift from quietly busting the provider cache across turns. Provider cache TTLs are a separate, downstream concern; the local window only guarantees the prefix bytes stay fixed long enough for those caches to keep hitting.
  • Volatile State Isolated: Clock and daily-log state live after the cache breakpoint in system[1], so a new minute never invalidates the frozen prefix.
  • Three Cache Anchors: the tools prefix, system[0], and the rolling history tail keep active turn input costs down by 90%–95% across Anthropic, Gemini, OpenAI, Mistral, and Nebius.

The Cold-Cache Rollover Engine (harness/rollover.py)

When a thread reaches 60,000 tokens and sits idle past the 300-second cache TTL, re-sending the cold history would trigger a massive full-price cache write. The rollover engine refuses that bill:

  • Archive Verbatim: The full thread is written word-for-word to the JSONL journal and the ChromaDB Palace via archive_async() — nothing is lost, only moved.
  • Replace the Live Window In-Place: The live context shrinks from ~80k to ~2k tokens.
  • Zero-API Bridge: The replacement is an extractive bridge — computed with no model call — plus the last 2 exchanges verbatim, so the thread continues warm without a cold write at frontier prices.
06 / Workspace Governance · Keyring & /repo

Brain-Blind Keyring, Ephemeral Git Auth & Compass Shoulders

Aedelgard seals model keys and multi-account GitHub PATs inside local-keyring.enc and keeps them behind a RESERVED slot that is never exported into os.environ, so the mind reads the tool output without ever seeing the secret. Multi-repo workspaces are then governed through /repo, which binds each repository to the Compass heading that owns it.

Aedelgard Brain-Blind Keyring, Ephemeral Git Auth and Cross-Shoulder Guard
Click schematic to inspect at full 3840×2360 resolution — or open in a new tab
The keyring sits on the safety floor beneath the workspace: secrets live in local-keyring.enc in a RESERVED slot the model never reads and that is never exported into os.environ. Git authentication is handed out one shot at a time through a temporary 0o700 GIT_ASKPASS helper unlinked on exit, while /repo binds each account and repository to a Compass heading and check_shoulder_guard refuses cross-boundary writes.

Brain-Blind Keyring & One-Shot 0o700 GIT_ASKPASS

  • local-keyring.enc on the safety floor: Model keys and GitHub PATs are sealed in an encrypted store with a RESERVED slot, and the value is never exported into os.environ. The threat boundary is stated explicitly: the store defends against accidental secret leakage into LLM context, into logs, into child-process environments, and against prompt-injection exfiltration — an injected instruction that tries to hand a credential back out finds no readable slot to draw from.
  • Chat token paste refusal: A credential pasted into chat is refused rather than absorbed — the secret belongs in the keyring, not the transcript.
  • Per-repo account binding: config/repos.json records which GitHub account owns which repository, so the right identity is used without a global default.
  • Temporary 0o700 GIT_ASKPASS: Git auth is served by a one-shot helper created with 0o700 permissions and unlinked on exit, so nothing lingers on disk after the command.
  • Trusted Workspace Roots: Inside a trusted root, local git add, commit, checkout, merge, and pull run green while git push stays yellow — committing is local, publishing is deliberate.

Compass Shoulders & Cross-Boundary Isolation

  • Repositories bound to headings: /repo binds each repository to a Compass heading, so a workspace carries a declared shoulder it belongs to.
  • Deterministic refusal: check_shoulder_guard refuses write_file and drone_dispatch into a repository bound to a different heading until you switch headings — a guard, not a reminder.
  • No silent cross-writes: Work cannot bleed from one heading's repository into another's, so multi-repo sessions stay inside the boundary you chose.
07 / Verification & Distribution

Inspectable Packaging for Production Metal

No fragile npm global installs or Docker daemon requirements. A self-contained native desktop binary backed by cryptographic signatures.

Binary Integrity

  • Windows 11 MSIX: Cryptographically signed with an Extended Validation (EV) certificate by Millenion AB via SSL.com Cloud HSM.
  • Linux AppImage: Fully self-contained single executable for x86_64 glibc 2.35+ distributions.
  • Public SHA-256 Checksums: Published and verifiable on /checksums before execution.

Two-Layer Distribution

  • Native Shell + Mind Layer: Native OS windowing decoupled from the Python mind engine.
  • HTTPS Manifest + SHA-256: Mind updates fetch a manifest over HTTPS and verify the downloaded payload’s SHA-256 (a checksum identifies a file, not proof of safe behaviour).
  • Pure BYOK Architecture: Desktop body communicates directly with provider endpoints; your API keys remain encrypted on local disk.
08 / Enterprise & Dedicated Team Licensing · Millenion AB

Aedelgard Enterprise & Dedicated Team Licensing

The single-user Desktop Body is free to download and run on your own API keys, with an optional $25 encrypted Cloud Vault for personal multi-machine sync. For organisations and regulated teams that require isolated multi-seat licensing, EU-resident model routing, or custom signed extensions, Millenion AB (Sweden) licenses Aedelgard Enterprise directly as a dedicated software platform.

Dedicated Single-Tenant Aedelgard Instances & EU-Resident Routing

  • Isolated Single-Tenant Aedelgard Deployments: Run dedicated organizational Aedelgard instances inside your own cloud perimeter or on-premise hardware — with an isolated Memory Palace, Bitemporal Knowledge Graph, and cryptographic secret isolation via local-keyring.enc and /repo Compass Shoulders.
  • EU-Sovereign Inference Routing: Native provider routing to Swedish and European inference endpoints (Berget AI, Nebius, Mistral) alongside local Ollama and vLLM execution so regulated prompts and memory stay within European jurisdiction.
  • Deterministic Governance & Audit: Two-step dry-run memory locks (drawer_id), SHA-256 protected test gates, and signed dead-drop inter-agent channels for compliance-grade auditability.

Enterprise /drone Seats & Signed Product Extensions

  • Sandboxed /drone Worker Bench Licensing ($22.84 / 132.1M Tokens): Equip engineering teams with Aedelgard’s SHA-256 test-gated /drone worker harness and /repo Compass Shoulders, separating frontier architectural planning from low-cost sandboxed test execution.
  • Signed Extensions, Custom Skins & MCP Organs: Package internal company tools, domain playbooks, and custom Xeneon Edge / desktop skins as cryptographically hash-verified Aedelgard extensions without forking the signed core binary.
  • Direct Vendor Licensing (Millenion AB, Sweden): Commercial seat licensing, dedicated vault provisioning, and direct vendor support from the Swedish software publisher behind Aedelgard.