开源AI工作流 是 AI Skill Hub 本期精选Agent工作流之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
An Agent Development Kit (ADK)允许创建A2A兼容的AI工作流,提高企业AI应用的效率和灵活性。
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
An Agent Development Kit (ADK)允许创建A2A兼容的AI工作流,提高企业AI应用的效率和灵活性。
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:go install(推荐) go install github.com/inference-gateway/adk@latest # 方式二:从源码编译 git clone https://github.com/inference-gateway/adk cd adk go build -o adk . # 方式三:下载预编译二进制 # 访问 Releases 页面下载对应平台二进制文件 # https://github.com/inference-gateway/adk/releases
# 查看帮助 adk --help # 基本运行 adk [options] <input> # 详细使用说明请查阅文档 # https://github.com/inference-gateway/adk
# adk 配置说明 # 查看配置选项 adk --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export ADK_CONFIG="/path/to/config.yml"
<p align="center"> <strong>Build powerful, interoperable AI agents with the Agent-to-Agent (A2A) protocol</strong> </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.
<p align="center"> <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> <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> <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> <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> <img src="https://img.shields.io/github/go-mod/go-version/inference-gateway/adk?style=flat-square" alt="Go Version"/> <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>
---
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.
go mod download
go get github.com/inference-gateway/adk
```bash
task precommit:install ```
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.
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 numberSimple 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 != nil {
logger.Fatal("server failed to start", zap.Error(err))
}
}()
logger.Info("🌐 server running on port " + port)
// Wait for shutdown signal
quit := make(chan os.Signal, 1)
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
<-quit
logger.Info("🛑 shutting down...")
// Graceful shutdown
shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 5*time.Second)
defer shutdownCancel()
if err := a2aServer.Stop(shutdownCtx); err != nil {
logger.Error("shutdown error", zap.Error(err))
} else {
logger.Info("✅ goodbye!")
}
}
See the Docker Support section for containerized builds.
---
For detailed development workflows, testing guidelines, and contribution processes, see the Contributing Guide.
export QUEUE_PROVIDER=redis export QUEUE_URL=redis://localhost:6379
Build and run your A2A agent application in a container. Here's an example Dockerfile for an application using the ADK:
```dockerfile FROM golang:1.26-alpine AS builder
ARG AGENT_NAME="My A2A Agent" ARG AGENT_DESCRIPTION="A custom A2A agent built with the ADK" ARG AGENT_VERSION="0.1.0"
WORKDIR /app COPY go.mod go.sum ./ RUN go mod download
COPY . . RUN go mod tidy && \ go build -ldflags "-X 'github.com/inference-gateway/adk/server.BuildAgentName=${AGENT_NAME}' -X 'github.com/inference-gateway/adk/server.BuildAgentDescription=${AGENT_DESCRIPTION}' -X 'github.com/inference-gateway/adk/server.BuildAgentVersion=${AGENT_VERSION}'" -o bin/agent .
FROM alpine:latest RUN apk --no-cache add ca-certificates && \ addgroup -g 1001 -S a2a && \ adduser -u 1001 -S agent -G a2a WORKDIR /home/agent COPY --from=builder /app/bin/agent . RUN chown agent:a2a ./agent USER agent CMD ["./agent"]
**Build with custom metadata:**
bash docker build \ --build-arg AGENT_NAME="Weather Assistant" \ --build-arg AGENT_DESCRIPTION="AI-powered weather forecasting agent" \ --build-arg AGENT_VERSION="0.1.1" \ -t my-a2a-agent . ```
task precommit:install ```
For questions or help getting started, please open a discussion or check out the contributing guide.
For complete working examples, see the examples directory:
tasks/cancel, tasks/list, tasks/pushNotificationConfig/{set,get,list,delete}, tasks/resubscribe, and agent/getAuthenticatedExtendedCardTo run any example:
cd examples/minimal/server
go run main.go
Each example includes its own README with setup instructions and usage details.
For detailed implementation examples and patterns, see the examples directory:
Configure your A2A agent using environment variables. All configuration is optional and includes sensible defaults.
| Variable | Default | Description |
|---|---|---|
PORT | 8080 | Server port |
DEBUG | false | Enable debug logging |
AGENT_URL | http://helloworld-agent:8080 | Agent URL for internal references |
STREAMING_STATUS_UPDATE_INTERVAL | 1s | How often to send streaming status updates |
| Variable | Default | Description |
|---|---|---|
AGENT_CLIENT_PROVIDER | - | LLM provider (openai, anthropic, groq, etc.) |
AGENT_CLIENT_MODEL | - | Model name (e.g., openai/gpt-4) |
AGENT_CLIENT_BASE_URL | - | Custom LLM endpoint URL |
AGENT_CLIENT_API_KEY | - | API key for LLM provider |
AGENT_CLIENT_TIMEOUT | 30s | Request timeout |
AGENT_CLIENT_MAX_RETRIES | 3 | Maximum retry attempts |
AGENT_CLIENT_MAX_CHAT_COMPLETION_ITERATIONS | 50 | Max chat completion rounds |
AGENT_CLIENT_MAX_TOKENS | 4096 | Maximum tokens per response |
AGENT_CLIENT_TEMPERATURE | 0.7 | LLM temperature (0.0-2.0) |
AGENT_CLIENT_SYSTEM_PROMPT | - | System prompt for the agent |
AGENT_CLIENT_ENABLE_USAGE_METADATA | true | Track token usage and execution metrics |
| Variable | Default | Description |
|---|---|---|
CAPABILITIES_STREAMING | true | Enable streaming responses |
CAPABILITIES_PUSH_NOTIFICATIONS | false | Enable webhook notifications |
CAPABILITIES_STATE_TRANSITION_HISTORY | false | Track state changes |
| Variable | Default | Description |
|---|---|---|
AUTH_ENABLE | false | Enable OIDC authentication |
AUTH_ISSUER_URL | - | OIDC issuer URL |
AUTH_CLIENT_ID | - | OIDC client ID |
AUTH_CLIENT_SECRET | - | OIDC client secret |
| Variable | Default | Description |
|---|---|---|
TASK_RETENTION_MAX_COMPLETED_TASKS | 100 | Max completed tasks to keep (0 = unlimited) |
TASK_RETENTION_MAX_FAILED_TASKS | 50 | Max failed tasks to keep (0 = unlimited) |
TASK_RETENTION_CLEANUP_INTERVAL | 5m | Cleanup frequency (0 = manual only) |
| Variable | Default | Description |
|---|---|---|
QUEUE_PROVIDER | memory | Storage backend: memory or redis |
QUEUE_URL | - | Redis connection URL (required when using Redis) |
QUEUE_MAX_SIZE | 100 | Maximum queue size |
QUEUE_CLEANUP_INTERVAL | 120s | How often to clean up completed tasks |
Storage Backends:
Redis Configuration Examples:
```bash
export ARTIFACTS_STORAGE_BASE_URL=http://localhost:9000 ```
Benefits of Redis Storage:
| Variable | Default | Description |
|---|---|---|
SERVER_TLS_ENABLE | false | Enable TLS/HTTPS |
SERVER_TLS_CERT_PATH | - | Path to TLS certificate |
SERVER_TLS_KEY_PATH | - | Path to TLS private key |
| Variable | Default | Description |
|---|---|---|
TELEMETRY_ENABLE | false | Enable OpenTelemetry |
TELEMETRY_ENDPOINT | - | OTLP endpoint URL |
TELEMETRY_SERVICE_NAME | a2a-agent | Service name for tracing |
See configuration examples for complete setup patterns, including environment variables, custom config structs, and programmatic overrides.
The main server interface that handles A2A protocol communication. See server examples for complete implementation details.
Build A2A servers with custom configurations using a fluent interface. The builder provides methods for:
WithAgent() - Configure AI agent integrationWithDefaultTaskHandlers() - Use built-in task processingWithBackgroundTaskHandler() - Custom background task handlingWithStreamingTaskHandler() - Custom streaming task handlingWithAgentCardFromFile() - Load agent metadata from JSONSee examples for complete usage patterns.
The ADK provides two distinct interfaces for handling tasks:
TaskHandler - For background/polling scenarios (message/send)StreamableTaskHandler - For real-time streaming scenarios (message/stream)Streaming handlers require an agent to be configured. See task handler examples for implementation details.
Build OpenAI-compatible agents using a fluent interface. Supports:
See AI-powered examples and callback examples for complete agent setup.
Client interface for communicating with A2A servers. Supports:
See client examples for usage patterns.
Beyond message/send, message/stream, and tasks/get, the client exposes every method in the A2A JSON-RPC surface. Each snippet below is runnable against any ADK-built server; see examples/protocol-methods/ for an end-to-end demo that ties them all together.
tasks/cancelCancel an in-flight task. Works for tasks in any non-terminal state (SUBMITTED, WORKING, INPUT_REQUIRED, AUTH_REQUIRED, UNSPECIFIED).
resp, err := a2a.CancelTask(ctx, types.TaskIdParams{ID: taskID})
if err != nil {
log.Fatalf("cancel failed: %v", err)
}
taskBytes, _ := json.Marshal(resp.Result)
var task types.Task
_ = json.Unmarshal(taskBytes, &task)
log.Printf("cancelled task %s → state=%s", task.ID, task.Status.State)
tasks/listList tasks the server knows about. Limit controls page size (server caps the limit at 100; default is 50) and Offset controls where the page starts. Iterate until offset >= TotalSize to walk the full result set.
const pageSize = 20
offset := 0
for {
resp, err := a2a.ListTasks(ctx, types.TaskListParams{
Limit: pageSize,
Offset: offset,
})
if err != nil {
log.Fatalf("list failed: %v", err)
}
listBytes, _ := json.Marshal(resp.Result)
var list types.TaskList
_ = json.Unmarshal(listBytes, &list)
for _, t := range list.Tasks {
log.Printf(" task %s [%s]", t.ID, t.Status.State)
}
offset += len(list.Tasks)
if len(list.Tasks) == 0 || offset >= list.TotalSize {
break
}
}
You can also filter by ContextID or by State (e.g. only TASK_STATE_COMPLETED); both fields are optional pointers on TaskListParams.
tasks/pushNotificationConfig/{set,get,list,delete}Register, inspect, and remove webhook callbacks the server will POST to as a task changes state. The four methods share a common identifier (task.ID) and form a complete CRUD cycle.
configID := uuid.New().String()
authToken := "shared-secret"
// set: register a webhook for the task.
if _, err := a2a.SetTaskPushNotificationConfig(ctx, types.TaskPushNotificationConfig{
Name: taskID,
PushNotificationConfig: types.PushNotificationConfig{
ID: &configID,
URL: "https://example.com/webhook",
Token: &authToken,
},
}); err != nil {
log.Fatalf("set failed: %v", err)
}
// get: read the active config.
if _, err := a2a.GetTaskPushNotificationConfig(ctx, types.GetTaskPushNotificationConfigParams{
Name: taskID,
}); err != nil {
log.Fatalf("get failed: %v", err)
}
// list: enumerate every config attached to a task.
if _, err := a2a.ListTaskPushNotificationConfig(ctx, types.ListTaskPushNotificationConfigParams{
Parent: taskID,
}); err != nil {
log.Fatalf("list failed: %v", err)
}
// delete: tear the config down.
if _, err := a2a.DeleteTaskPushNotificationConfig(ctx, types.DeleteTaskPushNotificationConfigParams{
Name: taskID,
}); err != nil {
log.Fatalf("delete failed: %v", err)
}
Server-side push notifications require CapabilitiesConfig.PushNotifications to be true on the server.
tasks/resubscribeRe-attach to a streaming task after the original SSE connection has dropped. The server first re-emits the current task state, then forwards any further streaming events as they happen.
events, err := a2a.ResubscribeTask(ctx, types.TaskResubscriptionParams{
Name: taskID,
})
if err != nil {
log.Fatalf("resubscribe failed: %v", err)
}
for evt := range events {
payload, _ := json.Marshal(evt.Result)
log.Printf("event: %s", string(payload))
}
agent/getAuthenticatedExtendedCardThe JSON-RPC counterpart to the public .well-known/agent-card.json endpoint. The response is the same AgentCard object, but the call passes through the JSON-RPC route and is therefore subject to the server's authentication middleware — useful when the extended card should only be visible to authenticated callers.
resp, err := a2a.GetAuthenticatedExtendedCard(ctx, types.GetAuthenticatedExtendedCardParams{})
if err != nil {
log.Fatalf("authenticated card fetch failed: %v", err)
}
cardBytes, _ := json.MarshalIndent(resp.Result, "", " ")
log.Println(string(cardBytes))
Monitor agent operational status with three health states:
healthy: Fully operationaldegraded: Partially operationalunhealthy: Not operationalSee client examples for implementation.
Agent Development Kit (ADK) 是一个 Go 库,简化了构建 Agent-to-Agent (A2A) 协议兼容的代理的过程。A2A 允许 AI 代理之间进行无缝通信,允许它们协作、委托任务和共享能力跨不同系统和提供商。
ADK 的关键功能包括:A2A 协议兼容性、多提供商支持、实时流式传输、自定义工具集成和回调钩子。
ADK 的环境依赖和系统要求包括:Go 1.26 或更高版本、依赖项见 [go.mod](./go.mod) 文件。
安装 ADK 可以使用以下命令:go get github.com/inference-gateway/adk
ADK 的快速入门包括:查看示例代码、了解 A2A 协议的基本概念和 ADK 的核心功能。
ADK 的配置可以使用环境变量进行配置,包括服务器端口、调试模式和 Redis 存储的 URL。
ADK 的核心组件包括 A2AServer 和 A2AServerBuilder,用于构建 A2A 服务器和自定义配置。
ADK 的常见问题包括:如何报告 Bug、哪里可以找到官方文档等。
ADK是一个开源的AI工作流工具,允许创建A2A兼容的AI工作流,提高企业AI应用的效率和灵活性,值得关注。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,开源AI工作流 在Agent工作流赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | adk |
| 原始描述 | 开源AI工作流:An Agent Development Kit (ADK) allowing for seamless creation of A2A-compatible 。⭐20 · Go |
| Topics | workflowa2aa2a-protocola2a-serveradkenterprisego |
| GitHub | https://github.com/inference-gateway/adk |
| License | MIT |
| 语言 | Go |
收录时间:2026-05-19 · 更新时间:2026-05-20 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端