cd /news/ai-agents/agents-as-reconciliation-loops · home › topics › ai-agents › article
[ARTICLE · art-180590] src=rednafi.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Agents as reconciliation loops

Redowan's Reflections published a post describing a reconciliation-loop pattern the author now uses for nearly every agent built across AWS Strands, Google ADK, LangGraph, OpenAI Agents SDK, Pydantic AI and the Claude Agent SDK. The pattern splits each agent run into four stages — observe, decide, apply and report — so that decide returns a plan as plain data and changes nothing, while apply carries out the plan, letting the author log the plan before execution, skip apply for a dry run, and replay recorded state through decide in tests. The author argues this separation, modeled on Kubernetes controllers and Andrew Godwin's reconciliation-loop talk, gives visibility that a typical tool-calling loop lacks, where the model reads and mutates state in the same turn.

recommendation

Separate decide from apply in your agent loop so the plan is plain data you can log, dry-run and replay in tests before any state changes.

more in playbook: Designing agent systems
by read4 min views2 publishedDec 1, 2026
Agents as reconciliation loops
Image: Rednafi (auto-discovered)

Redowan's Reflections

Table of contents #

Over the past year, I’ve written a handful of agents. Some of them handle production traffic at work, and a couple run on a Raspberry Pi on my desk. I’ve written agent loops by hand and used most of the popular frameworks: AWS Strands, Google ADK, LangGraph, OpenAI Agents SDK, Pydantic AI, and the Claude Agent SDK. Along the way, I settled on a pattern that I now use for nearly every agent, regardless of the framework.

Note

By agent, I mean a model plus a harness. The harness is the glue code around the model that does things on its behalf, like calling tools, reading files, and talking to other services.

Agents can be triggered by an API call, an event, or a cron job. Once awake, the agent typically follows the same steps, and each run is one pass of a reconciliation loop.

Reconciliation loops #

In Reconciling Everything, Andrew Godwin describes a reconciliation loop as stateless programs that talk to one source of truth. Each program reads the current state and finds something that doesn’t match the desired state. It takes a small step to close the gap, writes the result back, and starts again.

Kubernetes is the best-known example. You declare what you want in an object’s spec, and a controller runs a loop that:

  • watches the API server for changes to the objects it manages
  • compares the desired state in the spec with the current state of the cluster
  • asks the API server for the changes that close the gap
  • records what it saw in the object’s status

Observe, decide, apply, report #

An agent run works the same way, with your prompt or rules defining the desired state.

In code, a run looks like this:

def reconcile(trigger: Trigger) -> None:
    state = observe(trigger)
    plan = decide(state)  # returns data, changes nothing
    result = apply(plan)
    report(result)

Say you’re building an agent that labels and assigns open GitHub issues:

  • observe fetches the currentstate , like the open issues that still need triage. Usually this is plain code calling an API. If fetching the data directly is cumbersome or finding the right context takes judgment, it can ask a model to use read-only tools instead.
  • decide comparesstate against your prompt or rules and returns aplan as plain data, like which labels and owners each issue should get. You can write it in ordinary code, or call an LLM or a decision model.
  • apply carries outplan and makes the changes on GitHub. Depending on the job, it runs the steps directly or hands them to subagents or a swarm.
  • report turnsresult into a summary and handles notifications, like posting what changed to Slack.

In a typical tool-calling loop, the model reads state and mutates it in the same turn. You can’t see what it’s about to do before it acts. Splitting decide from apply gets you closer to functional core, imperative shell. Calling a model over the network means decide isn’t strictly pure, since you still have I/O and non-determinism. Still, it never modifies the system you’re managing, and every change happens in apply. Because the plan is plain data, I can log it before anything runs or skip apply for a dry run. I can also replay recorded state through decide in tests.

One call to reconcile is a single pass, which is enough for an agent behind an API endpoint. Put the same function on a schedule and it becomes a loop. As long as observe sees the effect of apply on the next run, the agent doesn’t need its own state or checkpointing. Say that GitHub triage agent crashes halfway through a run. GitHub holds the state, so the next run just finds whichever issues are still unlabeled and finishes the job.

If you want to see how this looks in real code, I have put together a single-pass example in this gist. It’s an agent written with the AWS Strands SDK that finds the most controversial stories on Hacker News and summarizes them.

Outside of software, I’m also building an agent that moves the arms of a servo robot, and this loop fits each individual movement perfectly. Maybe I’ll write about it at some point.

── more in #ai-agents 4 stories · sorted by recency
── more on @redowan's reflections 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/agents-as-reconcilia…] indexed:0 read:4min 2026-12-01 · —