Tair-backed storage for the Agent2Agent Python SDK.
pip install a2a-tairRequires Python 3.10+, a2a-sdk>=1.1.2,<2, and a Redis protocol-compatible Tair endpoint.
| Component | Backend | A2A interface |
|---|---|---|
TaskRepository |
Tair Hash | TaskStore |
JsonTaskRepository |
TairJSON | TaskStore |
NotificationRegistry |
Tair Hash | PushNotificationConfigStore |
Task repositories live in a2a_tair.tasks; notification registration lives in
a2a_tair.notifications. The previous names HashTaskStorage, JsonTaskStorage
and PushConfigStorage remain compatibility aliases at the package root and in
a2a_tair.storage. Existing data and constructor arguments are unchanged.
import os
from a2a.server.request_handlers import DefaultRequestHandler
from a2a_tair import NotificationRegistry, TaskRepository, connect
client = connect(os.environ["TAIR_URL"])
request_handler = DefaultRequestHandler(
agent_executor=agent_executor,
agent_card=agent_card,
task_store=TaskRepository(client),
push_config_store=NotificationRegistry(client),
)Use JsonTaskRepository(client) when the endpoint supports TairJSON. Close the client during application shutdown:
await client.aclose()The stores follow the A2A SDK's owner scope, filtering, sorting, and page-token pagination. Unauthenticated requests share the default empty owner scope; use authentication or a custom owner_resolver for tenant isolation. The default key prefix is a2a:tair:. connect() uses binary responses because Task and Push configuration values contain Protobuf data.
The wheel includes an optional Google ADK Demo using an OpenAI-compatible model API:
uvx --from "a2a-tair[demo]" a2a-tair-demo server --skill-dir ./alibabacloud-tair-devtoolsetIn another terminal:
uvx --from "a2a-tair[demo]" a2a-tair-demo clientSee examples/tair_guide_agent/README.md in the source repository for Skill download and environment configuration.
uv sync --all-groups --extra demo
uv run ruff check .
uv run ruff format --check .
uv run ty check src tests
uv run pytest -q -W error
uv buildSet TEST_REDIS_URL for the Redis protocol smoke test, TAIR_URL for the Tair smoke test, and TAIR_JSON_URL for the TairJSON smoke test.