Skip to content

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-sdk
python
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())

View on GitHub

Building blocks

  1. Define signals: subclass Signal for each event type in your domain.
  2. Compose gates: control what each agent sees with Gate.by_priority, deduplicate, ttl, and friends, chained with >>.
  3. Write agents: handle signals with @agent.on(...); emit, reply, and request between them.
  4. Connect a mesh: wire agents with connect, then coordinate with scatter, map_reduce, workflow, and race.

More SDKs

Additional language SDKs are planned. Watch the GitHub organization for announcements.

Released under open governance.