Skip to content
FrankX.AI
Creator SystemsAug 17, 202610 min read1,909 words

The Nested Stack of Intelligence Engineering

Intelligence is layered engineering, not a bigger prompt. Each layer—prompt, context, skills, harness, orchestration, evals—amplifies or destroys the layer below.

Frank Riemer
FrankX
AI Architect & Independent Creator
Ex-Oracle AI Architect · Starlight & ACOS Systems
Intelligence is layered engineering, not a bigger prompt. Each layer—prompt, context, skills, harness, orchestration, evals—amplifies or destroys the layer below.
Reading Goal

Map your intelligence stack. Find the missing layer.

The Nested Stack of Intelligence Engineering

TL;DR: Intelligence is layered engineering, not a bigger prompt. From the inside out: prompt (instruction), context (data), skills (reusable capabilities), harness (execution runtime), orchestration (coordination), and adversarial gates (evals, safety). Skipping a layer doesn't save time—the layer above amplifies the mess. First-hand architecture: starlight-agent-skills holds the capabilities, SIS remembers the outcomes, swarm enforces the contracts, products consume the substrate. This is not mysticism. This is how production agent systems actually work.

Why does the stack matter more than the model?

Because every layer either amplifies or destroys the layer below it. A perfect prompt fed into a harness with no memory is an amnesiac genius—brilliant per-turn, incoherent across sessions. Skills without orchestration are a pile of tools with no one coordinating who uses what when. Orchestration without evals is a car with no speedometer—you're moving, but you have no idea if you're going the right direction or driving off a cliff.

The pattern shows up everywhere: companies adopt Claude or GPT-5, write better prompts, get marginal gains, then hit a wall. The wall isn't the model—it's the missing layers. Prompt engineering is the floor, not the ceiling. When you see an agent system that shipped real product value, you're looking at a stack, not a trick.

What are the six layers, from the inside out?

Layer 1 — Prompt (instruction)

The atomic unit: what you tell the model to do, how you frame the task, what constraints you enforce. This is the layer everyone starts with, and it matters—bad prompts produce bad outputs regardless of stack quality.

Key patterns: task decomposition, chain-of-thought, output schema enforcement, role-framing, few-shot examples. The prompt engineering guide covers the 2026 state of the art: what still works, what stopped working, what never worked.

But here's the constraint: a prompt is stateless. It lives for one turn. Everything it needs must be passed in, and everything it produces must be extracted before the session ends. That limitation is what creates the need for the next layer.

Layer 2 — Context (data)

The information available to the prompt: retrieved docs, conversation history, code from the repo, user preferences, prior outputs. This is the "memory" layer—except it's not automatic. You build it.

Retrieval-augmented generation (RAG) lives here: embed your content, store vectors, retrieve on query. So does long-term memory: SIS (Starlight Intelligence System) records trajectories so agents can reference what they learned three sessions ago. Context quality determines whether the prompt has the data it needs to produce a useful answer.

The failure mode: context overload. Stuffing 100,000 tokens of docs into the context window and hoping the model finds the relevant part. The fix: ranked retrieval, summary layers, and memory that surfaces the right five things instead of dumping everything.

Layer 3 — Skills (reusable capabilities)

Capabilities that multiple agents use: a research protocol, a code review checklist, a voice enforcement contract, a deployment runbook. Skills are to agents what libraries are to programs—shared, versioned, independently testable.

In our stack, skills live in starlight-agent-skills and get imported by name. The skills vs agents vs prompts piece maps the taxonomy: when to write a skill, when to write an MCP server, when a prompt is sufficient.

Skills solve the duplication problem: without them, every agent reimplements the same capability slightly differently, and you have no shared contract to enforce quality. With them, the research protocol is tested once and used everywhere.

Layer 4 — Harness (execution runtime)

The runtime that actually runs the agents: session management, tool access, credential handling, rate limiting, error recovery, output validation. This is the machinery that makes "run an agent" a function call instead of a bash one-liner you hope works.

Claude Code, LangGraph, CrewAI, Oracle ADK—these are harnesses. They differ in typing rigor (TypeScript vs Python), coordination model (sequential vs swarm), and how much infrastructure they assume you have. Our choice: starlight-swarm (TypeScript, typed contracts, deterministic dispatch) because type safety at the coordination layer prevents an entire class of runtime failures.

The harness also enforces the contracts the skills define. If a skill declares "this agent must never edit files outside /workspace/content," the harness blocks violations. Governance lives here.

Layer 5 — Orchestration (coordination)

Who runs when, in what order, with what data passed between them. This is where multi-agent patterns live: supervisor/worker, peer swarm, pipeline, debate/synthesis.

The 7 pillars of production agents maps the architecture layer: how to structure handoffs, how to handle failures, when to parallelize, how to aggregate partial results. Orchestration turns "we have five good agents" into "we have a system that ships product value."

Failure mode: no orchestration, just vibes. You have agents, you manually decide when to invoke each one, coordination lives in your head. That works for demos. It doesn't work when you need consistent output across vendors and models.

Layer 6 — Adversarial gates (evals, safety)

The quality and safety checks that run before output ships: eval harnesses, voice contracts, format validators, safety filters, human-in-the-loop review. This is the immune system—the layer that catches drift, blocks bad outputs, and enforces standards.

Evals are the experiment—the measurement protocol that tells you if the system is improving or degrading. Without this layer, you're flying blind: outputs look fine until they don't, and you have no way to know when drift started or what caused it.

Our implementation: a fail-closed quality gate that blocks commits, voice scanners that surface violations, eval receipts written to SIS. Not suggestions—enforcement.

What happens when you skip a layer?

Each missing layer makes the layer above it fragile:

  • No prompt discipline → context doesn't know what to fetch, skills get vague instructions, harness can't validate output
  • No context management → prompts get longer and vaguer, skills can't reference prior work, agents repeat themselves
  • No skills → every agent reimplements the same thing differently, no shared quality bar, duplication everywhere
  • No harness → orchestration is bash scripts, no error recovery, credentials are environment variables, auditing is grep
  • No orchestration → agents run in isolation, handoffs are manual, no compound value
  • No adversarial gates → drift is invisible until users complain, no measurement of improvement, quality is vibes

This is why prompt engineering alone doesn't scale. You can write world-class prompts and still hit a wall at 10 agents, because prompt quality doesn't solve coordination, memory, governance, or measurement.

How does this map to the Starlight architecture?

Concrete implementation, because theory without names is just gesturing:

  • Prompts: Individual agent instructions + task decomposition
  • Context: SIS (Starlight Intelligence System) for memory, RAG for doc retrieval
  • Skills: starlight-agent-skills (versioned, TypeScript-typed, independently tested)
  • Harness: starlight-swarm (typed executor, deterministic dispatch, contract enforcement)
  • Orchestration: ROUTE → MEASURE → LEARN → RATIFY → LEDGER (the Queen loop)
  • Adversarial gates: Eval harness + voice contracts + fail-closed quality gates

Products like ACOS and GenCreator consume this substrate. When a customer asks "how do I build an agent system that ships product?", the answer isn't "write better prompts"—it's "build the stack."

Why is this architecture, not mysticism?

Because every layer has a typed contract, a verifiable behavior, and a way to fail-closed when violated. This isn't "AI magic"—it's the same layered-system design you'd use for any production software, applied to systems where one of the components is a language model.

The contracts are TypeScript interfaces. The orchestration is a state machine. The evals produce JSON receipts. The memory is append-only structured logs. When something breaks, you can diff the trajectory, see which layer failed, and fix it.

The non-magical part matters because this is the only way agent systems survive contact with production. Coherence is an engineering property, not a culture. The stack is what makes coherence enforceable across vendors, models, and timezones.

What does this mean for builders?

Three moves:

1. Audit your stack—find the missing layer. Most builders have prompts and maybe some context management. Skills? Maybe ad-hoc. Harness? "We call the API." Orchestration? "We manually invoke agents." Evals? "We eyeball outputs." The missing layer is the constraint. Fix it before adding more agents.

2. Start with skills, not agents. Before you spawn agent #23, ask: is this a reusable capability that multiple agents need? If yes, write a skill. If no, is this a one-off task that should be a sub-agent of an existing coordinator? Agents are expensive to maintain. Skills compound.

3. Make the stack legible. If someone asked "show me your agent system architecture," could you draw the layers and name what lives in each? If not, you don't have architecture—you have a pile. Legibility is the difference between a system you can debug and a system you hope works.

The AI architect operating layer expands on this: how to design the skill catalog, how to version capabilities, how to handle migrations when a layer changes. The intent architecture guide covers when to dispatch vs when to inline.

FAQ

What's the difference between a skill and an agent?

A skill is a reusable capability (research protocol, review checklist, voice contract) that multiple agents import. An agent is an execution context with a goal and tool access. Skills are libraries; agents are programs. Write skills for capabilities you'll use more than once. Write agents for goals that need coordination.

Can I skip the harness layer and just call model APIs?

Yes, until you need error recovery, rate limiting, credential rotation, output validation, memory, or auditing. A harness is optional when you're running one agent in a script. It's mandatory when you're running 10+ agents that ship product value.

Do I need orchestration if I only have three agents?

Depends on whether those three agents coordinate. If they run independently and never pass data between them, orchestration is a premature abstraction. If they form a pipeline or need to synthesize results, you're doing orchestration whether you formalize it or not—formalizing it makes it debuggable.

Why is Layer 6 called "adversarial"?

Because it assumes agents will drift, violate contracts, and produce bad outputs unless blocked. The gates are adversarial to bad behavior—they fail-closed, surface violations, and refuse to let broken outputs ship. This isn't mistrust of AI; it's the same defensive programming you'd apply to any distributed system.

How do evals fit into the stack vs observability?

Observability is Layer 4/5: tracing what happened, logging outcomes, measuring performance. Evals are Layer 6: asserting that outcomes meet a quality bar with reproducible verification. Observability tells you what ran; evals tell you if it was good.

What if my stack is just prompts right now?

Start with Layer 2 (context management): can your agents remember prior sessions? Can they retrieve relevant docs? Then Layer 3 (skills): what capability gets reimplemented across agents? Extract it, version it, make it reusable. Then Layer 6 (evals): what's the simplest assertion that catches bad outputs before they ship?

Is this overkill for simple use cases?

Yes. If you're building a demo or running one agent once, you don't need a six-layer stack. But "simple" and "production" diverge fast. The moment you have more than one agent, need consistent output, or care if it works tomorrow, you need at least three layers (prompt, context, skills). By the time you're shipping to users, you need all six.

By Frank — AI Architect & Creator. The open-source intelligence stack: starlight-swarm · starlight-agent-skills · SIS. Not affiliated with, endorsed by, or sponsored by Oracle.

Stay in the intelligence loop

Weekly field notes on AI systems, production patterns, and builder strategy.

Occasional FrankX field notes. Unsubscribe anytime. Privacy details.