Adk
An Agent Development Kit (ADK) allowing for seamless creation of A2A-compatible agents written in Go
Install / Use
/learn @inference-gateway/AdkREADME
<p align="center"> <!-- CI Status Badge --> <a href="https://github.com/inference-gateway/adk/actions/workflows/ci.yml?query=branch%3Amain"> <img src="https://github.com/inference-gateway/adk/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI Status"/> </a> <!-- Release Workflow Badge --> <a href="https://github.com/inference-gateway/adk/actions/workflows/release.yml"> <img src="https://github.com/inference-gateway/adk/actions/workflows/release.yml/badge.svg" alt="Release"/> </a> <!-- Version Badge --> <a href="https://github.com/inference-gateway/adk/releases"> <img src="https://img.shields.io/github/v/release/inference-gateway/adk?color=blue&style=flat-square" alt="Version"/> </a> <!-- License Badge --> <a href="https://github.com/inference-gateway/adk/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/inference-gateway/adk?color=blue&style=flat-square" alt="License"/> </a> <!-- Go Version --> <img src="https://img.shields.io/github/go-mod/go-version/inference-gateway/adk?style=flat-square" alt="Go Version"/> <!-- Go Report Card --> <a href="https://goreportcard.com/report/github.com/inference-gateway/adk"> <img src="https://goreportcard.com/badge/github.com/inference-gateway/adk?style=flat-square" alt="Go Report Card"/> </a> </p>⚠️ Early Stage Warning: This project is in its early stages of development. Breaking changes are expected as the API evolves and improves. Please use pinned versions in production environments and be prepared to update your code when upgrading versions.
Table of Contents
- Overview
- 🚀 Quick Start
- ✨ Key Features
- 🛠️ Development
- 📖 API Reference
- 🔧 Advanced Usage
- 🌐 A2A Ecosystem
- 📋 Requirements
- 🐳 Docker Support
- 📄 License
- 🤝 Contributing
- 📞 Support
- 🔗 Resources
Overview
The A2A ADK (Agent Development Kit) is a Go library that simplifies building Agent-to-Agent (A2A) protocol compatible agents. A2A enables seamless communication between AI agents, allowing them to collaborate, delegate tasks, and share capabilities across different systems and providers.
What is A2A?
Agent-to-Agent (A2A) is a standardized protocol that enables AI agents to:
- Communicate with each other using a unified JSON-RPC interface
- Delegate tasks to specialized agents with specific capabilities
- Stream responses in real-time for better user experience
- Authenticate securely using OIDC/OAuth2
- Discover capabilities through standardized agent cards
🚀 Quick Start
Installation
go get github.com/inference-gateway/adk
Examples
For complete working examples, see the examples directory:
- Minimal - Basic A2A server without AI capabilities
- AI-Powered - Full A2A server with LLM integration
- AI-Powered Streaming - AI agent with streaming capabilities
- Callbacks - Lifecycle hooks for guardrails, caching, and logging
- Default Handlers - Built-in task processing
- Static Agent Card - JSON-based agent metadata management
- Streaming - Real-time streaming responses
- Input Required - Interactive conversation with input pausing
- Artifacts - MinIO - MinIO cloud storage with direct/proxy download modes
- Artifacts - Filesystem - Filesystem-based artifact storage
- Artifacts - Autonomous Tool - Autonomous tool for artifact creation
- Artifacts - Default Handlers - Artifacts with default handlers
- Queue Storage - Memory and Redis storage backends
- TLS Server - Secure HTTPS with TLS configuration
- Usage Metadata - Token usage and execution metrics tracking
Getting Started
To run any example:
cd examples/minimal/server
go run main.go
Each example includes its own README with setup instructions and usage details.
✨ Key Features
Core Capabilities
- 🤖 A2A Protocol Compliance: Full implementation of the Agent-to-Agent communication standard
- 🔌 Multi-Provider Support: Works with OpenAI, Ollama, Groq, Cohere, and other LLM providers
- 🌊 Real-time Streaming: Stream responses as they're generated from language models
- 🔧 Custom Tools: Easy integration of custom tools and capabilities
- 🪝 Callback Hooks: Lifecycle hooks for agent, model, and tool execution with flow control
- 📎 File Artifacts: Support for downloadable file artifacts with filesystem and MinIO storage backends
- 🔐 Secure Authentication: Built-in OIDC/OAuth2 authentication support
- 📨 Push Notifications: Webhook notifications for real-time task state updates
- ⏸️ Task Pausing: Built-in support for input-required state pausing and resumption
- 🗄️ Multiple Storage Backends: Support for in-memory and Redis storage with horizontal scaling
- 📊 Usage Metadata: Automatic tracking of LLM token consumption and execution metrics
Developer Experience
- ⚙️ Environment Configuration: Simple setup through environment variables
- 📊 Task Management: Built-in task queuing, polling, and lifecycle management
- 🏗️ Extensible Architecture: Pluggable components for custom business logic
- 📚 Type-Safe: Generated types from A2A schema for compile-time safety
- 🧪 Well Tested: Comprehensive test coverage with table-driven tests
Enterprise Ready
- 🌿 Lightweight: Optimized binary size for efficient deployment
- 🛡️ Production Hardened: Configurable timeouts, TLS support, and error handling
- ☸️ Cloud Native: Ready for cloud-native deployments and orchestration
- 📊 Observability: OpenTelemetry integration for monitoring and tracing
🛠️ Development
Quick Setup
# Clone the repository
git clone https://github.com/inference-gateway/adk.git
cd adk
# Install dependencies
go mod download
# Install pre-commit hook
task precommit:install
Essential Tasks
| Task | Description |
| -------------------------- | ----------------------------------------- |
| task a2a:download-schema | Download the latest A2A schema |
| task a2a:generate-types | Generate Go types from A2A schema |
| task lint | Run linting and code quality checks |
| task test | Run all tests |
| task precommit:install | Install Git pre-commit hook (recommended) |
Build-Time Agent Metadata
The ADK supports injecting agent metadata at build time using Go linker flags (LD flags). This makes agent information immutable and embedded in the binary, which is useful for production deployments.
Available LD Flags
The following build-time metadata variables can be set via LD flags:
BuildAgentName- The agent's display nameBuildAgentDescription- A description of the agent's capabilitiesBuildAgentVersion- The agent's version number
Usage Examples
Simple A2A Server Example:
package main
import (
"context"
"fmt"
"log"
"os"
"os/signal"
"syscall"
"time"
zap "go.uber.org/zap"
server "github.com/inference-gateway/adk/server"
config "github.com/inference-gateway/adk/server/config"
types "github.com/inference-gateway/adk/types"
)
func main() {
fmt.Println("🤖 Starting Simple A2A Server...")
// Initialize logger
logger, err := zap.NewDevelopment()
if err != nil {
log.Fatalf("failed to create logger: %v", err)
}
defer logger.Sync()
// Get port from environment or use default
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
// Configuration
cfg := config.Config{
AgentName: "simple-agent",
AgentDescription: "A simple A2A server with default handlers",
AgentVersion: "0.1.0",
Debug: true,
QueueConfig: config.QueueConfig{
CleanupInterval: 5 * time.Minute,
},
ServerConfig: config.ServerConfig{
Port: port,
},
}
// Build and start server with default handlers
a2aServer, err := server.NewA2AServerBuilder(cfg, logger).
WithDefaultTaskHandlers().
WithAgentCard(types.AgentCard{
Name: cfg.AgentName,
Description: cfg.AgentDescription,
Version: cfg.AgentVersion,
URL: fmt.Sprintf("http://localhost:%s", port),
ProtocolVersion: "0.3.0",
Capabilities: types.AgentCapabilities{
Streaming: &[]bool{true}[0],
PushNotifications: &[]bool{false}[0],
StateTransitionHistory: &[]bool{false}[0],
},
DefaultInputModes: []string{"text/plain"},
DefaultOutputModes: []string{"text/plain"},
Skills: []types.AgentSkill{},
}).
Build()
if err != nil {
logger.Fatal("failed to create A2A server", zap.Error(err))
}
logger.Info("✅ server created")
// Start server
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
go func() {
if err := a2aServer.Start(ctx); err != ni
