autoagent README

The project's README from github.com/thirdlayerinc/autoagent. As one markdown file: README.md.

thirdlayer

We're launching a product around self-configuring agents soon. Sign up here.
We're hiring engineers. If this work interests you, reach out to [email protected] with your Github link.

AutoAgent

Like autoresearch but for agent engineering. Give an AI agent a task, let it build and iterate on an agent harness autonomously overnight. It modifies the system prompt, tools, agent configuration, and orchestration, runs the benchmark, checks the score, keeps or discards the change, and repeats.

teaser

The core idea is the same: you're not touching the harness Python files like you normally would as an engineer. Instead, you program program.md, the Markdown file that provides context to the meta-agent and defines the agent-engineering loop.

How it works

The repo has a few files and directories that matter:

The metric is total score produced by the benchmark's task test suites. The meta-agent hill-climbs on this score.

Quick start

Requirements: Docker, Python 3.10+, uv, and whatever model-provider credentials your current agent.py harness requires.

# 1. Install uv (if you don't have it)
curl -LsSf https://astral.sh/uv/install.sh | sh

# 2. Install dependencies
uv sync

# 3. Set up the environment variables required by your current agent/runtime
# Example:
cat > .env << 'EOF'
OPENAI_API_KEY=...
EOF

# 4. Build base image
docker build -f Dockerfile.base -t autoagent-base .

# 5. Add tasks to tasks/ (see Task format section below)

# 6. Run a single benchmark task
rm -rf jobs; mkdir -p jobs && uv run harbor run -p tasks/ --task-name "<task-name>" -l 1 -n 1 --agent-import-path agent:AutoAgent -o jobs --job-name latest > run.log 2>&1

# 7. Run all tasks in parallel (-n = concurrency, default 4)
rm -rf jobs; mkdir -p jobs && uv run harbor run -p tasks/ -n 100 --agent-import-path agent:AutoAgent -o jobs --job-name latest > run.log 2>&1

Running the meta-agent

Point your coding agent at the repo and prompt:

Read program.md and let's kick off a new experiment!

The meta-agent will read the directive, inspect the current harness, run the benchmark, diagnose failures, modify agent.py, and iterate.

Project structure

agent.py                       -- single-file harness under test
  editable harness section     -- prompt, registries, tools, routing
  fixed adapter section        -- Harbor integration + trajectory serialization
program.md                     -- meta-agent instructions + directive
Dockerfile.base                -- base image
.agent/                        -- optional agent workspace artifacts
tasks/                         -- benchmark tasks, typically added in benchmark-specific branches
jobs/                          -- Harbor job outputs
results.tsv                    -- experiment log (created by meta-agent, gitignored)
run.log                        -- latest run output

Task format

The repo ships without tasks. Add your own to tasks/ following Harbor's task format:

tasks/my-task/
  task.toml           -- config (timeouts, metadata)
  instruction.md      -- prompt sent to the agent
  tests/
    test.sh           -- entry point, writes /logs/reward.txt
    test.py           -- verification (deterministic or LLM-as-judge)
  environment/
    Dockerfile        -- task container (FROM autoagent-base)
  files/              -- reference files mounted into container

Tests write a score (0.0-1.0) to the verifier logs. The meta-agent hill-climbs on this. See the Harbor docs for full details on writing and porting tasks.

Design choices

Cleanup

Docker images and containers accumulate across runs. Clean up regularly:

# Harbor's cached task images + task cache
uv run harbor cache clean -f

# Full Docker nuke (all unused images, build cache, etc.)
docker system prune -a -f

# Lighter: just dead containers
docker container prune -f

If Docker becomes unresponsive (for example after many concurrent runs), restart Docker Desktop:

killall Docker && open -a Docker

Improving performance with skills

You can equip the agent with Agent Skills for Context Engineering and context7 skills to improve performance.

License

MIT

autoagent (thirdlayerinc/autoagent)

Searching Database…

这是什么?AutoAgent 让 AI 智能体在一夜之间自主构建并迭代一个智能体框架(agent.py):它会调整系统提示词、工具、配置和编排,用基准测试给每次改动打分,只保留有提升的改动。
我是要直接编辑这个框架,还是要做别的?你不用亲自碰 agent.py。你要做的是编写 program.md——一个为 meta-agent 提供上下文和指令的 Markdown 文件,然后由 meta-agent 自行编辑单文件框架(agent.py)。
实际要怎么运行 meta-agent 循环?让你的编程智能体指向该仓库并给它提示;随后 meta-agent 会读取 program.md 中的指令,检查当前框架,运行基准测试,诊断失败原因,修改 agent.py,然后不断重复。
试用之前需要安装什么?你需要 Docker、Python 3.10+、uv,以及当前 agent.py 框架所要求的模型服务商 API 凭证。
它自带开箱即用的基准测试吗?没有。仓库不带任何评估任务。你需要按照 Harbor 的任务格式把自己的任务添加到 tasks/ 目录,meta-agent 才有可以优化的分数。
这里的 Docker 隔离有什么用处?meta-agent 的框架实验在容器中运行,这样它整夜迭代时,一次糟糕的改动或失控的进程也不会损坏宿主机。
meta-agent 如何决定保留哪些改动?每次实验都会产生一个数字分数(0.0-1.0),由基准测试套件写入 verifier 日志;如果分数提升,meta-agent 就保留改动,否则丢弃。
为什么 agent.py 是单个文件?作者为了简洁选择了单文件、注册表驱动的设计,同时让智能体和工具的注册保持足够的结构化,使框架能够干净地演进。
能提升 meta-agent 自身的性能吗?可以。你可以为它配备 Agent Skills for Context Engineering 和 context7 技能,以提升它的迭代效果。
Size
1.2 MB
Stars
4.6K
Updated
CommitApr 03
Age
6mo
Commits · 90 Days