Build a Living Agent
The Loop
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.
The 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.
The Pulse
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.
The Organism
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.
The Colony
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.