Skip to main content

PyPI version Python 3.12+ License

Millrace signal mark

Millrace

Ever find yourself doing the same thing over and over with AI agents?

You construct the plan. You tell it to execute the plan, then you have another agent check the first agent's work. It finds issues, so you tell it to fix those issues. Any time a new blocker comes up, you ask it to troubleshoot the issue and fix it before moving on. You rinse and repeat until there's no more bugs and everything matches the initial plan.

All you did was manage which agent performs which role at which time. If you sketched the entire process on paper, you would find a manually driven workflow graph: stages connected by completion, failure, recovery, and escalation outcomes. An agent can generally be relied upon to execute any single step on its own, but owning the entire workflow end to end? No agent is owning that reliably (yet). And this is where Millrace comes in.

flowchart TD
    W["Workflow package<br/>stages, routes, rules"] --> C["Compiler<br/>validate and freeze"]
    C --> P["Selected plan<br/>immutable authority"]
    P --> R["Durable runtime<br/>queues, runs, waits"]
    R -->|"bounded dispatch"| A["Agent runner<br/>Codex, Millforge"]
    A -->|"candidate evidence"| V{"Valid under<br/>selected plan?"}
    P -.->|"governs"| V
    V -->|"yes"| T["Commit state transition"]
    T --> R
    V -->|"no"| X["Refuse, retry,<br/>or wait for operator"]
    X --> R

If your workflow can be described as stages, outcomes, and transitions, Millrace can compile it into an executable plan. Completion moves to the next step, failure moves to bugfixing, and a hard blocker escalates to automated recovery. You can have as many recovery mechanisms or branching paths as you like, and the compiler makes sure you're only running valid plans.

Millrace made its compiled workflow graph authoritative over agent execution on April 23, 2026, months before "graph engineering" became a category. The prior-art audit found only one earlier comparable open-source implementation: Dagu v2.5.0. Review the definition, dated evidence, and prior-art audit.

For more information, check out the FAQ.

Start With Your Agent

Millrace is agent-first. Give this repository to a capable local agent:

Install Millrace for me in this workspace using https://github.com/tim-osterhus/millrace. Read its README and instruction manual first. Check the CLI, workspace, workflows, and runners. Report what you installed and what you need next. Do not store credentials in workflow assets or start unattended work.

Then delegate work:

Use Millrace to govern this work: <goal and constraints>. Choose an official workflow, explain why, start with a bounded run, and report the selected plan, state, waits, and evidence.

Manual setup is documented in Getting started.

Runtime Rules

  • The selected plan defines legal stages, routes, assets, runners, and outcomes.
  • Queues, runs, waits, traces, and artifacts survive restarts.
  • Each stage receives only its selected assets and context.
  • Model output is evidence, not runtime truth.
  • Retries, reroutes, pauses, and operator decisions remain on record.
  • Operator dispatch suspension gates only new claim acceptance. Already accepted or active work keeps its durable authority.
  • Queue cancellation closes eligible workflow work through the normal audited close-work transition. It never deletes queue state or signals a runner.
  • Supported commands change state; direct file edits do not.

Workflows

millrace-plus provides:

  • simple_loop: plan, run, review, and bounded recovery;
  • lean_agentic_development: full end-to-end autonomous agentic engineering;
  • vendor_selection: policy checks, parallel evaluation, and an operator gate.

These are package data, not hard-coded kernel behavior.

Documentation

Getting started · How Millrace works · Graph authority and prior art · Runner-session architecture · Daemon lifecycle · Workflow packages · Millforge runner · Codex runner · Errors · Migrating from v0.21 · v0.22 support

Millrace v0.22 is local and single-operator. It supports Linux, macOS, and WSL.

License

Apache License 2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

millrace_ai-0.22.2.tar.gz (438.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

millrace_ai-0.22.2-py3-none-any.whl (465.9 kB view details)

Uploaded Python 3

File details

Details for the file millrace_ai-0.22.2.tar.gz.

File metadata

  • Download URL: millrace_ai-0.22.2.tar.gz
  • Upload date:
  • Size: 438.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for millrace_ai-0.22.2.tar.gz
Algorithm Hash digest
SHA256 0d35b2f80fde98e663cfff976b470e53ba51f26a919a063c855ab5166cb43406
MD5 a1f8db92504a6e897391ef55fcb4ac95
BLAKE2b-256 0d447094adb9e7423cf7cec640ff1db9796b96418ebb44441bf3c1ee1c4d0d35

See more details on using hashes here.

Provenance

The following attestation bundles were made for millrace_ai-0.22.2.tar.gz:

Publisher: publish-to-pypi.yml on tim-osterhus/millrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file millrace_ai-0.22.2-py3-none-any.whl.

File metadata

  • Download URL: millrace_ai-0.22.2-py3-none-any.whl
  • Upload date:
  • Size: 465.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for millrace_ai-0.22.2-py3-none-any.whl
Algorithm Hash digest
SHA256 73e2e24043702d458e658a896c01cca07550a953ee7019219bb42e99ef033353
MD5 3e6679dc288ba3aeb8c60c673b2d7428
BLAKE2b-256 625c8b454c714156ac238525d6f57464a4bf9a89fe439958ceb1834ec5ac9ee2

See more details on using hashes here.

Provenance

The following attestation bundles were made for millrace_ai-0.22.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on tim-osterhus/millrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.22.3

2 files

This release

0.22.2 This release

2 files

0.22.0

2 files

0.21.1

2 files

0.21.0

2 files

0.20.3

2 files

0.20.2

2 files

0.20.1

2 files

0.20.0

2 files

0.19.0

2 files

0.18.6

2 files

0.18.5

2 files

0.18.4

2 files

0.18.3

2 files

0.18.2

2 files

0.18.1

2 files

0.18.0

2 files

0.17.4

2 files

0.17.3

2 files

0.17.2

2 files

0.17.1

2 files

0.17.0

1 file

0.16.3

2 files

0.16.2

2 files

0.16.1

2 files

0.16.0

2 files

0.15.9

2 files

0.15.8

2 files

0.15.7

2 files

0.15.6

2 files

0.15.5

2 files

0.15.4

2 files

0.15.3

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.14.1

2 files

0.14.0

2 files

0.13.0

2 files

0.12.5

2 files

0.12.4

2 files

0.12.3

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.5

2 files

0.11.4

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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