h5i-python

agent
Security Audit
Pass
Health Pass
  • License — License: Apache-2.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 30 GitHub stars
Code Pass
  • Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Python SDK for Programmable Multi-Agent Orchestration

README.md

h5i logo

tests Apache-2.0 release

h5i-python: 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.

1. Install

Install the h5i engine:

curl -fsSL https://raw.githubusercontent.com/h5i-dev/h5i/main/install.sh | sh
# cargo install --git https://github.com/h5i-dev/h5i h5i-core

Install the Python SDK from GitHub:

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

2. 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.

If you use herdr (an agent multiplexer for the terminal), pass launcher="herdr" instead: each agent seat comes up as a herdr pane beside your work, labeled h5i-orch-<run>-<agent>, with herdr's own per-agent status (working / blocked / done) in its sidebar.

3. Examples

examples/tutorial provides basic multi-agent orchestration patterns:

examples/papers/ re-implements the core workflow of 40 published multi-agent papers:

Paper Example Summary
Self-Refine self_refine.py Generate, self-critique, refine until the critic approves.
Reflexion reflexion.py Verbal reflections on test failures accumulate as episodic memory across retries.
CRITIC critic.py Critiques grounded in external tool runs drive each correction.
Self-Debug self_debugging.py Explain your own code line by line (rubber duck), then fix.
Constitutional AI constitutional_ai.py Per-principle critiques against a written constitution fold into each revision.
Self-Consistency self_consistency.py N independent reasoning paths, majority vote over the final answers.
More Agents Is All You Need agent_forest.py Sampling-and-voting, with a scaling curve over ensemble size.
Universal Self-Consistency universal_self_consistency.py A selector picks the free-form response most consistent with the sample population.
Multiagent Debate multiagent_debate.py Answer independently, read the others, update; majority vote at the end.
MAD: Divergent Thinking mad_divergent.py An obligated-to-disagree negative side debates the affirmative under an adaptive judge.
ReConcile reconcile.py A model-diverse round table converges by confidence-weighted vote.
Persuasive Debate persuasive_debate.py Debaters argue assigned sides; a transcript-only judge decides.
Negotiation Self-Play negotiation.py Buyer/seller bargaining games improve via a critic's in-context feedback.
ChatEval chateval.py Persona-diverse judges debate one-by-one before scoring the candidates.
Multi-Agent Verification mav_bon.py Best-of-n candidates times m binary aspect verifiers; most approvals wins.
Chain-of-Verification chain_of_verification.py Draft, verify with questions answered by seats that never saw the draft, revise.
SelfCheckGPT selfcheckgpt.py Per-sentence consistency against independent samples flags hallucinations.
PRD: Peer Rank & Discussion prd_peer_rank.py Contestants judge all answer pairs; agreement-weighted ranking plus discussion.
LLM-Blender llm_blender.py Pairwise-rank candidates in both orders, then fuse the top-k.
Mixture-of-Agents mixture_of_agents.py Layered proposers each fed the whole previous layer; an aggregator synthesizes.
Tree of Thoughts tree_of_thoughts.py Beam search over partial plans; only the best leaf pays for real work.
Graph of Thoughts graph_of_thoughts.py Generate/score/aggregate/refine thought transformations on an explicit DAG.
LATS lats.py MCTS over real attempts, with test results as reward and reflections on failures.
Least-to-Most least_to_most.py Decompose easiest-first; solve in order with every prior answer in context.
Skeleton-of-Thought skeleton_of_thought.py Outline first, expand every point in parallel, assemble in order.
Meta-Prompting meta_prompting.py A conductor invents expert personas on the fly and consults fresh seats.
Chain of Agents chain_of_agents.py Sequential workers pass a communication unit across chunks; a manager answers.
STORM storm.py Perspectives, simulated writer-expert interviews, outline, then the article.
CAMEL camel.py Inception-prompted user/assistant role play, one instruction at a time.
AgentCoder agentcoder.py Programmer and mutually blind test designer; a neutral executor loops failures back.
MapCoder mapcoder.py Exemplar recall, confidence-ranked plans, and plan-wise bounded debugging.
MetaGPT metagpt.py Roles exchange structured documents (PRD, design, QA report), never free chat.
ChatDev chatdev.py A chat chain: every waterfall phase is a two-role dialogue with a settled deliverable.
CodeT codet.py Rank blind solutions by agreement with an independently generated test suite.
AlphaCodium alphacodium.py Problem reflection and AI-generated tests before coding; iterate until all green.
Agentless agentless.py A fixed localize, repair, validate pipeline — no agentic wandering.
Parsel parsel.py Decompose into a function graph; implement parts in parallel, compose, test.
Exchange-of-Thought exchange_of_thought.py Four communication topologies (bus/star/ring/tree) as a who-sees-what function.
DyLAN dylan.py Rank each round's contributions and deactivate the weakest seat as you go.
AgentVerse agentverse.py Recruit, collaborate, evaluate — and re-recruit a better team with fresh mid-run hires.

4. License

Apache-2.0

Reviews (0)

No results found