Installation
#Prerequisites
- Angular 20 or later
- Node.js 22+
- An AG-UI-compatible backend running locally or remotely (CrewAI, Mastra, Microsoft Agent Framework, AG2, Pydantic AI, AWS Strands, CopilotKit runtime, or your own subclass of
AbstractAgent)
#Install packages
@ngaf/chat provides the chat UI primitives. @ngaf/ag-ui provides the adapter that wires an AG-UI backend into the Agent contract those primitives consume.
#Peer Dependencies
@ngaf/ag-ui declares the following peer dependencies:
| Package | Version |
|---|---|
@ngaf/chat | * |
@ngaf/licensing | * |
@angular/core | ^20.0.0 || ^21.0.0 |
@ag-ui/client | * |
rxjs | ~7.8.0 |
#Configure the provider
In your app config:
provideAgUiAgent accepts:
| Option | Type | Description |
|---|---|---|
url | string | Required. AG-UI backend HTTP/SSE endpoint. |
agentId | string | Optional. Identifies a specific agent on the backend. |
threadId | string | Optional. Resume an existing conversation thread. |
headers | Record<string, string> | Optional. Custom request headers (auth, tracing). |
#Use in a component
#No backend yet?
Use the FakeAgent for offline demos:
FakeAgent extends AbstractAgent and emits a canned RUN_STARTED -> TEXT_MESSAGE_START -> TEXT_MESSAGE_CONTENT x N -> TEXT_MESSAGE_END -> RUN_FINISHED sequence. Drop-in replacement for provideAgUiAgent({ url }) while you're prototyping.
#Custom transport
If you have a backend that speaks AG-UI but not over HTTP, subclass AbstractAgent directly and feed it to toAgent: