ag_ui
0.3.0, released 5 months ago by community.ag-ui.com
Dart SDK for AG-UI protocol supporting event-based communication and SSE streaming.
What it does
Provides strongly-typed client implementations for connecting to AG-UI compatible agent servers. It enables real-time event streaming, state management, tool interactions, and multimodal input.
AI-written summary of version 0.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to connect Dart apps to AG-UI compatible agent servers
- You require server-sent event (SSE) streaming for LLM or AI agent interactions
Skip it when
- You are building standard REST or GraphQL applications without AI agent protocols
- You need an on-device machine learning model instead of a remote protocol client
Strengths
- Dart-native with full type safety and null safety
- Comprehensive support for tool calls, state snapshots, activity, and reasoning events
- Efficient event decoding with backpressure handling
Weaknesses
- Requires specific AG-UI compliant server architecture on the backend
- Narrow domain focus limited entirely to the AG-UI protocol
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Add the package to pubspec.yaml and initialize AgUiClient with a base URL.
import 'package:ag_ui/ag_ui.dart';
final client = AgUiClient(
config: AgUiClientConfig(
baseUrl: 'https://api.example.com',
),
);
final input = SimpleRunAgentInput(
messages: [
UserMessage(id: 'msg_123', content: 'Hello from Dart!'),
],
);
await for (final event in client.runAgent('agentic_chat', input)) {
if (event is TextMessageContentEvent) {
print('Assistant: ${event.delta}');
}
}Alternatives
Packages that do the same job and could replace ag_ui.
- matrix
Matrix (matrix.org) SDK written in Dart.
88Compare - http2
An HTTP/2 implementation in Dart for low-level transport and pooled HTTP/2 requests.
91Compare - sse
Bidirectional Server Sent Events client and server for Dart.
80Compare - didcomm
Implements the DIDComm v2 Messaging protocol for secure and private app communication.
74Compare