How Weco works
The mental model behind Weco - autoresearch, the solution tree, and the vocabulary (run, step, node, branch, subtree, lineage, baseline) used throughout the docs.
Weco is an autoresearch engine. Left to its own devices, someone optimizing code does the same few things over and over: change something, run it, see if the number got better, and build on the changes that did. Weco automates that loop. "Autoresearch" is the name for running it against a goal you set, without a person in every cycle.
The optimization loop
You give Weco some code to optimize and a way to measure success. Each turn of the loop is a step, and a step does four things:
- Propose a change to the code, informed by everything tried so far.
- Apply it to your source file(s).
- Evaluate it by running your evaluation, which prints a metric.
- Score and record the result.
Weco uses tree search guided by LLMs, our AIDE algorithm, to decide which earlier result to build on and what to try from there. Some steps push further on an idea that is already working. Others break away and try something new.
The solution tree
Every step produces a node: the code at that step, the score it earned, and an edge back to the node it was changed from. Together the nodes form the solution tree.
Your starting code is the baseline, the root of the tree (step 0). The search grows the tree from there. It does not spend effort evenly across the tree. It concentrates on the solutions that are scoring well, reusing and refining what works, while still leaving room to try new directions and to revisit earlier attempts.
When a run finishes, Weco gives you the option to write the highest-scoring node back to your files. You can trace the full path in the dashboard: every variant it tried, and what each one scored.
Branches, subtrees, and lineage
You do not have to leave a run to itself. When you steer it, or derive a new run from a particular node, the search grows a new branch: a subtree that starts at the node you picked and explores your instruction from there. Start several branches from the same node and you get parallel subtrees, one per idea, ready to compare against each other.
A run and every run derived from it belong to the same lineage, and they show up together in one tree. The lineage-best is just the highest-scoring node across that whole lineage, whichever branch it came from.
Vocabulary
| Term | What it means |
|---|---|
| Autoresearch | Running the propose, evaluate, keep, build-on loop automatically, against a metric you set. |
| Run | One optimization job (one weco run). |
| Step | One turn of the loop: propose, apply, evaluate, score. |
| Node | The record of a step: a code variant and its score, placed in the tree. |
| Baseline | Your starting code. Step 0, the root of the tree. |
| Solution tree | The branching structure of every node in a run or lineage. |
| Branch / subtree | A line of exploration growing from a chosen node. |
| Lineage | A run and all runs derived from it, shown together as one tree. |
| Lineage-best | The highest-scoring node across the whole lineage. |
Where to go next
- Writing eval scripts defines the metric the loop climbs.
- Steerability covers branching and steering the search mid-run.
- Dashboard is where you watch the tree grow and compare branches.
Quickstart
Get Weco running in your own codebase in a couple of minutes. Paste one prompt into your AI coding assistant and it sets everything up.
Run vs Observe
Weco's two modes - let Weco drive the optimization (weco run), or track a loop you drive yourself (weco observe) - and what runs on your machine versus in the cloud.