MIT-licensed, backend-agnostic AI agent orchestration loop in Python: orchestrator→worker→reviewer as a deterministic harness. Drive coding-agent backends through an MCP server + CLI.
README
agentloop is a lightweight Python framework for multi-agent orchestration. It
implements the orchestrator → worker → reviewer pattern (the AI agent
orchestration loop) as a deterministic harness with a closed feedback loop: a goal
is decomposed into subtasks, fanned out to worker subagents, aggregated, and run
through a review gate that loops until the work meets its success criteria. One
loop drives any LLM backend — Anthropic Claude, Claude Code, Codex, opencode, or
aider — through a single Agent interface, and it ships as both an MCP server
and a plain CLI so any coding agent can call it.
The design principle: the loop is a harness (deterministic code), not a skill.
A prompt can describe "decompose, review, loop until done" but can't guarantee
it. So the control flow lives in code, and the model-facing judgement (how to
decompose, the review rubric) lives in swappable prompts. One harness drives any
backend through a single Agent interface.
The tweet that started it all — Peter Steinberger (@steipete): "You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents." agentloop is that idea as a reusable harness.
┌──────────── harness (this package) ────────────┐
goal ─▶ decompose ─▶ fan-out to subagents ─▶ aggregate ─▶ review gate ─▶ done?
▲ │ no
└──────────────── feedback: refine plan ◀──────────────────┘
python3 -m examples.run_demo # zero-dependency MockAgent
python3 -m pytest # full test suite, no deps
from agentloop import Orchestr