# AntOmniEvo

> An auto-evolution framework where a coding agent rewrites your system's skills, prompts, configs and code until the evaluator score goes up

- Category: AI Coding / Autonomous Coding Agents
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/ant-research/AntOmniEvo
- Canonical page: https://ai-tldr.dev/tools/antomnievo/

## In short

AntOmniEvo is an auto-evolution framework where a coding agent rewrites your system's skills, prompts, configs and code until the evaluator score goes up. It sits in the Autonomous Coding Agents category of the AI Coding tools and is open-source, written in Python and licensed Apache-2.0. To get started: install the framework from source.

## Overview

AntOmniEvo is an open-source auto-evolution framework from Ant Research, pitched by its authors as "your 7×24 team of algorithm engineers". It works on a strict division of labour: you define your system's tunable artifacts and what "good" means, the framework controls the optimisation loop, and AI coding agents do the actual editing. A tunable artifact is a real directory of files — an agent's SKILL.md plus references and scripts, a workflow's pipeline.json plus node scripts, or a single-file algorithm plus its description — so optimisation becomes plain file editing. The system being optimised does not need to contain an LLM; the proposer that makes the changes does.

You supply five things once: a System that runs your setup on one evaluation instance, an Evaluator that scores the output from 0 to 1 (its scoring criteria are the objective), train and validation data, a TunableArtifactSchema that maps the file tree and what each file is for, and the initial artifacts. The framework then runs a concurrent evolution loop — scheduling, budgets, selection and elimination, persistence — while a coding-agent Proposer reads failure trajectories, decides which file to edit and lands a structured change as a new candidate. Two proposers ship in the box: ClaudeCodeProposer drives the claude CLI and PiCodingAgentProposer drives the pi CLI. When a candidate misses its bar, a "mara chain" feeds the failed chain's score history, changelog and prior analyses back into the next attempt, and per-instance Pareto pruning keeps the strongest, most versatile candidates in the population.

The output is the best candidate's artifacts: a directory you can diff, review and deploy, with a change lineage that ties every edit to the failure evidence behind it. Everything — candidates, runs, analyses, changelogs — is persisted to a CandidateStore, so a long run can be interrupted and resumed. The project says it fits when the target can be expressed as files and evaluation is repeatable and reasonably cheap; for a handful of scalar parameters it points you to black-box tuning instead. The method is described in the paper "Mara Chain: Rethinking Failure as a Stepping Stone for AI System Auto-Evolution", and a bundled visualizer renders a run as a "Lobster Gym" of candidates ranked by score.

## What it does

- Tunable-artifact-as-genome — optimises a real directory of files (agent skills and harnesses, workflow configs and node code, single-file algorithms), with every change recorded as a structured action that cites the failed trajectory it fixes
- Multi-slot concurrent evolution: up to num_proposals candidates evolve at the same time over a shared candidate pool
- Mara-chain deep repair — a failed batch triggers up to max_reflection_iterations rounds of diagnosis using the chain's score history, changelog and earlier analyses
- Micro-pareto selection with per-instance Pareto pruning and a top-N fallback, plus strict isolation of the validation set from the proposer
- Budget caps on iterations, rollouts, tokens and wall-clock time, with checkpoint resume so interrupted runs pick up where they stopped
- Seven pluggable components — swap the System, Evaluator, Proposer backend, evolution algorithm or CandidateStore (for example a cloud-syncing store) without touching the main loop

## Getting started

AntOmniEvo is a Python framework (Python 3.10 or later) that you drive from your own entry-point script. The project's quick start installs it from source; the example scripts under antomnievo/example/ are reference wiring to copy, not environments that run out of the box.

1. Install the framework from source

   Clone the repository and install the core package from the repo root. The rag extra adds the optional LangGraph / RAG scenarios.

```bash
git clone https://github.com/ant-research/AntOmniEvo.git
cd AntOmniEvo
pip install -e .            # core framework (pydantic, httpx, tenacity)
pip install -e ".[rag]"     # optional: LangGraph / RAG scenarios
```

2. Install a coding-agent CLI for the proposer

   The built-in proposers drive external CLIs: PiCodingAgentProposer needs the pi command, ClaudeCodeProposer needs the claude command. Install whichever you plan to use. Any runtime or scoring harness your own System or Evaluator shells out to is installed separately.

```bash
npm install -g @mariozechner/pi-coding-agent
```

3. Write your optimizer entry point

   Copy the example closest to your system — antomnievo/example/rag/agentic_rag.py is the simplest end-to-end reference — and swap in your own System, Evaluator, dataset loader, TunableArtifactSchema and initial artifacts. The script loads train/val data, builds a timestamped workspace, constructs the components and calls optimize(). The core of the quick-start template:

```python
store = LocalCandidateStore(workspace, cleanup_unavailable=False)
ea    = ParetoFrontierEvolutionAlgorithm(store, max_candidate_num=3)
system    = MySystem(concurrency=8, api_key="…", base_url="…")
evaluator = MyEvaluator()
proposer  = PiCodingAgentProposer(
    api_key="…", tunable_artifact_schema=MY_TUNABLE_ARTIFACT_SCHEMA, candidate_store=store,
    evaluator=evaluator, data_schema=CANDIDATE_DATA_SCHEMA,
    model="…", provider="anthropic", concurrency=20, max_turns=200, timeout=3600,
    system=system, skip_perfect_score_runs=False, last_n_analysis=10,
)
optimizer = Optimizer(
    system=system, proposer=proposer, evaluator=evaluator,
    evolution_algorithm=ea, candidate_store=store,
    train_dataset=train, val_dataset=val,
    batch_size=3, budget=Budget(max_iterations=1000),
    num_proposals=1, max_reflection_iterations=2, min_improvement_per_batch=2.0,
    initial_artifacts_dir="/path/to/tasks/myagent-base",
)
await optimizer.optimize()
```

4. Watch the run in the visualizer

   The visualizer is a separate React + Flask package. Install it, start it, then point the front-end (http://localhost:5173, API on port 3001) at the workspace/<run> directory you want to inspect.

```bash
pip install -e ./visualizer
cd visualizer && npm install
antomnievo-visualizer-manage start
```

## When to use it

- Iteratively improve an agent's skill files, harness or system prompt against a benchmark such as NL2SQL, Terminal-Bench, SWE-bench or AppWorld tasks
- Evolve a retrieval or workflow pipeline — its pipeline.json, node implementations and strategy docs — against an evaluation set
- Optimise a single-file algorithm that has a repeatable evaluation, keeping a reviewable diff and lineage for every accepted change
- Run long, budget-capped optimisation jobs that can be interrupted and resumed without losing the candidate population
