Skip to main content

synadia-ai-agent-service

Python agent-host SDK for the Synadia Agent Protocol for NATS. Embed AgentService in a Python agent harness (Hermes-style, claude-code, openclaw, pi, …) to register a spec-compliant agent on a NATS bus.

Calling agents (rather than hosting them)? → use the sibling synadia-ai-agents package (from synadia_ai.agents import Agents, …). This package depends on it for the shared wire primitives.

Install

From a checkout (no published wheel yet):

uv pip install -e ../../client-sdk/python
uv pip install -e .

When both packages are on PyPI, plain pip install synadia-ai-agent-service will pull synadia-ai-agents>=0.6 automatically.

Quickstart — host an agent

import asyncio
import nats
from synadia_ai.agents import Envelope                       # shared wire types
from synadia_ai.agent_service import AgentService, PromptStream

async def echo(envelope: Envelope, stream: PromptStream) -> None:
    await stream.send(f"echo: {envelope.prompt}")

async def main() -> None:
    nc = await nats.connect(servers="nats://127.0.0.1:4222")
    service = AgentService(
        agent="demo",            # your harness identifier (§2: lowercase + hyphens)
        owner="alice",           # operator / account (§2)
        session_name="worker-1", # 5th subject token / session this instance serves
        nc=nc,
        description="demo echo agent",
    )
    service.on_prompt(echo)
    await service.start()
    try:
        await asyncio.Event().wait()   # run until Ctrl-C
    finally:
        await service.stop()
        await nc.close()

asyncio.run(main())

A spec-compliant runnable echo agent ships at examples/_reference_agent.py — used both as the test harness for the client-side numbered demos in ../../client-sdk/python/examples/ and as the wire-compat counterparty for cross-SDK interop.

Where things live

  • This package — synadia_ai.agent_service: AgentService, PromptStream, PromptHandler, the heartbeat publisher loop, the status endpoint handler, and the reference agent.
  • Sibling package — synadia_ai.agents (the client SDK): the shared wire primitives (Envelope, Attachment, HeartbeatPayload, AgentSubject, error classes, discovery constants, load_context_options, parse_nats_url).

Documentation

Development

uv sync
uv run ruff check . && uv run ruff format --check . && uv run mypy src tests examples && uv run pytest

Integration tests spawn a real nats-server per session and record wire evidence under tests/_evidence/<test-nodeid>/. The local [tool.uv.sources] override resolves synadia-ai-agents to the sibling client-sdk checkout, so no PyPI publish is required for CI to pass.

License

Apache-2.0. See LICENSE.

Release files for synadia-ai-agent-service 0.4.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 synadia-ai-agent-service 0.4.1
File Size Uploaded
synadia_ai_agent_service-0.4.1.tar.gz 85.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for synadia-ai-agent-service 0.4.1
File Interpreter ABI Platform
synadia_ai_agent_service-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 106.1 kB

Release files / synadia_ai_agent_service-0.4.1.tar.gz

Download URL synadia_ai_agent_service-0.4.1.tar.gz
Size 85.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1562a89b26d8d1fb89f76b552dda950bce602ba8506c1aeef0e093e67ed96f9a
BLAKE2b-256 checksum
How to use checksums
6ceffe16db2dc1fa7d86c0d6cdc3f70ae1981eb73006077624e9bbd616210748
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Release files / synadia_ai_agent_service-0.4.1-py3-none-any.whl

Download URL synadia_ai_agent_service-0.4.1-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ad9c4d88866eb3fe34a3deea130618996b0fb2e5227114f9fa37998f8084bac
BLAKE2b-256 checksum
How to use checksums
165ea840c57d58e7fff402628680a6a115814675d76de1cf75b6e5db239a42d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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