Zing Forum

Reading

Agenxia SDK: Innovative Practice of Declarative Agent Runtime and A2A Protocol

A declarative configuration-based agent runtime that supports A2A protocol, workflow orchestration, and interactive components, enabling a flexible agent execution model via JSON-RPC interfaces and SSE event streams.

AgenxiaA2A协议智能体声明式配置工作流JSON-RPCSSENode.js交互式组件
Published 2026-04-12 07:12Recent activity 2026-04-12 07:20Estimated read 6 min
Agenxia SDK: Innovative Practice of Declarative Agent Runtime and A2A Protocol
1

Section 01

[Main Floor/Introduction] Agenxia SDK: Innovative Practice of Declarative Agent Runtime and A2A Protocol

Agenxia SDK proposes a declarative agent construction paradigm. It configures workflows via workflow.json, exposes a single A2A endpoint (the start method of JSON-RPC), supports SSE event streams for pushing execution events, uses incremental execution and intelligent caching to optimize performance, achieves A2A protocol interoperability, and lowers the threshold for agent development while maintaining flexibility.

2

Section 02

Project Background and Core Concepts

The core concept of Agenxia SDK is the "declarative agent". Unlike traditional imperative agents, developers only need to write workflow.json to describe the workflow diagram. Its core insight is: an agent is essentially a general-purpose workflow executor—conversational interactions, tool calls, and UI component interactions can all be uniformly modeled as workflow execution problems, thus supporting diverse scenarios with a concise API.

3

Section 03

Architecture Design: Single Entry and Incremental Execution

The architecture follows the "less is more" principle, exposing only the start method of JSON-RPC as the sole entry point—all interactions are uniformly handled via start. The execution model is efficient: when called for the first time without cache, all nodes are executed on demand; subsequent calls only re-execute the start node and its descendants, while other nodes reuse the cache. For example, during calendar component interactions, only relevant nodes are re-executed, avoiding repeated expensive requests.

4

Section 04

Workflow Model: Nodes, Edges, and Port Control

The workflow model introduces the concept of ports (Handles), which precisely control data flow forwarding via sourceHandle and targetHandle (e.g., the events field of connector-ics is forwarded to the events port of widget-calendar). The conflict resolution rule is simple: when multiple edges point to the same targetHandle, the last defined edge takes effect, encouraging explicit data flow design.

5

Section 05

Module Executor Mechanism: Flexible Expansion and LLM Support

The module executor is located at modules//execute.js (CommonJS specification), which receives inputs, params, and context parameters and returns outputs. context.llm is optional—the SDK creates a client only when LLM_API_URL and KEY are configured (node configuration takes priority, followed by environment variables). Modules without execute.js default to passing through inputs, which is suitable for pure display UI components.

6

Section 06

SSE Event Streams and Typical Application Scenarios

The /a2a/stream endpoint is provided to return SSE event streams (events like node_start, node_complete), with the event scope limited to the re-executed subgraph for efficient front-end updates. Typical application scenarios include:

  1. Conversational agents (sending user messages routed to the agent-core node);
  2. Interactive components (e.g., calendar selection triggers execution of relevant nodes);
  3. Programmatic workflows (initializing the engine and leveraging cache).
7

Section 07

A2A Protocol Integration and Developer Experience

Agenxia implements Google's A2A protocol, supporting agent interoperability and bringing ecological advantages (seamless integration, tools exposed as agents, flexible orchestration). The developer experience is user-friendly: zero-configuration startup (auto-loading relevant files), modular expansion (file conventions), multi-layer configuration (CLI/environment variables/.agent.env), and clear JSON-RPC error messages.

8

Section 08

Summary and Outlook

Agenxia SDK represents a paradigm shift in agent development (imperative → declarative, complex APIs → single entry, full execution → incremental execution). It is a lightweight yet fully functional solution, suitable for quickly building AI applications that require interactive components and complex workflows. Its declarative concept and A2A protocol support lay the foundation for the agent ecosystem, which may become the mainstream model in the future.