On-chain multi-agent arbitration primitive. Debate or vote, the AI decides.
Project description
agora-arbitrator-sdk
On-chain multi-agent arbitration for LangGraph, CrewAI, and Python agent systems.
Agora decides whether a task should be resolved by structured debate or confidence-weighted voting, executes the selected mechanism, and returns a verifiable deliberation receipt.
Hosted and local results both expose the same Phase 2 telemetry contract: per-model tokens, input/output/thinking token splits when available, latency, and estimated USD cost.
Quickstart
pip install agora-arbitrator-sdk
Hosted API mode
import asyncio
from agora.sdk import AgoraArbitrator
async def main() -> None:
async with AgoraArbitrator(auth_token="agora_live_your_public_id.your_secret") as arbitrator:
result = await arbitrator.arbitrate("Should we use microservices or a monolith?")
print(result.mechanism_used.value)
print(result.final_answer)
print(result.merkle_root)
asyncio.run(main())
Hosted streaming mode
import asyncio
from agora.sdk import AgoraArbitrator
async def main() -> None:
async with AgoraArbitrator(auth_token="agora_live_your_public_id.your_secret") as arbitrator:
created = await arbitrator.create_task(
"Should we use microservices or a monolith?",
mechanism="vote",
)
await arbitrator.start_task_run(created.task_id)
async for event in arbitrator.stream_task_events(created.task_id):
print(event)
result = await arbitrator.get_task_result(created.task_id)
print(result.model_dump_json(indent=2))
asyncio.run(main())
Local callable mode
import asyncio
from agora.sdk import AgoraArbitrator
async def agent_a(user_prompt: str) -> dict:
return {
"answer": "Modular monolith",
"confidence": 0.78,
"predicted_group_answer": "Modular monolith",
"reasoning": "Lower coordination overhead."
}
async def main() -> None:
arbitrator = AgoraArbitrator(mechanism="vote", agent_count=3)
result = await arbitrator.arbitrate(
"What architecture should a three-engineer startup use?",
agents=[agent_a, agent_a, agent_a],
)
print(result.final_answer)
asyncio.run(main())
LangGraph integration
from agora.sdk import AgoraNode
from langgraph.graph import StateGraph
graph = StateGraph(dict)
graph.add_node(
"deliberate",
AgoraNode(strict_verification=True),
)
For long-lived LangGraph workers or repeated node construction, close the wrapped HTTP client explicitly:
async with AgoraNode() as agora_node:
state = await agora_node({"task": "Pick the safer deployment plan."})
Features
- Thompson Sampling mechanism selection with explainable reasoning
- Factional debate with LangGraph execution and Devil's Advocate cross-examination
- Confidence-calibrated vote aggregation with ISP weighting
- Merkle-verifiable transcript receipts
- Per-model telemetry and estimated USD cost in hosted and local modes
- Optional hosted API mode and local callable mode
Authentication
- Dashboard users authenticate with WorkOS-issued bearer tokens.
- SDK, CI, notebooks, and server-side callers should use first-party Agora API keys.
- Hosted mode keeps the same
auth_token=interface, but the token should be an Agora API key such asagora_live_<public_id>.<secret>oragora_test_<public_id>.<secret>in non-production environments. - Strict hosted E2E should use a real staging API key, not a fabricated JWT.
Hosted API URL policy
Hosted SDK calls resolve the canonical Cloud Run backend automatically. Do not pass a manual
hosted URL in normal usage. For internal testing only, set AGORA_ALLOW_API_URL_OVERRIDE=1
and AGORA_API_URL=https://your-dev-backend.example.com before constructing the SDK.
Verification Controls
AgoraArbitratordefaults to 4-agent hosted execution, the canonical Cloud Run API URL, and strict receipt verification.AgoraNodesupportsstrict_verification,solana_wallet, and async cleanup pass-through for parity withAgoraArbitrator.- Set
strict_verification=Falseonly when intentionally opting into lenient verification behavior.
Maintainer Release Notes
- Current release process is documented in
../docs/release-operations.md. - Current package target is
agora-arbitrator-sdk==0.1.0a1. - This cycle keeps PyPI publish manual while documenting the next-cycle automation plan.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agora_arbitrator_sdk-0.1.0a1.tar.gz.
File metadata
- Download URL: agora_arbitrator_sdk-0.1.0a1.tar.gz
- Upload date:
- Size: 78.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b75ef33c9978a98be74bcaea0277898cb6cfd935a5561e5b0ae0940cfe45555
|
|
| MD5 |
bf6bd05835661f9f7eaf893b93831ef7
|
|
| BLAKE2b-256 |
0683cfaeb73f374d77eaad1e5dad75be274900c4ffb7f92246963558d16d341d
|
Provenance
The following attestation bundles were made for agora_arbitrator_sdk-0.1.0a1.tar.gz:
Publisher:
deploy-sdk.yml on zahemen9900/agora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agora_arbitrator_sdk-0.1.0a1.tar.gz -
Subject digest:
0b75ef33c9978a98be74bcaea0277898cb6cfd935a5561e5b0ae0940cfe45555 - Sigstore transparency entry: 1344899715
- Sigstore integration time:
-
Permalink:
zahemen9900/agora@75bf49c2b0521a9c0dfdd863dc1947c5e813c7bb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zahemen9900
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy-sdk.yml@75bf49c2b0521a9c0dfdd863dc1947c5e813c7bb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file agora_arbitrator_sdk-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: agora_arbitrator_sdk-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 86.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9d58d93e91f2708aaa24cc92bd28711ab83d778fe8ccfad7afefc54ada53871
|
|
| MD5 |
dfc2385d315d6cdec4680d8814aa62c9
|
|
| BLAKE2b-256 |
1b7c01e614cbc48718de9ca3a1e9f87d277a61f62f222e6e7004d117db742768
|
Provenance
The following attestation bundles were made for agora_arbitrator_sdk-0.1.0a1-py3-none-any.whl:
Publisher:
deploy-sdk.yml on zahemen9900/agora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agora_arbitrator_sdk-0.1.0a1-py3-none-any.whl -
Subject digest:
b9d58d93e91f2708aaa24cc92bd28711ab83d778fe8ccfad7afefc54ada53871 - Sigstore transparency entry: 1344899791
- Sigstore integration time:
-
Permalink:
zahemen9900/agora@75bf49c2b0521a9c0dfdd863dc1947c5e813c7bb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zahemen9900
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy-sdk.yml@75bf49c2b0521a9c0dfdd863dc1947c5e813c7bb -
Trigger Event:
workflow_dispatch
-
Statement type: