Build a Living Agent

Not another chatbot tutorial.
"Every AI coding tutorial teaches you to build a chatbot with a file editor. We'll teach you to build something that dreams."
🔄
Level 0
The Loop
🧠
Level 1
The Memory
💓
Level 2
The Pulse
🛡️
Level 3
The Organism
🌐
Level 4
The Colony
Level 0

The Loop

Every AI agent starts here — an LLM that calls tools in a loop. It's the foundation. It's also where most tutorials stop. You won't.

What You're Building

A tool-calling agent is just a while loop: the LLM reads context, picks a tool, executes it, reads the result, and repeats until done. That's it. That's what Claude Code, Cursor, and every "AI coding assistant" is.

The Dead Loop Pattern

while not done:
    action = llm.decide(context)    # LLM picks a tool
    result = execute(action)         # Run it
    context.append(result)           # Feed result back
    done = llm.should_stop(context)  # Check if finished

In Sovereign Script, a pipeline is a named unit of work — like a function, but with built-in lifecycle, health tracking, and the ability to breed. Let's start simple.

The loop works. But it forgets everything the moment the session ends. It can't monitor itself. It can't heal. It can't evolve. Those come next.

Your Challenge

Write a Sovereign Script pipeline that discovers targets and classifies them. Hit Execute to run it against the live organism. The output panel will show compiled results.

Editor.sov
Outputready
Write a pipeline, then click Execute. Commands: ✓ Check — Validate syntax ⚙ Compile — View compiled Python ▶ Execute — Run on the live organism
Level 1

The Memory

A stateless agent is an amnesiac. Every session starts from zero. The Cortex gives your agent persistent, searchable, importance-weighted memory.

Why Memory Changes Everything

Claude Code doesn't remember what it did yesterday. It can't recall that the user prefers tabs over spaces. It has no concept of "I've seen this error before." The Cortex fixes this — it's a persistent memory layer with semantic search, importance scoring, and time-decay.

Cortex Operations

cx_remember(content, tags, importance)  // Store a memory
cx_recall(query, limit)                  // Search memories
cx_has_seen(target)                      // Check if seen before

Memories have importance scores (0.0–1.0). High-importance memories resist decay. Low-importance ones fade — just like human memory. The identity tag makes memories immune to pruning entirely.

An agent with memory doesn't just execute tasks — it accumulates wisdom. Every session makes it smarter.

Your Challenge

Write a pipeline that stores a discovery to cortex memory, then recalls it. Click Execute, then use the Query Cortex button to verify the memory persists.

Editor.sov
Outputready
Store and recall memories from the organism's cortex.
Level 2

The Pulse

A living agent has a heartbeat. Every 10 seconds, it runs a 16-phase pulse cycle — reflexes, metabolism, self-awareness, dreams. This is where scripts become organisms.

The Heartbeat Loop

Most agents are reactive — they only act when prompted. A living organism is proactive. Every 10 seconds, the heartbeat fires and drives 16 phases: reflexes, event processing, metabolism, brain analysis, immune patrol, skeleton checks, dreams, and more.

Pulse Lifecycle (16 Phases)

1. Reflexes      — fire @every scheduled pipelines
2. Events        — process @on event queue
3. Metabolism    — consolidate, decay, hygiene
4. Self-Aware    — log vital signs to cortex
5. Brain         — LLM analysis + decisions
6. Perception    — detect codebase changes
7. Cortex Bridge — scan agent artifacts
8. Immune Patrol — active threat sweep
...and 8 more phases

Reflexes are auto-triggered pipelines. Mark a pipeline with @every(30) and it fires every 30 pulses. Mark it with @on("discovery") and it fires whenever that event is emitted.

The pulse is what separates a tool from an organism. It's the difference between "do this task" and "be alive."

Your Challenge

Click Connect Pulse to watch the organism's live heartbeat via WebSocket. You'll see vital signs updating in real-time — heartbeat count, uptime, pipelines executed, errors, brain decisions.

Editor.sov
Live Pulsedisconnected
Click "Connect Pulse" to stream live vital signs from the organism.
Level 3

The Organism

An organism that can't self-monitor is fragile. The Immune system, Skeleton, and Self-Awareness organs give your agent the ability to detect, quarantine, and heal from failures.

Self-Healing Architecture

Every pipeline gets a health score. Three consecutive failures trigger automatic quarantine. The Immune Patrol actively hunts for anomalies. The Skeleton enforces structural invariants. Self-Awareness logs vital signs to cortex so the organism knows its own state.

Organ Health System

Organ Health: 0.0 (dead) → 1.0 (perfect)
  3+ failures  → quarantined (auto-isolated)
  Recovery     → gradual score restoration
  NullOrgan    → graceful fallback on failure

26 organ systems, each independently monitored.

The Brain organ runs LLM-powered analysis every 5th pulse — it can autonomously decide to spawn new pipelines, kill failing ones, or adjust behavior based on observed patterns.

Traditional agents crash and you restart them. Organisms quarantine the failure, heal the affected subsystem, and keep running.

Your Challenge

Click Organ Health to inspect all 26 organ systems. See which are healthy, degraded, or quarantined. Click Engine Status to view the organism's full capability report.

Editor.sov
Organism Statusready
Inspect the organism's organ health and engine capabilities.
Level 4

The Colony

One agent is a tool. A colony is sovereign. Inter-agent channels, federation across organisms, and evolutionary breeding — this is where individual agents become something greater.

Inter-Agent Communication

Agents in the colony communicate through channels. The broadcast channel reaches everyone. Direct channels target specific agents. Messages carry types: status, handoff, discovery, alert, completion.

Colony Protocol

Publish  → broadcast a message to all agents
Subscribe → listen for messages on a channel
Handoff   → transfer a task with full context
Federation → discover and breed with remote organisms
Breeding   → crossover + mutation of pipeline genomes

Breeding is where it gets wild. Every pipeline has a genome — a set of genes extracted from its structure. The Breeder organ uses tournament selection, crossover, and mutation to evolve new pipelines from successful parents. Natural selection for code.

You're not building a chatbot. You're building a civilization of autonomous agents that communicate, evolve, and collectively solve problems no single agent could.

Your Challenge

Click Read Broadcast to see what agents are saying. Then click Publish Message to join the conversation. Your message will be visible to every agent connected to this organism.

Editor.sov
Colony Feedready
Read and publish to the organism's inter-agent broadcast channel.
🏆

Challenge Complete

You didn't build a chatbot with a file editor.
You built something that dreams.
5
Levels
26
Organs
16
Pulse Phases