TThe Best SEO Podcast
← All frameworks
InnovationSebastian Chedal

Ground-Script-Interpret Agent Architecture

Ground state, script mechanics, and reserve AI for judgment

Difficulty
Advanced
Time to result
~weeks to results
Steps
6
Confidence
98%

This architecture separates reliable system mechanics from probabilistic judgment. Operational state is grounded in JSON, relational tables, or another external data store instead of being remembered by the model or casually tracked in prose. Recurring actions are implemented as deterministic scripts rather than repeatedly reconstructed through reasoning. Skills tell the agent when and how to invoke those scripts, while the scripts execute operations, validate results, and persist state. The model receives structured data back and performs only the work for which AI is valuable: interpretation, prioritization, and qualitative decisions informed by context. Explicit input-output layers then connect the stages. This division lowers token consumption, prevents procedural drift, and makes failures easier to diagnose because state, code execution, and model judgment are observable as separate components.

Origin

Extracted from The Best SEO Podcast during Sebastian Chedal's description of four production concerns for autonomous agent systems.

Core principles

  • 01Store operational state outside the model
  • 02Script repeatable mechanics
  • 03Use skills to invoke reliable tools
  • 04Reserve AI for qualitative interpretation
  • 05Make every stage's input and output explicit

How to run it

  1. 1

    Externalize state

    Identify everything the agent must know about workflow status and store it in JSON, tables, or another authoritative data store. Make the current state queryable.

    Pro tip Use relational storage when the volume and relationships do not require vector retrieval.

    Watch out Do not rely on the model to remember operational status.

  2. 2

    Separate mechanics from judgment

    List actions that always follow the same rules and distinguish them from decisions requiring interpretation. Assign only the latter to the model.

    Pro tip Data collection, transformation, validation, and persistence are strong scripting candidates.

    Watch out A skill description alone does not make a repeated operation deterministic.

  3. 3

    Build deterministic scripts

    Implement repeatable operations as code with defined inputs, outputs, and error behavior. Have the script update authoritative state.

    Pro tip Return compact structured data rather than verbose logs to conserve context.

    Watch out Silent script failures can leave the agent acting on stale state.

  4. 4

    Connect skills to scripts

    Teach the agent which script to call and under what conditions. Keep procedural instructions focused on invocation and interpretation.

    Watch out Too many loaded skills can consume the available input context.

  5. 5

    Apply AI interpretation

    Give the model the relevant context and structured script output, then ask it to make the qualitative decision. Persist that decision when it affects future work.

    Pro tip Phrase the task around the decision and desired outcome, not the mechanics already handled by code.

    Watch out Do not let the model redo or second-guess deterministic calculations without cause.

  6. 6

    Layer the handoffs

    Define how each output becomes the next component's input, including validation and failure states. Monitor the complete path end to end.

    Pro tip Schemas make agent-to-agent handoffs easier to validate.

In the wild

Content research pipeline

Scripts collect competitor posts, analytics, keyword data, and web mentions, then store normalized records. The AI receives those records plus business context and decides which topics deserve briefs. The selected briefs become structured inputs to a separate publishing agent.

→ The system spends model tokens on editorial judgment instead of repeatedly rediscovering how to collect and store data.

Common mistakes

Keeping state in prose

A markdown note interpreted by the model is less authoritative and testable than structured state used directly by the control system.

Letting AI repeat mechanics

Having the model reason through the same operation on every run adds cost and probabilistic errors that fixed code avoids.

Overloading the context

Loading every skill and memory item reduces room for the actual job inputs and can degrade decisions.

Is it for you?

Best for

Production agents that run recurring workflows, manipulate data, or must behave consistently.

Not ideal for

Exploratory conversations where flexible reasoning matters more than repeatable execution.

From the transcript

“So you want everything to be state-driven.”

Sebastian Chedal · 10:46

“You want to script it as much as possible.”

Sebastian Chedal · 11:00

“the only step that AI should be doing is the interpretation.”

Sebastian Chedal · 11:30

From the episode

Agentic AI For Marketers With Sebastian Chedal

Sebastian Chedal

→