Skip to main content

DarwinAgent

Evolution for the Agent Era

An open Python framework for experience-driven recursive self-improvement of agents. Run a task, propose changes to its assets, evaluate candidates independently, and retain effective versions and experience. Version 0.1.1 is experimental; improvement must be measured.

中文使用指南 · English guide

Install

Python 3.11 or newer is required. One package provides both the command-line tool and the Python API:

python -m pip install darwinagent
darwinagent --version

Configure a model

Live execution requires your own OpenAI-compatible Chat Completions endpoint. Create .env in the directory where you run commands:

DARWINAGENT_BASE_URL=https://your-provider.example/v1
DARWINAGENT_MODEL=your-model-name
DARWINAGENT_API_KEY=your-api-key

Replace all three placeholders with your API base URL, supported model name, and key. Do not include /chat/completions in the base URL. All roles share this model by default. The CLI loads the current directory's .env; existing environment variables take precedence.

Run the live demo

Check the connection with one real model request, then run two rounds:

darwinagent doctor --check-model --output runs/doctor
darwinagent demo --mode live --rounds 2 --output runs/demo-live \
  --max-requests 40 --timeout 1800

The demo asks who maintained a device and when, then tries to improve its prompt using independent answer scoring. Results go to runs/demo-live/. Start with demo-summary.json for decisions and reasons; published/current.json points to retained assets.

The cap counts HTTP attempts including retries; the timeout bounds the whole run. Ties are rejected and scores need not improve. Add --resume to continue an existing run, or use a fresh output directory for another experiment.

Use the Python API

Install the same package, then use the complete live Python example. It explicitly loads .env, creates Config, and passes it to run_demo(..., mode="live", config=config).

For your own records and questions, follow the custom task tutorial, including a complete Pipeline script and an independent evaluator.

Try without model credentials

darwinagent demo --mode replay --rounds 2 --output runs/demo-replay

Replay uses scripted model responses with no network requests or credentials. Expect completion, a first accepted candidate, and a second rejected on a tie. It demonstrates mechanics, not model learning or benchmark gains.

Documentation

Distributed under the MIT license.

Metadata

Release files for darwinagent 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for darwinagent 0.1.1
File Size Uploaded
darwinagent-0.1.1.tar.gz 237.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for darwinagent 0.1.1
File Interpreter ABI Platform
darwinagent-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 521.9 kB

Release files / darwinagent-0.1.1.tar.gz

Download URL darwinagent-0.1.1.tar.gz
Size 237.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d0851ce429467c7e87097d8f39d42b9132641bdb848ab15d83337226a217b799
BLAKE2b-256 checksum
How to use checksums
4d9c0aa46658850342a3457936ec73d414385058fe6a3b3d8c852adf7355eda0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / darwinagent-0.1.1-py3-none-any.whl

Download URL darwinagent-0.1.1-py3-none-any.whl
Size 284.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06c9f0789578f32050689ff847b50b80697dfdd1e5df8294710dca228ce2b421
BLAKE2b-256 checksum
How to use checksums
6f0725f9e5d2aecf7b4b5dea553bac2ea4db99edf805c236b547a62d0895341a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page