SDKs
Reference implementations for building with the Signal Gating Protocol.
Alpha
The Python SDK is the source of truth, but it is alpha and not yet on PyPI. The stable core is compatibility-focused for the 0.1.x line; advanced APIs may still change.
Python
bash
pip install "signal-gating @ git+https://github.com/signalgatingprotocol/python-sdk@b6bd41e729716c6589eabe8cd8292349bbdadfdb"The pin is the verified 0.1.0 release candidate. After installation, signal-gating-demo runs the deterministic 12-alert proof described in the Quickstart.
python
import asyncio
from signal_gating.core import Agent, Gate, Mesh, Signal
class TaskSignal(Signal):
task: str
# Two agents; the worker only sees high-priority tasks.
planner = Agent("planner")
worker = Agent("worker", gates=[Gate.by_priority(3)])
@worker.on(TaskSignal)
async def handle(signal: TaskSignal):
print(f"working on: {signal.task}")
# Wire them into a mesh.
mesh = Mesh([planner, worker])
mesh.connect(planner, worker)
async def main():
async with mesh:
await planner.emit(TaskSignal(task="build feature", priority=5))
await mesh.wait_idle()
asyncio.run(main())Building blocks
- Define signals: subclass
Signalfor each event type in your domain. - Compose gates: control what each agent sees with
Gate.by_priority,deduplicate,ttl, and friends, chained with>>. - Write agents: handle signals with
@agent.on(...);emit,reply, andrequestbetween them. - Connect a mesh: wire agents with
connect, then coordinate withscatter,map_reduce,workflow, andrace.
More SDKs
Additional language SDKs are planned. Watch the GitHub organization for announcements.