Skip to content

Commit ddbce3e

Browse files
author
Richard Barrett
committed
Initial release of autoevolve v0.1.0
Evolutionary optimization framework using LLMs as intelligent mutation operators. Supports Python code and prompt text evolution via beam search, archive feedback, and swarm agents. Features: - Two artifact types: python_code, prompt_text - Three strategies: beam, beam_archive, swarm - Four mutation modes: rewrite, patch, nl_feedback, crossover - Five LLM providers: mock, anthropic, openai, ollama, external_command - Subprocess-based evaluator sandboxing with timeout - Archive with top-k, recent-k, diverse-k selection - OPRO-style natural language feedback - Swarm mode with specialized mutation agents - Run resume support - Three bundled examples - 126 tests (unit + integration + live stubs) - CLI: run, resume, inspect, validate-task, list-examples
0 parents  commit ddbce3e

129 files changed

Lines changed: 10207 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e ".[dev]"
28+
29+
- name: Run unit and integration tests
30+
run: pytest -q --tb=short
31+
32+
- name: Validate example task
33+
run: python -m autoevolve validate-task --task examples/01_text_compression_poem/task.yaml

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
__pycache__/
2+
*.pyc
3+
*.pyo
4+
*.egg-info/
5+
*.egg
6+
dist/
7+
build/
8+
.eggs/
9+
runs/
10+
.venv/
11+
venv/
12+
.env
13+
*.so
14+
.coverage
15+
htmlcov/
16+
.pytest_cache/
17+
.mypy_cache/
18+
*.swp
19+
*.swo
20+
*~
21+
.DS_Store
22+
Thumbs.db
23+
24+
# Temp files from debugging
25+
tmp*
26+
27+
# Build instructions (not for public distribution)
28+
BUILD_SPEC.md
29+
CLAUDE.md
30+
IMPLEMENTATION_STATUS.md
31+
.claude/

ARCHITECTURE.md

Lines changed: 813 additions & 0 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
## 0.1.0 (2026-04-05)
4+
5+
### Added
6+
- Initial release of autoevolve
7+
- Evolutionary optimization framework with LLM-guided mutation
8+
- Two artifact types: `python_code` and `prompt_text`
9+
- Three strategies: `beam`, `beam_archive`, `swarm`
10+
- Four mutation modes: `rewrite`, `patch`, `nl_feedback`, `crossover`
11+
- Five LLM providers: `mock`, `anthropic`, `openai`, `ollama`, `external_command`
12+
- Subprocess-based evaluator sandboxing
13+
- Archive with top-k, recent-k, and diverse-k selection
14+
- OPRO-style natural language feedback
15+
- Swarm mode with specialized mutation agents
16+
- Run resume support
17+
- Three bundled examples
18+
- Comprehensive test suite
19+
- CLI with run, resume, inspect, validate-task, and list-examples commands

CITATION.cff

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cff-version: 1.2.0
2+
title: autoevolve
3+
version: 0.1.0
4+
date-released: "2026-04-05"
5+
license: MIT
6+
repository-code: "https://github.com/yourusername/autoevolve"
7+
abstract: >-
8+
A general-purpose evolutionary optimization framework using LLMs as
9+
intelligent mutation operators.
10+
type: software
11+
authors:
12+
- family-names: Doe
13+
given-names: Jane
14+
email: jane.doe@example.com

CONTRIBUTING.md

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# Contributing to autoevolve
2+
3+
Thanks for your interest in contributing to autoevolve! This project is open to
4+
contributions of all kinds -- bug fixes, new providers, new examples, docs
5+
improvements, and ideas. Every contribution matters.
6+
7+
---
8+
9+
## Getting Started
10+
11+
1. **Fork & clone** the repository:
12+
13+
```bash
14+
git clone https://github.com/<your-username>/autoevolve.git
15+
cd autoevolve
16+
```
17+
18+
2. **Create a virtual environment** (recommended):
19+
20+
```bash
21+
python -m venv .venv
22+
source .venv/bin/activate # Linux / macOS
23+
.venv\Scripts\activate # Windows
24+
```
25+
26+
3. **Install in editable mode with dev extras**:
27+
28+
```bash
29+
pip install -e ".[dev]"
30+
```
31+
32+
4. **Run the tests** to make sure everything works:
33+
34+
```bash
35+
pytest -q
36+
```
37+
38+
You're ready to go!
39+
40+
---
41+
42+
## Code Style
43+
44+
- **Type hints** on all function signatures (parameters and return types).
45+
- **Docstrings** on every public function, class, and module. Use Google-style
46+
docstrings.
47+
- **Keep files small.** If a module is growing past ~300 lines, consider
48+
splitting it.
49+
- Use `snake_case` for functions and variables, `PascalCase` for classes.
50+
- Prefer explicit imports over wildcard imports.
51+
- No unused imports -- your editor or `ruff` will catch these.
52+
53+
---
54+
55+
## Running Tests
56+
57+
The full test suite:
58+
59+
```bash
60+
pytest -q
61+
```
62+
63+
Run a specific test file:
64+
65+
```bash
66+
pytest tests/test_archive.py -q
67+
```
68+
69+
Run with verbose output:
70+
71+
```bash
72+
pytest -v
73+
```
74+
75+
All tests should pass before you open a PR.
76+
77+
---
78+
79+
## How to Add an Example
80+
81+
Examples live in `examples/`. Each example is a directory containing at minimum:
82+
83+
1. **`task.yaml`** -- the task configuration file that autoevolve reads.
84+
2. **`evaluate.py`** (or the evaluator specified in `task.yaml`) -- the fitness
85+
function.
86+
3. Any supporting files the example needs (seed texts, data files, etc.).
87+
88+
Steps:
89+
90+
1. Create a new directory: `examples/NN_short_description/`.
91+
2. Write `task.yaml` following the schema used by existing examples.
92+
3. Write the evaluator script.
93+
4. Add a brief `README.md` inside the example directory explaining what it does.
94+
5. Verify it works end-to-end:
95+
```bash
96+
python -m autoevolve validate-task --task examples/NN_short_description/task.yaml
97+
python -m autoevolve run --task examples/NN_short_description/task.yaml
98+
```
99+
6. Add a mention of the new example to the main project README if appropriate.
100+
101+
---
102+
103+
## How to Add a Provider
104+
105+
Providers live in `src/autoevolve/providers/`. Each provider is a Python module
106+
that implements the provider interface.
107+
108+
Steps:
109+
110+
1. Create a new file: `src/autoevolve/providers/my_provider.py`.
111+
2. Implement the provider interface (see existing providers like `mock.py` for
112+
the pattern).
113+
3. Register the provider so it can be referenced by name in task configs.
114+
4. Add tests in `tests/` covering at least the happy path.
115+
5. Document the provider's required configuration (API keys, endpoints, etc.).
116+
117+
---
118+
119+
## Pull Request Process
120+
121+
1. **Fork** the repo and create a **feature branch** from `main`:
122+
```bash
123+
git checkout -b my-feature
124+
```
125+
2. Make your changes, keeping commits focused and well-described.
126+
3. Run the full test suite: `pytest -q`.
127+
4. Push to your fork and open a **Pull Request** against `main`.
128+
5. In the PR description, explain *what* changed and *why*.
129+
6. Be responsive to review feedback -- we try to review PRs promptly.
130+
131+
### PR Checklist
132+
133+
- [ ] Tests pass (`pytest -q`)
134+
- [ ] New code has type hints and docstrings
135+
- [ ] Any new public API is documented
136+
- [ ] Commit messages are clear and concise
137+
138+
---
139+
140+
## Reporting Bugs
141+
142+
Open a GitHub issue with:
143+
144+
- A clear title and description.
145+
- Steps to reproduce.
146+
- Expected vs. actual behavior.
147+
- Python version and OS.
148+
149+
---
150+
151+
## Suggesting Features
152+
153+
Feature ideas are welcome! Open an issue with the **enhancement** label and
154+
describe:
155+
156+
- The problem you're trying to solve.
157+
- Your proposed solution (if any).
158+
- Alternatives you've considered.
159+
160+
---
161+
162+
## Code of Conduct
163+
164+
Be kind, be respectful, be constructive. We're all here to learn and build
165+
something useful together. Harassment or exclusionary behavior of any kind is
166+
not tolerated.
167+
168+
---
169+
170+
Thank you for helping make autoevolve better!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 autoevolve contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)