A2A — Agent-to-Agent Protocol¶
Open protocol from Google → Linux Foundation. Treats Tasks as first-class objects and observes them via Server-Sent Events.
Agent Card¶
Python
from apogee_ai_comunication import AgentCard, AgentSkill
card = AgentCard(
name="billing-agent",
description="Issues invoices",
protocols=("a2a",),
capabilities=(AgentSkill(name="invoice"),),
)
Native server¶
Python
from apogee_ai_comunication import NativeA2aServer, ServerConfig
server = NativeA2aServer(ServerConfig(), card)
await server.run()
Native client¶
Python
from apogee_ai_comunication import (
AgentMessage, ClientConfig, MessagePart, MessageRole, NativeA2aClient,
)
client = NativeA2aClient(ClientConfig(base_url="memory://"), server)
msg = AgentMessage(role=MessageRole.USER, parts=(MessagePart(kind="text", text="bill #1"),))
task = await client.send_task(msg)
async for update in client.watch_task(task.task_id):
print(update.task_id, update.state.value)