AG-UI Protocol

repository·main·Indexed 12 days ago

https://github.com/ag-ui-protocol/ag-ui

An open, event-based protocol that standardizes interactions between AI agents and user-facing applications. It enables real-time chat, generative UI, and bi-directional state synchronization. The ecosystem includes the AG-UI Protocol Dojo for exploring agent demos, a CLI example for streaming responses and tool call visualization, and integrations such as @ag-ui/a2a for remote A2A protocol services and ADK middleware for FastAPI-based agentic interaction patterns.

Tokens
402.7K
Snippets
1.1K
Records
1.6K
Agent score
92%

What's inside AG-UI

  1. Overview of the AG-UI .NET SDK

    main
    The AG-UI (Agent User Interaction Protocol) .NET SDK standardizes streaming communication between AI agents and user interfaces. It provides the necessary types, wire formatters, protobuf support, an HTTP client, and a framework-agnostic server adapter designed to work with Microsoft.Extensions.AI.
  2. Overview of the ChatApp Wear OS Sample

    main

    The ChatApp Wear OS sample is a standalone Wear OS application that demonstrates how to deliver an AG-UI chat experience on a wearable device. It reuses the chatapp-shared Kotlin multiplatform core to handle networking, state, and tool-confirmation layers.

    Key Capabilities:

    • Agent Connectivity: Connects to AG-UI agents via the ChatController from chatapp-shared.
    • Wear-Optimized UI: Uses androidx.wear.compose:compose-material3 to render streaming responses, tool confirmations, and error recovery in a compact layout.
    • Agent Management: Includes a built-in agent manager to add, edit, and activate agents directly on the watch.
    • Standalone Operation: Does not require a phone companion.
  3. Overview of the Langroid AG-UI Integration

    main

    The Langroid integration allows you to adapt Langroid agents to the AG-UI protocol. It works by wrapping standard Langroid components with an AG-UI aware layer that understands AG-UI events, tool semantics, and shared-state conventions.

    Key architectural features:

    • Agent Wrapping: Uses LangroidAgent to wrap langroid.ChatAgent or langroid.Task.
    • Stateless Transport: Provides a FastAPI transport layer that handles encoding and CORS while remaining stateless.
    • Universal Client Support: Any standard AG-UI HTTP client can connect to the exposed endpoint; you do not need a specific Langroid-only frontend package.
  4. Overview of AG-UI Protocol Dojo

    main

    The AG-UI Protocol Dojo is an interactive viewer designed for exploring CopilotKit agent demos. It provides a centralized interface to browse, preview, and inspect the source code of various agent implementations.

    Key features include:

    • A responsive UI with dark/light theme support.
    • Interactive previews of agent demos.
    • Source code exploration with syntax highlighting.
    • Organized demo listings using tags and descriptions.
    • Ability to select different LLM providers.
  5. Overview of AG-UI Rust SDK packages

    main

    The Rust SDK is organized into two primary packages:

    1. ag-ui-core: Contains the shared types and the event protocol used across the ecosystem.
    2. ag-ui-client: Provides the implementation layer, including the Agent trait, the HttpAgent implementation, and the subscriber system for handling interactions.
  6. Overview of AG-UI .NET SDK packages

    main

    The .NET SDK is modular, allowing you to adopt specific parts of the protocol independently. Use the following packages based on your requirements:

    PackageUse it for
    AGUI.AbstractionsProtocol events, messages, tools, capabilities, interrupts, and JSON serialization.
    AGUI.FormattingEvent-stream formatter abstractions and Server-Sent Events (SSE) support.
    AGUI.ProtobufProtobuf event-stream formatting and binary protocol support.
    AGUI.ClientHTTP client and IChatClient implementation for consuming AG-UI endpoints.
    AGUI.ServerFramework-agnostic adapter from ChatResponseUpdate streams to AG-UI events.
  7. Overview of @ag-ui/core features

    main

    The @ag-ui/core package provides the foundational building blocks for the AG-UI protocol:

    • Typed data models: Includes core types like Message, Tool, Context, RunAgentInput, and State.
    • Streaming events: Provides 16 core event kinds covering assistant messages, tool calls, state updates, and the run lifecycle.
    • Runtime validation: Uses schemas to catch malformed payloads early.
    • Framework-agnostic: Designed to work in Node.js, browsers, and any agent framework capable of emitting JSON.
  8. Overview of @ag-ui/a2ui-toolkit

    main

    The @ag-ui/a2ui-toolkit package provides framework-agnostic helpers designed for building A2UI (Agent-to-User Interface) subagent tools.

    It is intended to be used as a foundation for framework-specific adapters (such as LangGraph, ADK, or Mastra). These adapters compose the toolkit's helpers with framework-specific logic like tool decorators, runtime accessors, and model bindings. The toolkit itself has zero dependencies on any specific agent framework.

  9. Overview of ag-ui-server for Java

    main

    The ag-ui-server library provides server-side utilities for building agents and streaming AG-UI events to clients. It is divided into two main functional areas:

    1. Core Server Utilities (com.agui.server): Provides the foundation for local agents and event helpers.

      • LocalAgent: The base class for implementing server-side agents that emit events.
      • EventFactory: Provides convenience methods to create standard AG-UI events.
      • streamer.AgentStreamer: Acts as a bridge to connect agents to an EventStream.
    2. Spring Boot Integration (com.agui.server.spring): Provides seamless integration for Spring-based applications.

      • AgUiService: Manages running agents and streaming via SseEmitter.
      • AgUiParameters: Maps incoming HTTP payloads to RunAgentParameters.
      • Includes auto-configuration for easy dependency injection and wiring.
  10. Overview of Claude Agent SDK integration features

    main

    The ag-ui-claude-agent-sdk provides several advanced interaction capabilities:

    • Full lifecycle management: Internal handling of client pooling and event translation.
    • Interrupt support: Ability to stop queries via adapter.interrupt().
    • Dynamic frontend tools: Client-provided tools are automatically added as MCP servers with auto-granted permissions.
    • Frontend tool halting: Streams pause during frontend tool calls to allow for human-in-the-loop execution.
    • Streaming tool arguments: Real-time TOOL_CALL_ARGS emission as JSON arguments stream in.
    • Bidirectional state sync: Shared state management using the ag_ui_update_state tool.
    • Context injection: Automatic injection of context and state into prompts.
    • Event cleanup: Automatic closing of hanging events (tool calls, reasoning blocks) at the end of a stream.
    • Custom tools via MCP: Use the Claude SDK's @tool decorator to define custom tools.
    • Forwarded props: Support for per-run option overrides with a security whitelist.
  11. Overview of @ag-ui/client features

    main

    The @ag-ui/client SDK manages the full lifecycle of AG-UI communication. Key capabilities include:

    • Connectivity: HttpAgent for direct server connections (SSE/protobuf).
    • Extensibility: AbstractAgent base class for implementing custom transport layers.
    • Event Processing: Full support for streaming, validating, and transforming AG-UI events.
    • State Management: Automatic tracking of messages and state with reactive updates.
    • Interception: A subscriber system and middleware support for logging, persistence, and custom logic.
  12. Overview of the AG-UI Kotlin SDK

    main

    The AG-UI Kotlin SDK is a Kotlin Multiplatform (KMP) client library designed to connect Kotlin applications to AI agents that implement the Agent User Interaction Protocol (AG-UI). It provides transport mechanisms, state management, and tool integration for communication across Android, iOS, and JVM platforms.

    Key architectural components include:

    • kotlin-core: Defines protocol types, events, and message definitions.
    • kotlin-client: Handles HTTP transport, state management, and high-level agent APIs.
    • kotlin-tools: Provides a tool execution framework featuring a registry and circuit breakers.

    The SDK uses native Kotlin idioms such as sealed classes, suspend functions, and Kotlin Flows for streaming responses to maintain conceptual parity with the TypeScript implementation.