Skip to main content

ARES

Automated Reasoning State Machines — an execution runtime for Propose → Verify → Refine scientific reasoning pipelines designed to work with small local models and provide full step-by-step visibility.


What It Is Suited For

  • Propose → Verify → Refine loops: Iteratively proposing and refining candidate solvers, models, or code against external deterministic checks.
  • Coarse-to-fine screening: Narrowing large paper corpora or multi-table datasets to top candidates, verifying them blindly, and returning unverified when evidence is incomplete.
  • Long or human-gated workflows: Pipelines that must survive crashes, track token/cost usage, or pause for scientist sign-off and new data without restarting from scratch.

Approach (At a Glance)

  • Isolated local frames: Each step receives only its direct inputs rather than an ever-growing chat transcript, keeping prompt size bounded.
  • Out-of-line data: Large datasets, logs, and documents stay on disk; downstream steps inspect bounded slices on demand.
  • Blind verification: External tools and test suites evaluate candidates without seeing the generator's prose.
  • Parallel branching & checkpoints: Competing branches can run concurrently with early stopping on first verified success, wave-level checkpointing, and pause/resume.

For internal state-machine semantics, data contracts, and boundary rules, see docs/SPEC.md.


Installation

pip install ares-sdk
# With optional OpenAI-compatible LLM client (httpx)
pip install "ares-sdk[llm]"

# Or with uv
uv add ares-sdk

Quickstart

For local development from this repository:

uv sync --all-groups
uv run pytest -v

Minimal Python Example

from ares import Done, Spawn, StateMachine, Task, TaskContext, TaskSpec, Transition

m = StateMachine()

@m.state("plan")
def plan(task: Task, deps: dict, ctx: TaskContext) -> Transition:
    items = task.input["items"]
    return Spawn(
        tasks=[TaskSpec(state="square", input={"x": x}) for x in items],
        then=TaskSpec(state="sum_all"),
    )

@m.state("square", deterministic=True)
def square(task: Task, deps: dict, ctx: TaskContext) -> Transition:
    x = task.input["x"]
    return Done(output=x * x)

@m.state("sum_all", deterministic=True)
def sum_all(task: Task, deps: dict, ctx: TaskContext) -> Transition:
    return Done(output=sum(deps.values()))

res = m.run(TaskSpec(state="plan", input={"items": [2, 3, 4]}), max_concurrent=3)
print(res.status, res.output)  # done 29

CLI & Visualization

# Run a state machine
uv run ares run examples.codegen_verify_repair.machine:build_machine \
  --state plan --input '{"task": "slugify"}' --run-dir /tmp/ares_run

# Inspect DAG tree, statuses, artifacts, and recent events
uv run ares inspect /tmp/ares_run --tree

# Read a stored artifact or slice
uv run ares artifact /tmp/ares_run art_<id> --offset 0 --limit 1024

# Resume a crashed or paused run
uv run ares resume /tmp/ares_run \
  --machine examples.codegen_verify_repair.machine:build_machine

# Export a checkpointed run to an interactive single-file HTML trace viewer
uv run python -m ares.ext.viz /tmp/ares_run -o /tmp/trace.html

Examples

Example Focus Run
examples/long_horizon_small_context/ Bounded-context multi-hop chains vs. rolling-transcript overflow; crash/resume + --base-url uv run python -m examples.long_horizon_small_context.run
examples/coarse_to_fine_search/ 2-level coarse-to-fine DuckDB screening; separates 3-signal targets from 2-of-3 decoys uv run python -m examples.coarse_to_fine_search.run
examples/codegen_verify_repair/ Parallel codegen, isolated pytest verification, and bounded refinement over failure slices uv run python -m examples.codegen_verify_repair.run
examples/repo_fix/ Multi-file repository search and parallel git-worktree patching producing a verified diff uv run python -m examples.repo_fix.run

License

MIT — see LICENSE.

Metadata

Release files for ares-sdk 0.2.0

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

Source distribution (sdist)

Source distribution for ares-sdk 0.2.0
File Size Uploaded Provenance Actions
ares_sdk-0.2.0.tar.gz 74.3 kB With provenance Details for ares_sdk-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ares-sdk 0.2.0
File Interpreter ABI Platform Actions
ares_sdk-0.2.0-py3-none-any.whl Python 3 none any Details for ares_sdk-0.2.0-py3-none-any.whl

Total release size: 128.0 kB

Release files / ares_sdk-0.2.0.tar.gz

Download URL ares_sdk-0.2.0.tar.gz
Size 74.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ba935bd2578394bc882070f53079245398c5bdd864c91301bfa38a474f5715dc
BLAKE2b-256 checksum
How to use checksums
4eb2e31fb46ef5fdf6e7b85e61777aa5f8dd9e6a03020842ce01be3bcf8eb04a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Release files / ares_sdk-0.2.0-py3-none-any.whl

Download URL ares_sdk-0.2.0-py3-none-any.whl
Size 53.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e816132cfd1d813925dfa95425fc84658fb6fffa8d4127896c2bf6c40069aa4e
BLAKE2b-256 checksum
How to use checksums
3860faaeabeba1966abcbe798ffad466c77ef967fee0690142b96b35d76c1359
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Security for ares-sdk 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ares_sdk-0.2.0.tar.gz

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 Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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