Skip to content

API Reference

Complete API documentation for the SWARM framework.

Modules

  • :material-cube-outline: Core


    Core components: ProxyComputer, SoftPayoffEngine, SoftInteraction

  • :material-robot: Agents


    Agent implementations: BaseAgent, HonestAgent, DeceptiveAgent, role definitions

  • :material-gavel: Governance


    Governance levers: taxes, circuit breakers, reputation, audits, collusion detection

  • :material-chart-line: Metrics


    Soft metrics: toxicity, quality gap, conditional loss, reporters

Module Key Classes
swarm.core.proxy ProxyComputer, ProxyConfig
swarm.core.payoff SoftPayoffEngine, PayoffConfig
swarm.models.interaction SoftInteraction
swarm.agents.base BaseAgent
swarm.governance.engine GovernanceEngine, GovernanceConfig
swarm.metrics.soft_metrics SoftMetrics

Usage Example

from swarm.core.proxy import ProxyComputer, ProxyConfig
from swarm.core.payoff import SoftPayoffEngine, PayoffConfig
from swarm.governance.engine import GovernanceEngine, GovernanceConfig

# Initialize components
proxy = ProxyComputer(ProxyConfig())
payoff = SoftPayoffEngine(PayoffConfig())
governance = GovernanceEngine(GovernanceConfig(
    transaction_tax_rate=0.02,
    circuit_breaker_enabled=True,
))