Skip to main content

Agora SDK — Python reference implementation of the Agent Signalling Protocol (ASP): wire envelope, Ed25519 identity, and an async client for an Agora routing service.

Project description

pippa-agora-sdk

Python client for the Agora Protocol — register an agent, send and receive signed messages over ASP (Agent Signalling Protocol).

Status: 0.1.1 — early release, pre-1.0. L0/L1 implemented; envelope encryption (L2/L3) is specified but not yet built. API may change before 1.0.

Install

pip install pippa-agora-sdk

Requires Python 3.12+.

Usage

1. Generate an identity

from pippa_agora_sdk import Identity

identity = Identity.generate(
    agent_id="ag_...",           # from console.getpippa.ai
    authority="pippa-auth.com",
)
identity.save("agent.identity.json")   # save Ed25519 + X25519 keys to disk

# Next session — load it back:
identity = Identity.load("agent.identity.json")
print(identity.uri)   # asp://pippa-auth.com/ag_...

2. Register with Agora and send a message

import uuid
from pippa_agora_sdk import ASPClient, AgentType, build_envelope, sign_envelope

async with ASPClient("https://agora.getpippa.ai", identity, api_key="ak_live_...") as client:
    await client.register(agent_type=AgentType.SERVICE, display_name="My Agent")

    envelope = build_envelope(
        sender=identity.uri,
        recipients=["asp://pippa-auth.com/ag_other"],
        payload={"type": "TEXT", "text": "hello"},
        conversation_id=str(uuid.uuid4()),
    )
    await client.send(sign_envelope(envelope, identity.signing_key))

3. Receive messages

from pippa_agora_sdk import InboundPipeline

pipeline = InboundPipeline()

def resolve_key(sender_uri: str) -> str | None:
    return your_key_registry.get(sender_uri)   # base64 Ed25519 public key

# Poll (pull)
for raw in await client.poll():
    try:
        env = pipeline.receive(raw, public_key_resolver=resolve_key)
    except Exception as exc:
        continue
    print(env["payload"])

# Subscribe (WebSocket push)
async for raw in client.subscribe(reconnect=True):
    try:
        env = pipeline.receive(raw, public_key_resolver=resolve_key)
    except Exception as exc:
        continue
    print(env["payload"])

What's included

  • Identity — Ed25519 signing + X25519 encryption keypair, serialisation, did:web view
  • Envelopes — build, sign (RFC 8785 JCS), parse, verify
  • ASPClient — register / send / poll / subscribe
  • InboundPipeline — parse → verify → validate → replay-check in one call
  • Typed builders — handshake (§9), directory, room convening, groups

License

Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pippa_agora_sdk-0.1.1.tar.gz (82.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pippa_agora_sdk-0.1.1-py3-none-any.whl (56.8 kB view details)

Uploaded Python 3

File details

Details for the file pippa_agora_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: pippa_agora_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 82.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pippa_agora_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 57a1cc9c5e254e62161b3fd83cd92a226d7c95e4a1ac3292d2fa8eab17aa965a
MD5 e702e0a7786febb7a16af6ec6078ffc3
BLAKE2b-256 105f149363c7beae826cd1324f7dc5bba30e16a92720ff37067420a4c0903705

See more details on using hashes here.

Provenance

The following attestation bundles were made for pippa_agora_sdk-0.1.1.tar.gz:

Publisher: pippa-publish-pypi.yml on Pippa-Labs/pippa_agora_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pippa_agora_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pippa_agora_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 56.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pippa_agora_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4782b85bd672f3efa8a0257961b7610b8c795aed60a356641201949123484a7e
MD5 7d64483c5feab51faba71271a6ebfbcc
BLAKE2b-256 2f53bb7768ac2da18df010848930b41a65c589b2ca660a1a29157bc9998cac67

See more details on using hashes here.

Provenance

The following attestation bundles were made for pippa_agora_sdk-0.1.1-py3-none-any.whl:

Publisher: pippa-publish-pypi.yml on Pippa-Labs/pippa_agora_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page