A2A agent framework in one import.
Project description
a2akit
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[redis] # Redis broker, event bus & cancel registry
pip install a2akit[langgraph] # LangGraph integration
pip install a2akit[postgres] # PostgreSQL storage
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.
Features
- Debug UI — built-in browser interface for chat + task inspection (
debug=True) - One-liner setup —
A2AServerwires storage, broker, event bus, and endpoints - A2AClient — auto-discovers agents, supports send/stream/cancel/subscribe
- Capabilities — explicit opt-in for streaming, state transition history, and extensions, enforced on server and client
- Extensions — declare A2A protocol extensions on your agent card (
ExtensionConfig) - Streaming — word-by-word artifact streaming via SSE
- Cancellation — cooperative and force-cancel with timeout fallback
- Multi-turn —
request_input()/request_auth()for conversational flows - Direct reply —
reply_directly()for simple request/response without task tracking - Middleware — pipeline for auth extraction, header injection, payload sanitization
- Push notifications — webhook delivery for async task updates with SSRF prevention and configurable retries
- 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, Redis broker/event bus/cancel registry
- Type-safe — full type hints,
py.typedmarker, PEP 561 compliant
Links
License
MIT
Project details
Release history Release notifications | RSS feed
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 a2akit-0.0.19.tar.gz.
File metadata
- Download URL: a2akit-0.0.19.tar.gz
- Upload date:
- Size: 577.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fff2e547caf6b47dad33255559ec2dea3ae366829492ea996ec0ff5b169e2fd5
|
|
| MD5 |
ecb7593b78716652622cdd61e2725f98
|
|
| BLAKE2b-256 |
bc2a83cbef97ea596ee3e1280c1c199b85d252b55e068644fbd36f1e0a41551f
|
Provenance
The following attestation bundles were made for a2akit-0.0.19.tar.gz:
Publisher:
publish.yml on Coding-Crashkurse/a2a-kit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a2akit-0.0.19.tar.gz -
Subject digest:
fff2e547caf6b47dad33255559ec2dea3ae366829492ea996ec0ff5b169e2fd5 - Sigstore transparency entry: 1190677081
- Sigstore integration time:
-
Permalink:
Coding-Crashkurse/a2a-kit@106c358603fec1db48ce4848733ca8361425ebcc -
Branch / Tag:
refs/tags/v0.0.19 - Owner: https://github.com/Coding-Crashkurse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@106c358603fec1db48ce4848733ca8361425ebcc -
Trigger Event:
push
-
Statement type:
File details
Details for the file a2akit-0.0.19-py3-none-any.whl.
File metadata
- Download URL: a2akit-0.0.19-py3-none-any.whl
- Upload date:
- Size: 177.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16f507e79daa573804db9821ee5bf1dcee864a2212247d46a8f381c847a705f8
|
|
| MD5 |
f2efa714e96a2094bf2b432f9323c598
|
|
| BLAKE2b-256 |
3c0dcb78e9eeeecd42e172a5397e543f90e86a747787015504a228639f847e83
|
Provenance
The following attestation bundles were made for a2akit-0.0.19-py3-none-any.whl:
Publisher:
publish.yml on Coding-Crashkurse/a2a-kit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a2akit-0.0.19-py3-none-any.whl -
Subject digest:
16f507e79daa573804db9821ee5bf1dcee864a2212247d46a8f381c847a705f8 - Sigstore transparency entry: 1190677086
- Sigstore integration time:
-
Permalink:
Coding-Crashkurse/a2a-kit@106c358603fec1db48ce4848733ca8361425ebcc -
Branch / Tag:
refs/tags/v0.0.19 - Owner: https://github.com/Coding-Crashkurse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@106c358603fec1db48ce4848733ca8361425ebcc -
Trigger Event:
push
-
Statement type: