A2A Protocol Framework for AI Agents
Phlow is a pure Python framework for building A2A (Agent-to-Agent) Protocol compliant AI agents. It provides authentication, agent discovery, multi-agent communication, and Supabase integration with real AI capabilities via Gemini API.
Get Started{ .md-button .md-button--primary } View on GitHub{ .md-button }
What is Phlow?
Phlow is a complete A2A Protocol implementation that enables autonomous AI agents to discover and communicate with each other. It includes JWT authentication, agent card discovery, real AI integration via Gemini, and comprehensive testing infrastructure.
Simple Integration
import os
from fastapi import Depends, FastAPI
from phlow import AgentCard, PhlowConfig, PhlowContext, PhlowMiddleware
from phlow.integrations.fastapi import FastAPIPhlowAuth
app = FastAPI()
# Configure your A2A agent
config = PhlowConfig(
agent_card=AgentCard(
name="My Agent",
description="AI assistant agent",
service_url="https://my-agent.com",
skills=["chat", "analysis"],
metadata={"agent_id": "my-agent-id"}
),
private_key=os.getenv("PRIVATE_KEY"),
supabase_url=os.getenv("SUPABASE_URL"),
supabase_anon_key=os.getenv("SUPABASE_ANON_KEY")
)
middleware = PhlowMiddleware(config)
auth = FastAPIPhlowAuth(middleware)
auth.setup_agent_card_route(app) # adds /.well-known/agent.json
auth_required = auth.create_auth_dependency()
@app.post("/api/analyze")
async def analyze(ctx: PhlowContext = Depends(auth_required)):
return {"message": f"Hello {ctx.agent.name}"}
Key Features
๐ A2A Authentication - JWT token verification with RSA keys
๐ก๏ธ Role-Based Access Control - W3C Verifiable Credentials for fine-grained authorization
๐ค Agent Discovery - /.well-known/agent.json endpoint compliance
๐ค Multi-Agent Communication - Agent-to-Agent task delegation
๐ง AI-Ready - Framework designed for AI agent integration (examples include Gemini)
๐ Supabase Integration - Agent registry and audit logging
๐งช Testing Infrastructure - E2E tests with Docker auto-detection
Architecture
Getting Started
- Quick Start - Build your first A2A agent
- Installation - Setup guide
- Configuration - Environment variables
- RBAC Guide - Role-based access control
- Example Agent - Working code
Development
# See all tasks
uv run task --list
# Run tests
uv run task test-unit # Unit tests
uv run task test-e2e-multi # Multi-agent E2E tests
# Code quality
uv run task lint format type-check