Skip to main content

Python SDK for h5i orchestra — define-by-run agent orchestration journaled on the git-backed team event log

Project description

h5i-python: Python SDK for Programmable Multi-Agent Orchestration

Claude Code, Codex, and other coding agents have different strengths. However, naive multi-agent orchestration such as simply launching several agents in parallel or allowing them to exchange messages does not define a reproducible development process. A real workflow must specify:

  • who implements;
  • who reviews whom;
  • when an agent must revise its work;
  • which candidates are independently tested;
  • how the winner is selected; and
  • when the selected change is applied to the original branch.

h5i-python is the Python SDK for the h5i orchestra engine. This SDK lets you define and execute multi-agent coding workflows across Claude Code, Codex, and other runtimes as ordinary Python programs.

Each agent works inside its own sandboxed Git worktree, so it cannot overwrite the original checkout or another agent's work. Agent turns produce Git-backed artifacts that can be reviewed, revised, neutrally verified, compared, selected, and applied as one auditable workflow.

Install

Install the h5i engine:

curl -fsSL https://raw.githubusercontent.com/h5i-dev/h5i/main/install.sh | sh

Install the Python SDK from GitHub:

pip install "git+https://github.com/h5i-dev/h5i-python.git"

Quickstart

Create ensemble.py inside the Git repository the agents should modify. This workflow let Claude and Codex independently implement the same task, review and improve each other’s work, and then select the better result.

from h5i.orchestra import Conductor

async def main(task):
    async with Conductor(repo=".", run="demo-task", launcher="resident") as c:
        claude = await c.hire("claude-agent", runtime="claude")
        codex  = await c.hire("codex-agent",  runtime="codex")

        # Have both agents implement the task independently and in parallel
        claude_work, codex_work = await asyncio.gather(claude.work(task), codex.work(task))

        await c.freeze() # Seal the round, ensuring that neither agent influenced the other beforehand

        # Have each agent review the other's work
        await asyncio.gather(codex.review(claude_work), claude.review(codex_work))

        # Verify each submission in a fresh, neutral sandbox
        await c.verify(claude_work, ["pytest", "--quiet"])
        await c.verify(codex_work, ["pytest", "--quiet"])

        verdict = await c.judge() # Select the smallest diff among the submissions that pass all tests
        print("winner:", verdict.selected_submission)

asyncio.run(main("implement quicksort in python with unit test"))

Run it as a normal Python program:

python ensemble.py

With the default launcher="resident", h5i automatically starts the agent sessions through tmux.

Examples

For example, you can program:

  • ask Claude and Codex to implement the same task independently, have them review and improve each other's work, and select the smallest candidate that passes the tests;
  • let Claude Fable and Codex GPT-5.6 Sol iteratively refine a design, then hand the agreed design to Claude Opus for implementation; or
  • repeat a Fable-design/Sol-review loop ten times, ask Opus to implement the result, and invoke Sol to repair the implementation only when Fable rejects it.

See examples/ for complete scores, including:

License

Apache-2.0

Project details


Download files

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

Source Distribution

h5i_orchestra-0.1.0.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

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

h5i_orchestra-0.1.0-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file h5i_orchestra-0.1.0.tar.gz.

File metadata

  • Download URL: h5i_orchestra-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for h5i_orchestra-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6e4bc566d8a4da787e851c27c1cdf609f8098f20034efb5acb2d5111e7f2947c
MD5 08b5da1243000d453cdeb303d5298394
BLAKE2b-256 6f41dd129408fd9a95a3e215df11c405eb5c2e0f081edfdf5bcb4e121b3ceb8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for h5i_orchestra-0.1.0.tar.gz:

Publisher: release.yaml on h5i-dev/h5i-python

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

File details

Details for the file h5i_orchestra-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: h5i_orchestra-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for h5i_orchestra-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f597ad54d55f69a55cbb8a4a65d2a8d50a35b98789a8ff7aa438d2baa7fa73b1
MD5 e9d645a404f32685cd92c9c907a5e57e
BLAKE2b-256 1922c52bc5c442408c2d4e0e238548d7b970d12a8eef76fce60ab68f1706af17

See more details on using hashes here.

Provenance

The following attestation bundles were made for h5i_orchestra-0.1.0-py3-none-any.whl:

Publisher: release.yaml on h5i-dev/h5i-python

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page