Skip to main content

Ada SDK for Python

AdaClient represents one authenticated namespace. Its cached principal facades share one gRPC channel and one lazy, persistent namespace stream for events, signals, and jobs.

Installation

python -m pip install ada-grpc-sdk

Python 3.10 or newer is required. Construct the namespace client only in trusted backend code; api_key or api_key_provider authenticates the whole namespace.

Backend client

import os

from ada_sdk import AdaClient, StreamConfig, SubscriptionOptions

with AdaClient(
    "memory.example.com:443",
    api_key=os.environ["ADA_API_KEY"],
    streams=StreamConfig(
        events=SubscriptionOptions(
            after_event_id=saved_event_cursor,
            replay_limit=100,
        ),
        signals=SubscriptionOptions(after_event_id=saved_signal_cursor),
        jobs=SubscriptionOptions(after_event_id=saved_job_cursor),
    ),
) as ada:
    alice = ada.principal("alice")
    bob = ada.principal("bob")

    stop_alice = alice.events.on(
        "memory.ingest.finished",
        lambda event: print(event.document_id),
    )
    stop_bob = bob.signals.on(
        "routine.broken",
        lambda signal: print(signal),
    )
    stop_job = alice.jobs.on(
        "job.finished",
        lambda event: print(event),
    )

    stop_alice()
    stop_alice()
    stop_bob()
    stop_job()

Every event-name overload selects an exact generated protobuf payload type and returns an idempotent synchronous unsubscribe callable. Strict mypy fixtures reject unknown event names, mismatched payloads, open(), root data-plane calls, and principal creation on a browser client.

All ingest, recall, document, job, data, and summary operations live on the principal facade:

result = alice.ingest(ingest_pb2.IngestRequest(document=document))
status = alice.documents.get_status(
    ingest_pb2.GetDocumentStatusRequest(document_id=document_id),
)

The facade overwrites every request principal. Public-event and signal catalogs remain on the root through get_public_event_catalog() and get_signal_catalog().

Replay cursors, reconnect policy, lifecycle handlers, and shutdown live on the root:

stop_cursor = ada.lifecycle.on(
    "stream.cursor",
    lambda info: save_cursor(
        info.stream,
        info.event_id,
        info.principal_id,
    ),
)
stop_terminal = ada.lifecycle.on(
    "stream.terminal",
    lambda info: report_failure(info.stream, info.error),
)

close() and the context manager perform idempotent graceful shutdown and prevent later registrations.

AdaBrowserClient(endpoint, session_token=...) is a separate principal-bound client. It accepts no namespace API key and has no principal() method. Use it only with a short-lived browser session minted by a trusted backend.

Never embed a namespace API key in browser or otherwise untrusted client code. The TypeScript package is the supported browser/gRPC-Web implementation.

Metadata

Release files for ada-grpc-sdk 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ada-grpc-sdk 0.0.1
File Size Uploaded Provenance
ada_grpc_sdk-0.0.1.tar.gz 81.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ada-grpc-sdk 0.0.1
File Interpreter ABI Platform
ada_grpc_sdk-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 172.5 kB

Release files / ada_grpc_sdk-0.0.1.tar.gz

Download URL ada_grpc_sdk-0.0.1.tar.gz
Size 81.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8a8d0218d37581035ae1de1d37b1834e4d64b0bcb692bc80aa6ac7772bde44c4
BLAKE2b-256 checksum
How to use checksums
5fc4452809387a96c467bad84805c64a8d8048da4c2b4a682f0a12bbcc1b5554
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Release files / ada_grpc_sdk-0.0.1-py3-none-any.whl

Download URL ada_grpc_sdk-0.0.1-py3-none-any.whl
Size 91.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8297e75759a31154b5ae9b414f35bb644d90b3a2b7e03cf39e93abf7dbb7700d
BLAKE2b-256 checksum
How to use checksums
303df5d9aa5632f7f6be53c6d1704dcba8108e97becc1f544e996f42136045b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Security for ada-grpc-sdk 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page