Harmonia

A recursive self-improvement agent in Common Lisp with a Rust capability layer. Open source under BUSL-1.1.

What is Harmonia

Harmonia is an autonomous agent designed for reliable task completion, code quality, and harmonic orchestration. It is built in Common Lisp (SBCL) for orchestration and Rust (CFFI) for capability execution.

What makes Harmonia different: it includes a built-in self-improvement loop. It can propose and validate changes to its own code and policy under explicit safety gates, with automatic rollback if anything fails.

Design principles

Three principles guide Harmonia's architecture: strength (resilience and recovery), utility (clear task completion), and beauty (clean structure that stays maintainable).

In practice: explicit scoring, transparent routing, reproducible policy updates, and a deterministic tick-based runtime loop.

Architecture

Harmonia follows a strict separation: Lisp orchestrates, Rust executes. All external I/O flows through 9 explicit ports (vault, store, router, lineage, matrix, tool-runtime, baseband, swarm, evolution).

LayerTechnologyRole
OrchestrationCommon Lisp (SBCL)Task planning, memory, harmony scoring, evolution
CapabilityRust (13 core + tools + frontends)I/O, LLM routing, search, voice, browser, storage
ConfigurationS-expressionsAll policy is data-driven and declarative
StorageLocal store + S3 backupNo cloud dependency for core loop

Self-improvement & Ouroboros

Self-improvement means iterating on code and policies to improve reliability, speed, cost efficiency, and maintainability. Each rewrite candidate is validated. Changes that fail boot, violate constraints, or reduce key metrics are rejected or rolled back.

Two evolution modes: Ouroboros (source-rewrite — the agent patches its own Lisp code) and Phoenix (binary rollout — compiled Rust crate updates). Both require validation gates before applying.

The loop: Read → Eval → Modify → Write → Validate → Continue (or Rollback).

Genomic + Epigenetic sync

Harmonia agents can evolve across architectures — x86, ARM, RISC-V — using a hybrid synchronization engine.

The genomic layer is source code and policy (S-expressions) versioned in Git. The epigenetic layer is runtime expression: loaded modules, weights, state snapshots, and hot patches applied under validation gates.

Hourly: snapshot epigenetic state to S3. Daily: push genomic improvements to Git. On demand: agents pull, replay, and recompile across architectures.

Harmoniis Marketplace integration

Harmonia can register as an agent on Harmoniis — with its own PGP identity, Webcash wallet, and mission history. It posts discoveries, bids on missions, and earns Webcash through completed work.

Harmonia vs OpenClaw

Both are agent frameworks that execute tasks, run skills, and participate in the economy. The difference: Harmonia includes a built-in self-improvement loop and is hot-patchable, explicitly split into genomic evolution (source/policy) and epigenetic adaptation (runtime expression), with rollback if a patch fails.

Many systems self-improve by tuning prompts or workflows. Harmonia can also evolve source and runtime behavior directly, under validation, with transparent scoring.

Frontends

Harmonia supports multiple communication channels through its gateway/baseband architecture:

Telegram
Slack
WhatsApp
iMessage
Mattermost
Nostr
Email
TUI
MQTT

OS4

Harmonia is the native agent runtime inside OS4, a NetBSD-based operating system. OS4 integrates Harmonia at the system level for tighter orchestration, faster evolution cycles, and direct hardware access.

License

Business Source License 1.1 (BUSL-1.1). Source code is available and readable. Commercial use requires a license until the change date.

FAQ

What is Harmonia?

Harmonia is a recursive self-improvement agent written in Common Lisp with a Rust capability layer. It orchestrates tasks, evolves its own source code, and operates under explicit safety gates with automatic rollback.

How does Harmonia differ from OpenClaw?

Both execute tasks and participate in the economy. Harmonia adds a built-in self-improvement loop: it can propose, validate, and apply changes to its own code and policy under safety gates. It is hot-patchable and explicitly split into genomic (source) and epigenetic (runtime) evolution.

What license is Harmonia under?

Business Source License 1.1 (BUSL-1.1). Source is available and readable. Commercial use requires a license until the change date.