constitutional-swarm
Orchestrator-free multi-agent governance.
constitutional-swarm packages the core swarm patterns for governed multi-agent
systems: embedded agent DNA validation, task-DAG coordination, peer-validated mesh
consensus, and manifold-constrained trust propagation.
Installation
constitutional-swarm supports Python 3.11+.
pip install constitutional-swarm
pip install constitutional-swarm[bittensor]
Quick Start
Agent DNA
from constitutional_swarm import AgentDNA
dna = AgentDNA.default(agent_id="agent-1")
result = dna.validate("deploy to production")
print(result.valid, result.constitutional_hash)
Stigmergic Task DAGs
from constitutional_swarm import TaskDAG, TaskNode
dag = TaskDAG(goal="Build governed AI system")
dag = dag.add_node(
TaskNode(
node_id="research",
title="Research requirements",
domain="research",
required_capabilities=("research",),
)
)
dag = dag.add_node(
TaskNode(
node_id="implement",
title="Implement core",
domain="engineering",
depends_on=("research",),
required_capabilities=("coding",),
)
)
dag = dag.mark_ready()
assert dag.nodes["research"].status.value == "ready"
dag = dag.claim_node("research", agent_id="agent-1")
dag = dag.complete_node("research", artifact_id="spec-001")
dag = dag.mark_ready()
assert dag.nodes["implement"].status.value == "ready"
Constitutional Mesh Validation
from acgs_lite import Constitution
from constitutional_swarm import ConstitutionalMesh
mesh = ConstitutionalMesh(Constitution.default(), peers_per_validation=3, quorum=2)
mesh.register_agent("agent-1", domain="platform")
mesh.register_agent("agent-2", domain="security")
mesh.register_agent("agent-3", domain="compliance")
mesh.register_agent("agent-4", domain="operations")
assignment = mesh.request_validation(
producer_id="agent-1",
content="deploy payment module",
artifact_id="artifact-1",
)
mesh.validate_and_vote(assignment.assignment_id, "agent-2")
mesh.validate_and_vote(assignment.assignment_id, "agent-3")
result = mesh.get_result(assignment.assignment_id)
print(result.quorum_met, result.accepted, result.proof is not None)
Governance Manifold
from constitutional_swarm import GovernanceManifold
manifold = GovernanceManifold(num_agents=3)
manifold.update_trust(0, 1, 0.8)
manifold.update_trust(1, 2, 0.5)
projection = manifold.project()
print(projection.converged, projection.spectral_bound)
Key Features
- Embedded
AgentDNAvalidation with decorator support and halt/resume controls. - DAG-based task coordination through
TaskDAG,TaskNode, andSwarmExecutor. - Peer-validated consensus and Merkle-style proof generation via
ConstitutionalMesh. - Trust-matrix projection and composition through
GovernanceManifold. - Supporting artifact, capability, contract, compiler, and benchmark primitives.
Testing
python -m pytest packages/constitutional_swarm/tests/ -v --import-mode=importlib
python -m pytest packages/constitutional_swarm/tests/ -m "not slow" -v --import-mode=importlib
License
AGPL-3.0-or-later. Commercial licensing is available; contact hello@acgs.ai.
Links
Constitutional Hash: 608508a9bd224290
Metadata
Release files for constitutional-swarm 0.1.1
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-0.1.1.tar.gz | 167.0 kB | Without provenance | Details for constitutional_swarm-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| constitutional_swarm-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for constitutional_swarm-0.1.1-py3-none-any.whl |
Total release size: 282.3 kB
Release files / constitutional_swarm-0.1.1.tar.gz
| Download URL | constitutional_swarm-0.1.1.tar.gz |
|---|---|
| Size | 167.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c23e2a3d8e736150763b726c1c3d4dba7e0929d1c7d0ee0a31495e55991352df
|
|
BLAKE2b-256 checksum How to use checksums |
e6e144ad427c18c6f700db0ed3346a0f222b1dcca3d20c2f88aeeba11eb23028
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / constitutional_swarm-0.1.1-py3-none-any.whl
| Download URL | constitutional_swarm-0.1.1-py3-none-any.whl |
|---|---|
| Size | 115.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b87e3cae65cf4b8c025d7e93dc9371d561673676267c65397ded1a9e06315ed
|
|
BLAKE2b-256 checksum How to use checksums |
c56ddef01bad1635a8cc8e2671ba62c9515fa43a70837cbc5418f691dc77a20e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for constitutional-swarm 0.1.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.