Skip to content

Quickstart

Install the reference SDK and compose your first gated pipeline.

Alpha

The Python SDK is in development. The code below reflects the proposed surface and may shift as the API stabilizes.

Prerequisites

  • Python 3.10+

Install

bash
pip install signal-gating-protocol

Compose a pipeline

Signals flow through a Channel, pass through a Gate chain, and are consumed by your agent:

python
from sgp import Channel
from sgp.gates import Gate, filter, dedupe, throttle, batch

pipeline = Gate.chain(
    filter(lambda s: s.priority >= 3),
    dedupe(key=lambda s: s.payload["id"], ttl=30),
    throttle(rate=10, per="second"),
    batch(size=16, timeout=0.25),
)

async with Channel("sensor.events") as ch:
    async for group in ch.gated(pipeline):
        await handle(group)

What's happening

  • Channel("sensor.events") is an async transport with backpressure.
  • Gate.chain(...) composes predicates in sequence; each built-in gate admits or shapes signals before they reach the consumer.
  • ch.gated(pipeline) yields only the signals (or batches) that survive the full chain.

Next steps

  • Read Core Concepts for the Signal / Gate / Channel / Mesh model.
  • Browse the SDKs for language-specific guides.
  • See the Specification for the formal protocol definition.

Released under open governance.