一句话,让 codex / claude code 创建成千上万个子agent

本帖使用社区开源推广,符合推广要求。我申明并遵循社区要求的以下内容:

  • 我的帖子已经打上 开源推广 标签:
  • 我的开源项目完整开源,无未开源部分:
  • 我的开源项目已链接认可 LINUX DO 社区:
  • 我帖子内的项目介绍,AI生成、润色内容部分已截图发出:
  • 以上选择我承诺是永久有效的,接受社区和佬友监督:

以下为项目介绍正文内容,AI生成、润色内容已使用截图方式发出


不要脸的来宣传下搓的项目:GitHub - shouc/agentflow: Orchestrate thousands of agents and harnesses as a graph programatically · GitHub

可以让人/codex/claude code直接用python定义一个多agent协作的系统/harness。

例子:定义3个agent协作:

from agentflow import Graph, codex, claude

with Graph("my-pipeline", concurrency=3) as g:
    plan = codex(task_id="plan", prompt="Inspect the repo and plan the work.", tools="read_only")
    impl = claude(task_id="impl", prompt="Implement the plan:\n{{ nodes.plan.output }}", tools="read_write")
    review = codex(task_id="review", prompt="Review:\n{{ nodes.impl.output }}")
    plan >> impl >> review

佬友们有取之不禁,用之不竭的chatgpt账号,可以通过agentflow来变现(卖RL数据集,挖洞,干seo)。我之前用agentflow开了1024个codex跑了三天又找了6个chrome高危漏洞,赚了4.5w u :slight_smile:

这段代码价值4.5w u:

from agentflow import Graph, codex, fanout, merge

with Graph("code-review", concurrency=1024) as g:
    review = fanout(
        codex(task_id="review", prompt=f"Select and review a Blink component under {SRC_PATH}, then create and run a Python script to generate HTMLs that can hit potential memory vulnerabilities you found during the review. Run {BIN_PATH} {FLAGS} file:///path/to/html to validate. Use gdb to debug reachability. Stop as soon as you see an ASAN UAF or heap overflow signal and move the HTML file triggering this to /crashes/. "),
        1024,
    )
    summary = codex(task_id="summary", prompt=(
        "Merge findings:\n{% for r in fanouts.review.nodes %}{{ r.output }}\n{% endfor %}"
    ))
    review >> summary

print(g.to_json())

关于为啥做这个:用了一阵子codex/claude code的multiagent/subagent感觉很难用,主要是因为他们创建子agent很保守,还得一个个开子agent,写prompt,效率很低。所以做了agentflow。agentflow可以让他们快速批量的定义并行执行多个子agent,并且子agent可以继续定义他们的子agent。

53 个赞

4.5w u的代码我说看就看,什么实力就不用我多说了 :distorted_face:

6 个赞

前排插眼

佬大气,前排~

漏洞挖掘正式进入ai时代了 :cold_face:

1 个赞

大佬, 是我想不到的方式

子子孙孙,无穷无尽 :beans:

NIUBI!!!

感谢大佬分享

厉害了大佬

感谢大佬!

感谢大佬

1024个…什么配置啊

冒昧问一句,这得啥配置啊,能开那么多codex

强!!!!

啊???

好强大!子子孙孙无穷尽

这是真大佬。从来没想过的方式。不过羊毛后面应该快薅不到了的感觉,地主家也没有余粮啊。

不明觉厉 学习一下

刚看到有个佬友需要 token 绩效,这个很适合刷。

从未设想的方式