Quorum as a pipeline step

Put a panel at the decision points of an agent pipeline. Check before an irreversible step, escalate a hard call, verify an artifact, and send a split to a person.

An agent pipeline runs a chain of steps. Many are mechanical. A few are decisions: ship this migration, merge this change, send this refund, accept this extraction. Put a Quorum call at those steps. One call returns what several models from different labs concluded independently, and whether they agreed.

The loop

The loop is estimate, deliberate, get_receipt, act.

import os, requests

BASE = "https://www.quorum.dog/v1"
H = {"Authorization": f"Bearer {os.environ['QUORUM_API_KEY']}"}
MODE = "QRUM:STAN"

# max_usd is an example. Tune it to the Mode you call and what a decision is worth.
def quorum_step(question: str, max_usd: float = 1.00) -> dict:
    msgs = [{"role": "user", "content": question}]

    # 1. estimate: free
    try:
        er = requests.post(f"{BASE}/estimate", headers=H, timeout=30,
                           json={"model": MODE, "messages": msgs})
        est = er.json() if er.ok else None
    except (requests.RequestException, ValueError):
        est = None
    if est is None:
        return {"action": "error", "why": "estimate unavailable"}
    if (est.get("deliberation_value") or {}).get("verdict") == "likely_hurts":
        return {"action": "skip", "why": "a panel would rewrite an exact answer"}
    # estimated_price_usd is the Mode surcharge only. The bill adds the token
    # charge and the platform fee, so leave headroom under max_usd.
    if (est.get("estimated_price_usd") or 0) > max_usd:
        return {"action": "skip", "why": "over budget", "estimate": est}

    # 2. deliberate: runs several models, so a long timeout
    try:
        resp = requests.post(f"{BASE}/chat/completions", headers=H, timeout=300,
                             json={"model": MODE, "messages": msgs,
                                   "quorum": {"max_cost_usd": max_usd}})
    except requests.RequestException as e:
        return {"action": "error", "code": type(e).__name__}
    try:
        r = resp.json()
    except ValueError:
        r = {}  # a gateway error can return HTML instead of JSON
    if not resp.ok or "quorum" not in r:
        return {"action": "error", "code": (r.get("error") or {}).get("code") or resp.status_code}
    q = r["quorum"]

    # 3. get_receipt: who sat in which seat, what each scored
    receipt = None
    try:
        rr = requests.get(f"{BASE}/receipts/{q['request_id']}", headers=H, timeout=30)
        if rr.ok:
            receipt = rr.json().get("receipt")  # absent when receipt_available is false
    except (requests.RequestException, ValueError):
        pass  # the answer stands without its receipt

    # 4. act. A replay does not carry the split fields, so it goes to a person.
    replayed = bool(q.get("replayed"))
    split = q.get("converged") is False or q.get("remaining_friction") is not None
    return {
        "action": "human" if (split or replayed) else "proceed",
        "answer": r["choices"][0]["message"]["content"],
        "contested": q.get("contested_passage"),
        "replayed": replayed,
        "request_id": q["request_id"],
        "receipt": receipt,
    }

The samples call Standard Mode ยท QRUM:STAN. Call list_modes over MCP or GET /v1/models for the Modes your key can use. The model field takes the ticker.

Three places a step belongs

Checkpoint. Before an action that cannot be undone, ask the panel whether the plan holds. The agent proposes the migration, the panel reads it, and the pipeline continues when the seats agree.

Escalate. A step the agent is unsure about goes to the panel instead of a single guess. The escalation router has the routing code.

Verify. After a step produces an artifact such as a diff, a plan or an extraction, hand the artifact to the panel and ask what is wrong with it. The GitHub Actions example runs this on every pull request.

A split goes to a human

When the seats disagree, the disagreement is the result, and a person should read it. Three fields on quorum carry it.

FieldRead it as
convergedfalse when the panel did not settle on one position.
remaining_frictionUsually factual_conflict, when the judge flagged a factual conflict between seats, or null. It can carry a short sentence from the judge naming the disagreement.
contested_passageAn object { seat, quote, why }: the seat, the passage it quoted and why it is contested. null when no single passage carried the split.

Route on converged === false or a non-null remaining_friction. Show the reviewer contested_passage.quote and the receipt along with the answer.

A repeat of a call that already succeeded, with the same idempotency key, returns a replay with quorum.replayed: true. The replay holds the answer but not converged, remaining_friction, contested_passage or billed_usd. Check replayed first and read the other fields with a default, as the sample does. A replayed answer has no recorded split state, so the sample sends it to a person. The receipt lists each seat, so the reviewer can tell a real disagreement from seats agreeing for the same reason.

Cost and time

Convene a panel for judgement calls: a consequential assumption, options close enough that the numbers no longer separate them, a diagnosis you cannot check, a decision you will have to defend, or a "what have I missed" check. Use a single model for lookups, syntax, formatting, conversions, arithmetic and anything you need reproduced word for word.

From an MCP client

An agent connected over MCP has the same loop as tools: estimate, deliberate, get_receipt. Quotes the Mode's surcharge for the question and says whether a panel is likely to help, free of charge. The bill adds the token charge and the platform fee. Setup is in Connect Quorum to your tools.

Next

The paper

This guide is also a paper: Quorum as a pipeline step (PDF).

More papers are on the whitepaper shelf.