Python agent-host SDK for the NATS Agent Protocol — register and serve spec-compliant agents over NATS
Project description
synadia-ai-agent-service
Python agent-host SDK for the NATS Agent Protocol.
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-agentspackage (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
- Root README — protocol overview and monorepo layout.
synadia-ai-agents— the client surface this package depends on.- NATS Agent Protocol spec — wire-level source of truth.
CHANGELOG.md— release notes.CLAUDE.md— project context and engineering conventions.
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synadia_ai_agent_service-0.2.0.tar.gz.
File metadata
- Download URL: synadia_ai_agent_service-0.2.0.tar.gz
- Upload date:
- Size: 80.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cdbcef7d1db38a4b92edec34838b9fe61c77227758626e684f70954542cde51
|
|
| MD5 |
a4db018dadf8dc40c6f9dfc8cbf50b71
|
|
| BLAKE2b-256 |
eaf8be84c99e38405dd166c9db13ce9d46001c0e5315d0f0a2f475114bf01001
|
Provenance
The following attestation bundles were made for synadia_ai_agent_service-0.2.0.tar.gz:
Publisher:
release-python-agent-service.yml on synadia-ai/synadia-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synadia_ai_agent_service-0.2.0.tar.gz -
Subject digest:
7cdbcef7d1db38a4b92edec34838b9fe61c77227758626e684f70954542cde51 - Sigstore transparency entry: 1436193066
- Sigstore integration time:
-
Permalink:
synadia-ai/synadia-agents@1ff46531779e6b070640cd64440ad5814d7aad80 -
Branch / Tag:
refs/tags/python-agent-service-v0.2.0 - Owner: https://github.com/synadia-ai
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python-agent-service.yml@1ff46531779e6b070640cd64440ad5814d7aad80 -
Trigger Event:
push
-
Statement type:
File details
Details for the file synadia_ai_agent_service-0.2.0-py3-none-any.whl.
File metadata
- Download URL: synadia_ai_agent_service-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b827b37e0219b1485d07f0d263ee343711f90b8ee8b4d7f5ab79211ff1d52ee2
|
|
| MD5 |
6e0b44c59fedaf27a130255765433492
|
|
| BLAKE2b-256 |
89abb6b1047013ada7cd3db80c5aac704dbc93070e25216c2d7ec38c44b29bd1
|
Provenance
The following attestation bundles were made for synadia_ai_agent_service-0.2.0-py3-none-any.whl:
Publisher:
release-python-agent-service.yml on synadia-ai/synadia-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synadia_ai_agent_service-0.2.0-py3-none-any.whl -
Subject digest:
b827b37e0219b1485d07f0d263ee343711f90b8ee8b4d7f5ab79211ff1d52ee2 - Sigstore transparency entry: 1436193079
- Sigstore integration time:
-
Permalink:
synadia-ai/synadia-agents@1ff46531779e6b070640cd64440ad5814d7aad80 -
Branch / Tag:
refs/tags/python-agent-service-v0.2.0 - Owner: https://github.com/synadia-ai
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python-agent-service.yml@1ff46531779e6b070640cd64440ad5814d7aad80 -
Trigger Event:
push
-
Statement type: