Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

A Three-Stage Super-Agent Architecture

AI summary

An engineering account describes an author-built “Super-Agent” architecture that separates planning, execution, and validation. The implementation uses structured task graphs, asynchronous concurrent tool calls, configurable retry, skip, and abort policies, semantic validation, and incremental reruns of failed steps. In the author’s internal comparison, the three-stage system averaged 14.8 seconds and succeeded in 9 of 10 runs, compared with 47.3 seconds and 6 of 10 successes for a single-loop agent, while using about 21,000 tokens per run instead of 38,000. The author also says the architecture had run stably for more than a month in two internal workflows. These results and usage claims are self-reported and were not independently verified.

In-depth insight

The account provides a concrete implementation pattern for multi-tool AI workflows that require dependency scheduling, parallel execution, failure recovery, result validation, and targeted reruns. Its reported comparisons suggest practical value, but they remain unverified.

上个月我们组接到一个需求:把「每天早上自动整理竞品动态」这件事全交给一个 Agent 做。听起来简单,真正动手才发现坑在架构上——单个大模型循环调工具,跑到第五步就开始忘事,工具调错了不回头,失败了整条链子重来。我前后重构了三次,最后落到的结构是「规划-执行-校验」三段式,我叫它 Super-Agent 架构。这篇文章把三段各自的实现、以及我踩过的具体问题完整写出来。

为什么单循环 Agent 一定会崩

先说我第一版的写法,也是最容易想到的写法:一个大 while 循环,模型输出 tool_call,执行,把结果塞回上下文,继续循环,直到模型说「完成」。

def naive_agent(task, tools, max_steps=20):
    messages = [{"role": "user", "content": task}]
    for step in range(max_steps):
        resp = llm.chat(messages=messages, tools=tools)
        if not resp.tool_calls:
            return resp.content
        for call in resp.tool_calls:
            result = execute(call)
            messages.append({"role": "tool", "content": result})
    return "超过最大步数"

#Super-Agent architecture#Pydantic#Python asyncio

Original · 9 min readRead the original
Group chat

No comments yet. Start the conversation.