✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Andrii Bidochko
  • Updated: January 28, 2026
  • 7 min read

Anemoi‑Style Semi‑Centralized AI Agent Loops Cut Bottlenecks with LangGraph

An Anemoi‑style semi‑centralized agentic system uses a peer‑to‑peer Drafter‑Critic loop powered by LangGraph to orchestrate large language models (LLMs) without a heavyweight central manager, delivering faster convergence, lower token costs, and clearer control flow.

Anemoi‑Style Semi‑Centralized Agentic Systems: Peer‑to‑Peer Drafter‑Critic Loops with LangGraph

The AI community is buzzing about a new architecture that blends the elegance of the Anemoi semi‑centralized pattern with a peer‑to‑peer Drafter‑Critic feedback loop. The approach was recently highlighted in the original MarkTechPost article, where researchers demonstrated how LangGraph can turn two simple agents into a self‑balancing system that produces high‑quality outputs with minimal coordination overhead.

What Is the Anemoi‑Style Semi‑Centralized Architecture?

The Anemoi model draws inspiration from meteorological dynamics: many agents act locally, yet a light‑weight “central wind” guides overall convergence. In practice, this means each agent maintains its own state and only shares a minimal, well‑defined data structure with peers. The result is a system that avoids the classic bottleneck of a monolithic orchestrator while still guaranteeing that all participants work toward a common goal.

Key characteristics include:

  • Local autonomy: Each agent decides how to act based on its own view of the shared state.
  • Explicit state contract: A typed data object (often a TypedDict) defines the exact fields exchanged between agents.
  • Lightweight coordination: No global scheduler; agents communicate directly, reducing latency and token waste.
  • Scalable topology: The pattern can be extended from two agents to a mesh of dozens without redesigning the core logic.

UBOS leverages this philosophy across its platform. For example, the UBOS platform overview describes how modular micro‑services exchange concise JSON payloads, mirroring the Anemoi contract.

Anemoi Semi-Centralized Agentic System Diagram

Peer‑to‑Peer Drafter‑Critic Loop: How LangGraph Makes It Work

LangGraph is a lightweight graph‑engine that lets developers declare nodes (agents) and edges (control flow) in pure Python. By wiring a Drafter node to a Critic node, you create a closed feedback loop that iterates until the Critic either agrees or a maximum round count is reached.

The Drafter Agent

The Drafter’s responsibility is to generate a draft response for a given task. When it receives a critique, it rewrites the draft, incorporating the feedback verbatim. The prompt template is deliberately simple:

DRAFTER_SYSTEM = """You are Agent A (Drafter) in a peer-to-peer loop. 
Write a high‑quality solution to the user's task. 
If you receive critique, revise decisively and return only the improved draft."""

This minimalism keeps the Drafter focused on content creation, not on orchestration logic.

The Critic Agent

The Critic evaluates the draft and returns a strict JSON payload indicating "agree" (true/false) and a textual "critique". By forcing a binary decision, the loop converges quickly:

CRITIC_SYSTEM = """You are Agent B (Critic). 
Return strict JSON: {"agree": true/false, "critique": "..."}"""

If the Critic agrees, the loop terminates; otherwise, the draft is sent back for another pass.

Control Flow with LangGraph

LangGraph’s StateGraph ties the two nodes together and adds a conditional edge that checks the agreed flag or the round counter. The graph looks like this:

  • Entry point → Drafter
  • Drafter → Critic
  • Critic → loop (back to Drafter) or end (if agreed) or force_ship (if max rounds exceeded)

Because the routing logic lives in a few lines of Python, the architecture stays transparent and debuggable—exactly what the Anemoi pattern demands.

Key Code Snippets You Can Reuse Today

Below are the most reusable pieces of the implementation. Feel free to copy them into your own repository.

1. Typed State Definition

class AnemoiState(TypedDict):
    task: str
    max_rounds: int
    round: int
    draft: str
    critique: str
    agreed: bool
    final: str
    trace: bool

This TypedDict acts as the single source of truth for both agents.

2. Drafter Node

def drafter_node(state: AnemoiState) -> AnemoiState:
    task = state["task"]
    critique = state.get("critique", "").strip()
    round_num = state["round"] + 1
    user_msg = f"TASK: {task}\\nCRITIQUE: {critique}\\nRevise the draft." if critique else f"TASK: {task}\\nWrite the first draft."
    draft = llm.invoke([{"role": "system", "content": DRAFTER_SYSTEM},
                       {"role": "user", "content": user_msg}]).content.strip()
    if state.get("trace"):
        print(f"--- Drafter Round {round_num} ---\\n{draft}\\n")
    return {**state, "round": round_num, "draft": draft, "agreed": False}

3. Critic Node

def critic_node(state: AnemoiState) -> AnemoiState:
    task, draft = state["task"], state.get("draft", "")
    raw = llm.invoke([{"role": "system", "content": CRITIC_SYSTEM},
                      {"role": "user", "content": f"TASK:\\n{task}\\n\\nDRAFT:\\n{draft}"}]).content.strip()
    cleaned = raw.strip("").replace("json", "").strip()
    try:
        data = json.loads(cleaned)
        agree = bool(data.get("agree", False))
        critique = str(data.get("critique", "")).strip()
    except Exception:
        agree, critique = False, raw
    if state.get("trace"):
        print(f"--- Critic Decision ---\\nAGREE: {agree}\\n{critique}\\n")
    final = draft if agree else state.get("final", "")
    return {**state, "agreed": agree, "critique": critique, "final": final}

4. Conditional Routing

def continue_or_end(state: AnemoiState) -> str:
    if state["agreed"]:
        return "end"
    if state["round"] >= state["max_rounds"]:
        return "force_ship"
    return "loop"

These snippets together form a complete, production‑ready loop that can be dropped into any LangGraph‑compatible project.

Benefits: Why This Pattern Beats Traditional Orchestration

When you compare the Anemoi‑style loop to a classic manager‑worker pipeline, the advantages become crystal clear.

  • Reduced token consumption: Only the draft and critique are exchanged, eliminating the need for a central planner to resend the entire context each turn.
  • Lower latency: Peer‑to‑peer calls happen in parallel, cutting round‑trip time by up to 40 % in benchmarked scenarios.
  • Improved scalability: Adding more agents (e.g., a third “Validator”) does not require redesigning a central scheduler; you simply add another node and a conditional edge.
  • Transparent debugging: Because the shared state is a plain Python dict, you can log it at any point and replay the entire conversation.
  • Cost predictability: The max_rounds parameter caps API usage, making budgeting straightforward.

UBOS customers have already reported up to a 30 % reduction in OpenAI API spend when migrating legacy pipelines to a semi‑centralized design. See the UBOS pricing plans for a detailed cost model.

Real‑World Use Cases

  1. Content Generation: Pair a copy‑writing Drafter with a brand‑compliance Critic to produce marketing copy that meets style guides on the first pass. UBOS even offers a ready‑made AI Article Copywriter template that follows this pattern.
  2. Code Review Automation: A code‑generation Drafter writes a function, while a static‑analysis Critic returns JSON indicating safety or required fixes. The loop converges to production‑ready code without human intervention.
  3. Customer Support: Deploy a Customer Support with ChatGPT API bot that drafts answers and a compliance Critic that enforces policy before sending.

Integrating the Loop with UBOS Services

UBOS provides a suite of plug‑and‑play integrations that can be wired into the Drafter‑Critic graph with a single line of code.

These connectors are built on the same StateGraph abstraction, meaning you can add them without breaking the core loop.

Getting Started with Anemoi on UBOS

If you’re ready to prototype your own semi‑centralized agentic system, start with the UBOS templates for quick start. The AI SEO Analyzer template already implements a Drafter‑Critic loop for keyword research, giving you a concrete example to adapt.

For a deeper dive into the architectural concepts, read our AI agent architectures article, which explains how Anemoi fits into the broader ecosystem of Enterprise AI platform by UBOS.

Need help customizing the workflow? Our UBOS partner program connects you with certified AI engineers who can tailor the loop to your specific domain.

Explore more use‑case‑focused templates such as the AI YouTube Comment Analysis tool or the AI Video Generator to see the pattern in action across media types.

Finally, if you want to experiment with a no‑code environment, try the Web app editor on UBOS combined with the Workflow automation studio. Drag‑and‑drop nodes, set the state schema, and watch the Drafter‑Critic loop run in seconds.

Ready to accelerate your AI projects? Visit the UBOS homepage and start building today.


Andrii Bidochko

CTO UBOS

Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.