Skip to content

Quickstart ​

Install the reference SDK and run two coordinating agents.

Alpha

The Python SDK is in development and not yet on PyPI. Install the verified 0.1.0 release candidate below; advanced APIs may still change.

Prerequisites ​

  • Python 3.10+

Install ​

bash
pip install "signal-gating @ git+https://github.com/signalgatingprotocol/python-sdk@1ec109a73a5db9905cb57a2527eeca822156f875"

The commit pin makes the first run reproducible. Run the deterministic incident-triage proof from any directory:

bash
signal-gating-demo

The fixed 12-alert fixture admits 3 alerts, reducing handler load by 75% while preserving all 3 unique critical incidents. A result=PASS means the fixture's exact invariant held; it is not a throughput, token, latency, or cost benchmark.

Run two coordinating agents ​

A planner emits tasks; a gate on the worker lets only the high-priority ones through:

python
import asyncio
from signal_gating.core import Agent, Gate, Mesh, Signal

class TaskSignal(Signal):
    task: str

planner = Agent("planner")
worker = Agent("worker", gates=[Gate.by_priority(3)])  # only high-priority tasks reach it

@worker.on(TaskSignal)
async def handle(signal: TaskSignal):
    print(f"working on: {signal.task}")

mesh = Mesh([planner, worker])
mesh.connect(planner, worker)

async def main():
    async with mesh:
        await planner.emit(TaskSignal(task="build feature", priority=5))
        await planner.emit(TaskSignal(task="minor cleanup", priority=1))  # gated out
        await mesh.wait_idle()

asyncio.run(main())

What's happening ​

  • Gate.by_priority(3) suppresses the low-priority task before it ever reaches the worker.
  • @worker.on(TaskSignal) registers a typed handler; the worker reacts only to the signals it cares about.
  • mesh.connect(planner, worker) wires the topology; the mesh routes signals along it.

Next steps ​

  • Read Core Concepts for the Signal / Gate / Agent / Mesh model.
  • Browse the SDKs for the full primitive surface.
  • See the Specification for the formal protocol definition.

Released under open governance.