Simplified wrapper for Google's A2A Protocol SDK
Project description
A2A Lite 🚀
Build A2A agents in 8 lines. Add enterprise features when you need them.
Wraps the official A2A SDKs (Python, TypeScript, Java) with a simple, intuitive API.
| Python | TypeScript | Java |
|---|---|---|
from a2a_lite import Agent
agent = Agent(
name="Bot",
description="My bot"
)
@agent.skill("greet")
async def greet(name: str):
return f"Hello, {name}!"
agent.run()
|
import { Agent } from 'a2a-lite';
const agent = new Agent({
name: 'Bot',
description: 'My bot'
});
agent.skill('greet', async ({ name }) =>
`Hello, ${name}!`
);
agent.run();
|
var agent = Agent.builder()
.name("Bot")
.description("My bot")
.build();
agent.skill("greet", params ->
"Hello, " + params.get("name") + "!"
);
agent.run();
|
That's it. You have a running A2A agent.
Installation
Python
pip install a2a-lite
TypeScript
npm install a2a-lite
# or
yarn add a2a-lite
Java (Gradle)
dependencies {
implementation 'com.a2alite:a2a-lite:0.1.0'
implementation 'io.javalin:javalin:5.6.3' // For standalone mode
}
Java (Maven)
<dependency>
<groupId>com.a2alite</groupId>
<artifactId>a2a-lite</artifactId>
<version>0.1.0</version>
</dependency>
The Philosophy
| Need | A2A Lite |
|---|---|
| Hello World | 8 lines |
| Testing | 3 lines |
| Pydantic models | Just works |
| Auth | Add when needed |
| Files | Add when needed |
| Human-in-the-loop | Add when needed |
| Task tracking | Add when needed |
Everything is optional except the basics.
Progressive Complexity
Level 1: Just Works (No Setup)
from a2a_lite import Agent
agent = Agent(name="Bot", description="A bot")
@agent.skill("greet")
async def greet(name: str) -> str:
return f"Hello, {name}!"
agent.run()
Level 2: Use Pydantic (Just Works)
from pydantic import BaseModel
class User(BaseModel):
name: str
email: str
@agent.skill("create_user")
async def create_user(user: User) -> dict:
# 'user' is already a User instance - auto-converted!
return {"id": 1, "name": user.name}
Level 3: Stream Responses (Just Yield)
@agent.skill("chat", streaming=True)
async def chat(message: str):
for word in message.split():
yield word + " "
Level 4: Add Middleware (When Needed)
@agent.middleware
async def log_requests(ctx, next):
print(f"Calling: {ctx.skill}")
return await next()
Level 5: Human-in-the-Loop (When Needed)
from a2a_lite import InteractionContext
@agent.skill("wizard")
async def wizard(ctx: InteractionContext) -> dict:
name = await ctx.ask("What's your name?")
role = await ctx.ask("Role?", options=["Dev", "Manager"])
if await ctx.confirm(f"Create {name} as {role}?"):
return {"created": name}
return {"cancelled": True}
Level 6: Handle Files (When Needed)
from a2a_lite import FilePart
@agent.skill("summarize")
async def summarize(doc: FilePart) -> str:
content = await doc.read_text()
return f"Summary: {content[:100]}..."
Level 7: Track Task Progress (When Needed)
from a2a_lite import TaskContext
agent = Agent(name="Bot", task_store="memory")
@agent.skill("process")
async def process(data: str, task: TaskContext) -> str:
await task.update("working", "Starting...", progress=0.0)
for i in range(10):
await task.update("working", f"Step {i}/10", progress=i/10)
return "Done!"
Level 8: Add Authentication (When Needed)
from a2a_lite import Agent, APIKeyAuth
agent = Agent(
name="SecureBot",
auth=APIKeyAuth(keys=["secret-key"]),
)
Testing (3 Lines)
| Python | TypeScript | Java |
|---|---|---|
from a2a_lite import TestClient
client = TestClient(agent)
assert client.call("greet", name="World") == "Hello, World!"
|
import { TestClient } from 'a2a-lite';
const client = new TestClient(agent);
expect(await client.call('greet', { name: 'World' })).toBe('Hello, World!');
|
var client = new TestClient(agent);
assertThat(client.call("greet", Map.of("name", "World")))
.isEqualTo("Hello, World!");
|
CLI
a2a-lite init my-agent # Create new project
a2a-lite inspect http://... # View agent capabilities
a2a-lite test http://... skill # Test a skill
a2a-lite discover # Find local agents
Full Feature List
| Feature | Import | Complexity |
|---|---|---|
| Basic skills | Agent |
Just works |
| Pydantic models | BaseModel |
Just works |
| Streaming | streaming=True |
Just works |
| Testing | TestClient |
Just works |
| Middleware | @agent.middleware |
Add when needed |
| Webhooks | @agent.on_complete |
Add when needed |
| Human-in-the-loop | InteractionContext |
Add when needed |
| Conversation memory | ConversationMemory |
Add when needed |
| File handling | FilePart |
Add when needed |
| Structured data | DataPart |
Add when needed |
| Rich outputs | Artifact |
Add when needed |
| Task tracking | TaskContext |
Add when needed |
| API Key auth | APIKeyAuth |
Add when needed |
| Bearer/JWT auth | BearerAuth |
Add when needed |
| Multiple auth | CompositeAuth |
Add when needed |
Examples
| Example | What it shows |
|---|---|
| 01_hello_world.py | Simplest agent (8 lines) |
| 02_calculator.py | Multiple skills |
| 06_pydantic_models.py | Auto Pydantic conversion |
| 08_streaming.py | Streaming responses |
| 09_testing.py | Testing your agents |
| 11_human_in_the_loop.py | Ask user questions |
| 12_file_handling.py | Handle files |
| 13_task_tracking.py | Progress updates |
| 14_with_auth.py | Authentication |
For AI Coding Assistants
See AGENT.md for a quick reference guide optimized for AI coding assistants implementing A2A agents.
100% A2A Protocol Compatible
A2A Lite wraps the official A2A SDKs. Every feature maps to real A2A protocol concepts:
| A2A Lite | A2A Protocol |
|---|---|
@agent.skill() / agent.skill() |
Agent Skills |
streaming=True / SkillConfig.withStreaming() |
SSE Streaming |
InteractionContext.ask() |
input-required state |
TaskContext.update() |
Task lifecycle states |
FilePart |
A2A File parts |
APIKeyAuth / BearerAuth |
Security schemes |
Language-Specific Documentation
| Language | Package | Documentation |
|---|---|---|
| Python | a2a-lite |
packages/python/README.md |
| TypeScript | a2a-lite |
packages/typescript/README.md |
| Java | com.a2alite:a2a-lite |
packages/java/README.md |
License
Apache 2.0
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 a2a_lite-0.1.0.tar.gz.
File metadata
- Download URL: a2a_lite-0.1.0.tar.gz
- Upload date:
- Size: 45.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59c8580963562a5386131bb9e6726db19fb989d2d19047b4c7bbbe0f8931bd6b
|
|
| MD5 |
6a2f68be63830e26a2bae3c28fc91e75
|
|
| BLAKE2b-256 |
012af922c17c6e2eda1cdc122046df5bf1671520099e97a77a292a3a1d161e8f
|
File details
Details for the file a2a_lite-0.1.0-py3-none-any.whl.
File metadata
- Download URL: a2a_lite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83965541ea3f2df5bb48b248691e3b37fcebf40b1496b00c4450f74b6f3502bf
|
|
| MD5 |
238ef33c8d32e317d171c1808cfa128f
|
|
| BLAKE2b-256 |
0c9d23073af211235a6f1d4e411ffd90446bf61096a4cee4830042fe5c2aeb1a
|