Skip to main content

A library for building A2A agents with routing capabilities

Project description

A2A Agent Library

A Python library for building A2A (Agent-to-Agent) agents with routing capabilities, DynamoDB-backed registry, and LangChain integration.

Features

  • StatusAgent: Base agent implementation with status tracking and structured responses
  • RoutingAgentExecutor: Agent executor with intelligent routing capabilities
  • DynamoDB Registry: Dynamic agent card registry with heartbeat mechanism
  • Server Utilities: FastAPI application builder with A2A protocol support
  • LangChain Integration: Built on LangChain for flexible model integration

Installation

pip install distributed-a2a

Quick Start

from distributed_a2a import load_app
from a2a.types import AgentSkill

# Define your agent's skills
skills = [
    AgentSkill(
        id='example_skill',
        name='Example Skill',
        description='An example skill',
        tags=['example']
    )
]

# Create your agent application
app = load_app(
    name="MyAgent",
    description="My specialized agent",
    skills=skills,
    api_key="your-api-key",
    system_prompt="You are a helpful assistant...",
    host="http://localhost:8000"
)

Components

StatusAgent

A base agent class that provides status tracking and structured responses:

from distributed_a2a import StatusAgent, StringResponse

agent = StatusAgent[StringResponse](
    system_prompt="Your system prompt",
    name="AgentName",
    api_key="your-api-key",
    is_routing=False,
    tools=[]
)

response = await agent("User message", context_id="context-123")

RoutingAgentExecutor

An executor that can handle requests directly or route them to specialized agents:

from distributed_a2a import RoutingAgentExecutor

executor = RoutingAgentExecutor(
    api_key="your-api-key",
    system_prompt="Your system prompt",
    routing_tool=routing_tool
)

DynamoDB Registry

Dynamic agent registry with automatic heartbeat and expiration:

from distributed_a2a import DynamoDbRegistryLookup

registry = DynamoDbRegistryLookup(agent_card_tabel="agent-cards")
tool = registry.as_tool()

Requirements

  • Python 3.10+
  • langchain
  • langchain-core
  • langchain-openai
  • langgraph
  • pydantic
  • boto3
  • a2a

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Release history Release notifications | RSS feed

This version

0.1.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

distributed_a2a-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

distributed_a2a-0.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file distributed_a2a-0.1.1.tar.gz.

File metadata

  • Download URL: distributed_a2a-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for distributed_a2a-0.1.1.tar.gz
Algorithm Hash digest
SHA256 33d86e83bd708f2e3562f42f46b9c83f79df79d65540da86c5006683548ecdb6
MD5 85075f9adf907c5953a9e12b2975f0d8
BLAKE2b-256 9bcb7b889ea788d89700a66fe8663617ef012fc5acbc4d281aa2bb5234e1f36e

See more details on using hashes here.

File details

Details for the file distributed_a2a-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for distributed_a2a-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e6f95d9c483f3597efda80cd60accbcc631b331fdc7a75c43f5f525cb74ec73
MD5 9d34326df066f030e3e15dad65e56569
BLAKE2b-256 bd63b148fd33f2108e8068f739021dbcaa5528828509f5d3b5cf106572d309f8

See more details on using hashes here.

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