constitutional-swarm
Orchestrator-free constitutional governance runtime for multi-agent systems.
30-second explanation
constitutional-swarm extends acgs-lite from governing single actions to governing societies of agents.
It combines local constitutional enforcement (AgentDNA), DAG-based swarm execution (SwarmExecutor), peer validation (ConstitutionalMesh), durable settlement stores, replayable governance receipts, and bounded trust dynamics.
This package is not a generic agent framework and not an all-in-one orchestration platform. It is a governance runtime you can embed into your existing agent stack.
Public import policy: docs/API_COMPATIBILITY.md. Hardcoded historical pins
such as 443 ns, 2,656%, or official SWE-bench scores are not current
product claims.
Why it exists
Most multi-agent systems can execute tasks, but fewer can show:
- what policy was applied,
- which peers validated outputs,
- what decision was settled,
- and how to replay evidence later.
constitutional-swarm focuses on governed execution and verifiable governance evidence.
What this package provides
- Local constitutional checks on agent actions (
AgentDNA) - Orchestrator-free task execution over DAGs (
DAGCompiler,SwarmExecutor) - Peer validation with signed votes and quorum settlement (
ConstitutionalMesh) - Durable settlement persistence (
JSONLSettlementStore,SQLiteSettlementStore) - Replayable governance receipts and verifier tooling (
governance_receipts,acgs-verify-receipts) - Trust-dynamics modules with bounded projection (
spectral_sphere,manifoldbaseline)
What this package does not provide
- A full hosted agent platform
- Turnkey workflow UI / dashboards
- Compliance certification or regulator approval
- A claim that all modules are production-ready
- A replacement for your existing model/runtime/orchestration tools
What this is / what this is not
| This is | This is not |
|---|---|
| An orchestrator-free governance runtime | A generic no-governance multi-agent framework |
| Local constitutional enforcement + peer validation | A centralized coordinator product |
| Durable settlement + replayable receipts | A compliance certificate |
| Stable eager façade plus lazy legacy imports | A promise that import * still dumps research symbols |
Install
Requires Python 3.11+ (pyproject.toml).
# Core runtime
pip install constitutional-swarm
# Optional extras
pip install "constitutional-swarm[dev]" # pytest, ruff, mypy, numpy (tests)
pip install "constitutional-swarm[transport]" # websockets remote-vote transport
pip install "constitutional-swarm[research]" # torch + transformers + numpy
pip install "constitutional-swarm[latent]" # deprecated alias of research
pip install "constitutional-swarm[finetune]" # research + trl/peft recipe
pip install "constitutional-swarm[semantic]" # sentence-transformers role-drift
pip install "constitutional-swarm[bittensor]" # Bittensor subnet integration
pip install "constitutional-swarm[langgraph]" # LangGraph runtime adapter
pip install "constitutional-swarm[langgraph-swarm]" # LangGraph handoff topology
pip install "constitutional-swarm[vertex]" # Anthropic-on-Vertex SWE-bench agent
pip install "constitutional-swarm[gemini]" # Gemini SWE-bench agent
pip install "constitutional-swarm[braintrust]" # optional testnet/eval telemetry
5-minute quickstart
Create quickstart.py:
from acgs_lite import Constitution
from constitutional_swarm import AgentDNA, ConstitutionalMesh
# 1) Local constitutional enforcement
# Start with default constitutional rules, then load custom rules as needed.
agent = AgentDNA.default(agent_id="worker-1")
validation = agent.validate("summarize the meeting notes")
assert validation.valid
# 2) Peer-validated settlement
constitution = Constitution.default()
# quorum is the accept threshold (2 of 3 peers). quorum_met also needs every
# assigned peer to have voted, so the loop below votes with all of them.
required_votes = 2
# This demo holds every signing key in one process, so it must opt in to the
# single-operator dev evidence mode. Evidence produced in this mode is labelled
# "single_operator_dev" and is rejected by the default verifiers. Production
# meshes keep the default ("independent") and register remote voters with
# register_remote_agent.
mesh = ConstitutionalMesh(
constitution,
peers_per_validation=3,
quorum=required_votes,
evidence_mode="single_operator_dev",
)
mesh.register_local_signer("producer", domain="writing")
mesh.register_local_signer("peer-1", domain="writing")
mesh.register_local_signer("peer-2", domain="writing")
mesh.register_local_signer("peer-3", domain="writing")
assignment = mesh.request_validation("producer", "safe draft content", "artifact-1")
for voter_id in assignment.peers:
mesh.submit_vote(
assignment.assignment_id,
voter_id,
approved=True,
reason="constitutional check passed",
signature=mesh.sign_vote(
assignment.assignment_id,
voter_id,
approved=True,
reason="constitutional check passed",
),
)
result = mesh.get_result(assignment.assignment_id)
print(result.accepted, result.quorum_met, result.settled)
Run it:
python quickstart.py
Expected: settled quorum result (accepted=True, quorum_met=True, settled=True).
Architecture in one view
Agent call/input
-> AgentDNA (local constitutional enforcement)
-> DAGCompiler + SwarmExecutor (orchestrator-free execution)
-> ConstitutionalMesh (peer validation + signed votes)
-> SettlementStore (durable finalization evidence)
-> Governance receipts / verifier (replayable audit trail)
-> Trust dynamics (spectral_sphere current direction, manifold baseline control)
Maturity tiers
Stable core
AgentDNADAGCompiler,TaskDAG,SwarmExecutorConstitutionalMeshsigned-vote workflowJSONLSettlementStore,SQLiteSettlementStore- Governance receipts + verifier CLI (
acgs-verify-receipts)
Advanced runtime (stable APIs, optional in many deployments)
- Remote vote transport (
constitutional_swarm.remote_vote_transport,[transport]) EvolutionLoginvariant-enforced governance metricsSpectralSphereManifoldbounded trust dynamics (current direction)- LangGraph runtime adapter (
[langgraph],[langgraph-swarm]) - Bittensor integration (
[bittensor])
Research / experimental modules
latent_dna(BODES-based steering hooks,[research])swarm_odemerkle_crdt+gossip_protocolswe_bench/evaluation modules and scriptsmanifold.pyBirkhoff/Sinkhorn baseline retained as research control
Core concepts
- Governed execution: each step can be policy-checked before execution/acceptance.
- Local constitutional enforcement: policy checks run inside the agent runtime path.
- Peer validation: assigned peers vote on outputs with signatures.
- Durable settlement: final decisions are persisted as replayable evidence.
- Replayable receipts: governance receipts are canonicalized and verifiable.
- Bounded trust dynamics: trust updates are projected into bounded manifolds.
Common use cases
- Governed agent execution in coding/review workflows
- Peer-validated output acceptance before downstream automation
- Decentralized or orchestrator-free agent task flows
- Governance receipt generation and settlement evidence retention
- Research experiments on trust dynamics and swarm behavior
When to use this package
Use constitutional-swarm when you need:
- verifiable governance steps inside agent workflows,
- peer-validated acceptance/rejection,
- durable, replayable governance evidence,
- explicit separation between stable runtime and research modules.
When not to use this package
Choose another tool first when you need:
- only basic orchestration with no governance/validation,
- a hosted platform with UI-first operations,
- fully fixed APIs across all experimental modules,
- compliance attestations by default.
Examples
examples/constitution.yaml— minimal constitution configexamples/langgraph_swarm_demo.py— LangGraph adapter exampleexamples/governed-handoff/— governed coding-agent handoff demo- See
docs/examples.mdfor task-oriented walkthroughs
Security and trust boundaries
- See
SECURITY.mdfor vulnerability reporting and support policy. - See
docs/security-model.mdfor technical trust boundaries. - Signed votes are required for
ConstitutionalMesh.submit_vote. - Remote vote transport security mode should be configured explicitly for non-loopback use.
- Treat optional research modules as experimental surfaces, not hardened defaults.
Documentation map
Maintainers & AI agents: start at the consolidated wiki —
docs/wiki/. It ties these docs together with per-module code logic, end-to-end runtime flows, the roadmap, and a handoff checklist.
| Audience | Start here | Then read |
|---|---|---|
| New contributors | docs/quickstart.md |
CONTRIBUTING.md, docs/community.md |
| Runtime integrators | docs/concepts.md |
docs/architecture.md, docs/security-model.md |
| Agent-framework maintainers | docs/architecture.md |
docs/langgraph_runtime.md, MIGRATION.md |
| Governance/community contributors | docs/community.md |
docs/roadmap.md, docs/faq.md |
| Researchers | docs/roadmap.md |
docs/maci_dp_protocol.md, paper/README.md, docs/internal/* |
Verification commands
This repo is uv-managed; prefer the one-command targets (see TOOLS.md):
make setup # create the venv + install dev extras (standalone-safe)
make verify # lint -> agent-check -> smoke -> tests
make agent-check # validate agent/tool registries + doc completeness
The equivalent raw invocations run through the venv (no global python/pip/ruff is assumed):
uv run --no-sync ruff check src/constitutional_swarm/
uv run --no-sync ruff format --check src/
uv run --no-sync pytest tests/ --import-mode=importlib -q
uv run --no-sync pytest -m "not slow and not e2e and not research" tests/ --import-mode=importlib -q
uv build
If optional extras are installed, run targeted suites (for example transport or research-marked tests).
Contributing
- Contribution guide:
CONTRIBUTING.md - Code of conduct:
CODE_OF_CONDUCT.md - Security policy:
SECURITY.md
Roadmap
See docs/roadmap.md.
License
AGPL-3.0-or-later (see package metadata in pyproject.toml).
Metadata
Release files for constitutional-swarm 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| constitutional_swarm-1.1.0.tar.gz | 1.6 MB | With provenance | Details for constitutional_swarm-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| constitutional_swarm-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for constitutional_swarm-1.1.0-py3-none-any.whl |
Total release size: 2.4 MB
Release files / constitutional_swarm-1.1.0.tar.gz
| Download URL | constitutional_swarm-1.1.0.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ff6d4d2a5af01503184c78e89c09de549157bfea1f6cec0e4bcc3c73a3a2e05
|
|
BLAKE2b-256 checksum How to use checksums |
0359f530ea259f92f1399e2c904b4beebe74e4f3a9c4dfcd2ee2f2bc35c72b4c
|
| 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 28, 2026.
Transparency logRelease files / constitutional_swarm-1.1.0-py3-none-any.whl
| Download URL | constitutional_swarm-1.1.0-py3-none-any.whl |
|---|---|
| Size | 823.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6bfa1ead3224dc0bd4edc256650c6ac11ed0cfbb6a1f62be22871d1355f2407d
|
|
BLAKE2b-256 checksum How to use checksums |
e1ec1f1c01d57df019ce8faebe8d5ccf65397b316a5b49b9a6068bebeb5b4e82
|
| 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 28, 2026.
Transparency logSecurity for constitutional-swarm 1.1.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.
Attestation for constitutional_swarm-1.1.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 28, 2026.
Transparency logA 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.