SDKs
Reference implementations for building with the Signal Gating Protocol.
Alpha
The Python SDK is the source of truth, but it is alpha: not yet on PyPI, and the API surface is still moving.
Python
bash
pip install git+https://github.com/signalgatingprotocol/python-sdkpython
import asyncio
from signal_gating import Signal, Gate, Agent, Mesh
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 asyncio.sleep(0.05)
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.