Skip to main content

A2A agent framework in one import.

Project description

a2akit

PyPI License: MIT Python CI

A2A agent framework in one import.

Build Agent-to-Agent (A2A) protocol agents with minimal boilerplate. Streaming, cancellation, multi-turn conversations, and artifact handling — batteries included.

Install

pip install a2akit

With optional extras:

pip install a2akit[langgraph]   # LangGraph integration
pip install a2akit[otel]        # OpenTelemetry tracing & metrics

Quick Start

from a2akit import A2AServer, AgentCardConfig, TaskContext, Worker


class EchoWorker(Worker):
    async def handle(self, ctx: TaskContext) -> None:
        await ctx.complete(f"Echo: {ctx.user_text}")


server = A2AServer(
    worker=EchoWorker(),
    agent_card=AgentCardConfig(
        name="Echo Agent",
        description="Echoes your input back.",
        version="0.1.0",
    ),
)
app = server.as_fastapi_app()
uvicorn my_agent:app --reload

Client

from a2akit import A2AClient

async with A2AClient("http://localhost:8000") as client:
    result = await client.send("Hello, agent!")
    print(result.text)

    async for chunk in client.stream_text("Stream me"):
        print(chunk, end="")

Debug UI

Enable the built-in debug interface to test your agent in the browser:

app = server.as_fastapi_app(debug=True)

Open http://localhost:8000/chat — chat with your agent and inspect tasks in real time.

Debug UI

Features

  • Debug UI — built-in browser interface for chat + task inspection (debug=True)
  • One-liner setupA2AServer wires storage, broker, event bus, and endpoints
  • A2AClient — auto-discovers agents, supports send/stream/cancel/subscribe
  • Capabilities — explicit opt-in for streaming and state transition history, enforced on server and client
  • Streaming — word-by-word artifact streaming via SSE
  • Cancellation — cooperative and force-cancel with timeout fallback
  • Multi-turnrequest_input() / request_auth() for conversational flows
  • Direct replyreply_directly() for simple request/response without task tracking
  • Middleware — pipeline for auth extraction, header injection, payload sanitization
  • Lifecycle hooks — fire-and-forget callbacks on terminal state transitions
  • Dependency injection — shared infrastructure with automatic lifecycle management
  • OpenTelemetry — opt-in distributed tracing and metrics (pip install a2akit[otel])
  • Pluggable backends — PostgreSQL, SQLite, and more (Redis, RabbitMQ coming soon)
  • Type-safe — full type hints, py.typed marker, PEP 561 compliant

📖 Full Documentation

Links

License

MIT

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

a2akit-0.0.10.tar.gz (500.4 kB view details)

Uploaded Source

Built Distribution

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

a2akit-0.0.10-py3-none-any.whl (150.4 kB view details)

Uploaded Python 3

File details

Details for the file a2akit-0.0.10.tar.gz.

File metadata

  • Download URL: a2akit-0.0.10.tar.gz
  • Upload date:
  • Size: 500.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for a2akit-0.0.10.tar.gz
Algorithm Hash digest
SHA256 e4230713550e15c0fe2cc83b4894ecf168e7c8de1aa84fac712e08ecc0db1eb6
MD5 c78f55e7815d86f959ffda2766b14131
BLAKE2b-256 392fc5aa4bde75972f2ee9d4b58d19ca152246be82b9d81ade7a4ee515ba68a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2akit-0.0.10.tar.gz:

Publisher: publish.yml on Coding-Crashkurse/a2a-kit

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

File details

Details for the file a2akit-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: a2akit-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 150.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for a2akit-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 e820ae4f1cb3374addae88208cfbdaebde73b68117b99914cb0dda2a009e7429
MD5 ac2c0ff0aec42864b5c927611cbc622e
BLAKE2b-256 a04919e2671dfb0feccf02bfcbbd745b466c52902b69e7076fb485e93098cc98

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2akit-0.0.10-py3-none-any.whl:

Publisher: publish.yml on Coding-Crashkurse/a2a-kit

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