展示HN:德鲁伊 – 构建你自己的软件工厂
Show HN: Druids – Build your own software factory

原始链接: https://github.com/fulcrumresearch/druids

德鲁伊是一个用于协调和部署跨多台机器的编码代理的库,简化了代码审查、渗透测试和数据管道等复杂工作流程。它抽象了基础设施管理——虚拟机配置、通信——让开发者专注于定义代理行为。 德鲁伊程序是一个异步函数,定义了代理的操作方式,利用“事件”来注入结构和控制流。代理在沙盒虚拟机中运行,可以访问你的代码仓库并共享资源。主要特性包括并行执行、受控的任务状态以及与正在运行的代理交互的能力。 德鲁伊提供本地和托管部署选项(druids.dev)。它需要 Docker、uv 和 Anthropic API 密钥。示例程序展示了性能优化、自动化代码改进和并行模型评估等用例。该库包括一个 CLI、Python 客户端和一个 Vue 3 控制面板,用于监控和管理。

## 德鲁伊:一个开源软件工厂 德鲁伊 (github.com/fulcrumresearch) 是一个全新的开源 Python 库,旨在简化多智能体编码工作流程的创建和管理。它抽象了虚拟机基础设施、智能体配置和通信的复杂性,让开发者能够专注于通过事件驱动程序定义智能体的角色和交互。 本质上,德鲁伊允许你构建“软件工厂”,其中智能体协作完成诸如性能优化、代码审查和大规模迁移等任务。每个程序都在隔离的、沙盒化的虚拟机中运行,智能体之间的安全通信通过令牌管理。 创建者构建德鲁伊是为了解决内部重复设置和扩展基于智能体的工具所面临的挑战。他们的目标是 democratize 目前领先的 AI 实验室用来高效协调大量智能体的基础设施的访问权限。早期用户已经发现它对于自动化复杂的软件开发流程非常有价值。
相关文章

原文

Druids is a batteries-included library to coordinate and deploy coding agents across machines. Druids makes it easy to do this by abstracting away all the VM infrastructure, agent provisioning, and communication.

For example, here's a Druids program to deploy N task agents on N copies of a software environment and have a judge pick the best output:

async def program(ctx, spec="", n=3):
    submissions = {}

    # each agent gets its own sandboxed VM with your repo
    judge = await ctx.agent("judge")

    # events define how agents report back to the program
    @judge.on("pick")
    async def on_pick(winner=""):
        await ctx.done({"winner": winner, "submissions": submissions})

    # spawn n workers in parallel — each implements the spec independently
    for i in range(n):
        worker = await ctx.agent(f"worker-{i}", prompt=spec, git="write")
        worker_name = worker.name

        @worker.on("submit")
        async def on_submit(pr_url=""):
            submissions[worker_name] = pr_url
            if len(submissions) == n:
                # all done — send the PRs to the judge
                await judge.send(f"Review these PRs and pick the best:\n\n{submissions}")
druids exec best_of_n.py spec="Refactor the auth module" n=5

Druids is useful for things like:

  • running many agents to do performance optimization
  • building custom automated software pipelines for eg code review, pentesting, large-scale migrations, long-running autonomous features
  • building data pipelines with agents

You can use it locally or deployed on druids.dev.

Website · Docs · Discord

Demo video

Watch the demo

A druids program is an async function that defines how your agents should run on your task. You create agents, define events they can trigger, and control what happens when they do. The agent decides when to trigger an event — the program decides what happens.

Events allow you to inject deterministic structure and control flow to structure how your agents work towards the task of the program. They are useful for defining controlled steps and flows, like:

  • forcing a model to iterate against hard tests and harness signals
  • building a verification hierarchy, where agents spawn outputs that are verified and redteamed by other agents until they match a set of properties
  • controlling distributed task state, like having a lock around the ways agents write to shared resources or user-facing systems

Each agent gets a sandboxed VM with your repo and dependencies. Agents can share machines (share_machine_with), transfer files (ctx.connect), and work on git branches. On the hosted version, agent.fork() creates instant copy-on-write clones. You can message any agent while it runs, inspect program state, and redirect work without stopping the execution.

You need Docker, uv, and an Anthropic API key.

This builds the Docker image, starts the server, and configures the CLI. Then run a program:

druids exec .druids/build.py spec="Add a /health endpoint that returns 200 OK"

See the getting started guide for a full walkthrough, or QUICKSTART.md for manual setup and troubleshooting.

  • build.py — builder + critic + auditor. Three agents iterating until all are satisfied.
  • basher.py — finder scans for tasks, spawns implementor+reviewer pairs.
  • review.py — demo agent tests a PR on a real system, monitor watches for shortcuts.
  • main.py — Claude and Codex racing on the same spec in parallel.
  • server/ — FastAPI server, execution engine, sandbox management
  • client/ — CLI and Python client library
  • runtime/ — program runtime SDK
  • frontend/ — Vue 3 dashboard
  • docs/ — documentation (also served at druids.dev/docs)
联系我们 contact @ memedata.com