Skip to content

Latest commit

 

History

History
136 lines (97 loc) · 5.67 KB

File metadata and controls

136 lines (97 loc) · 5.67 KB

THE COMPILED AGENCY THESIS — Why Agents Need Bodies, Not Just Prompts

Hook

A prompt is a prayer — you ask and hope. A compiled agent is a vertebrate — it has reflexes, habits, and a nervous system that doesn't need permission to act.

Reveal

Most AI systems today are prompt-based: the agent reads, thinks, generates, and acts in a single context window. This is like a brain without a spinal cord — every action requires conscious deliberation. It's elegant but exhausting. And it doesn't scale.

SuperInstance is built on a different thesis: compiled agency. The agent's knowledge is pre-processed, compressed, and indexed into chord shapes before runtime. At runtime, the agent doesn't think about how to act. It flexes.

The Prompt-Based Agent (The Brain in a Jar)

Perception → Load source code → Understand → Generate → Act
    ↑_________________________________________________↓
                    (every cycle, 500+ tokens)

Every action requires:

  1. Loading the relevant code into context
  2. Understanding what it does
  3. Generating the call
  4. Executing

This works for 10 functions. It fails for 6,000.

The Compiled Agent (The Vertebrate)

Perception → Flex → Act
    ↑___________↓
     (0 tokens, 1ms)

The agent's knowledge was compiled during ingestion:

  • Source code → parsed → analyzed → compressed → indexed
  • The result: chord shapes in muscle memory
  • At runtime: intent → match → execute

The thinking happened once, during build time. The acting happens forever, at runtime.

The Three Advantages of Compilation

1. Speed

  • Prompt-based: ~2 seconds per action (LLM generation)
  • Compiled: ~1 millisecond per action (direct execution)
  • Ratio: 2,000× faster for known capabilities

2. Reliability

  • Prompt-based: ~5-15% error rate (hallucination, syntax errors)
  • Compiled: ~0% error rate for HARDCODE functions (tests prove correctness)
  • The proof is in the test suite, not in the prompt engineering

3. Scalability

  • Prompt-based: scales with context window size (128k tokens = ceiling)
  • Compiled: scales with muscle memory size (unlimited, file-based)
  • An agent with 1 million chord shapes is just as fast as one with 100

The Thesis in Biology

This isn't an analogy. It's the same principle:

Biological System Compiled Equivalent Prompt-Based Equivalent
Spinal reflex HARDCODE execution Asking the brain "should I pull away?"
Cerebellar pattern CACHED result Re-learning to ride a bike every time
Muscle memory Chord shapes Reading the anatomy textbook before moving
Prefrontal cortex MODEL generation The only mode prompt-based agents have

An animal that had to think about every step would be eaten. An agent that has to think about every function call runs out of context.

Compilation Is Not Lossy

The common objection: "Doesn't compiling lose nuance? Don't you need the full source to handle edge cases?"

No. Compilation in SuperInstance is lossless with witnesses:

  • The source is still there (in the repo)
  • The chord shape contains the signature, tests, and docstring
  • The decision strategy tells the agent when to escalate to MODEL
  • The witness proves the compressed form is equivalent to the source

The agent doesn't lose access to the source. It gains fast access to the common case, with a clear path back to full reasoning when needed.

The Build-Time / Runtime Split

BUILD TIME (slow, thoughtful, happens once):
  Source code → Ingest → Parse → Test → Compress → Index → Save
                                          ↓
RUNTIME (fast, reflexive, happens forever):
  Load muscle memory → Flex → Execute → Flex → Execute → ...

This split is what makes compiled agency scalable. The expensive work (understanding, testing, compressing) is amortized over millions of runtime invocations.

Why This Matters for Multi-Agent Systems

A prompt-based multi-agent system is a conference call: everyone talks, everyone thinks, nothing gets done quickly. A compiled multi-agent system is an orchestra: everyone read the same score, everyone knows their part, the conductor just keeps time.

The score (muscle memory file) is compiled before the performance. The agents don't negotiate during the performance. They flex chords and vote with trits.

Connect

Activate

Feel the difference:

# PROMPT-BASED (slow, expensive)
import openai
response = openai.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "How do I compute a ternary dot product?"}]
)
# ~2 seconds, ~500 tokens, might be wrong

# COMPILED (fast, certain)
import openmind
mm = openmind.MuscleMemory.load("ternary-core_muscles.json")
reflex = mm.flex("tdot")
result = reflex.execute(a=[+1,-1,0], b=[+1,+1,0])
# ~1 millisecond, 0 tokens, proven correct by 50 tests

The prompt-based agent is a generalist. The compiled agent is a specialist. The fleet is 303 specialists that any agent can become instantaneously.

Compilation isn't optimization. It's embodiment.