Aspire.Hosting.AgentFramework.DevUI
1.7.0-preview.260526.1
Prefix Reserved
dotnet add package Aspire.Hosting.AgentFramework.DevUI --version 1.7.0-preview.260526.1
NuGet\Install-Package Aspire.Hosting.AgentFramework.DevUI -Version 1.7.0-preview.260526.1
<PackageReference Include="Aspire.Hosting.AgentFramework.DevUI" Version="1.7.0-preview.260526.1" />
<PackageVersion Include="Aspire.Hosting.AgentFramework.DevUI" Version="1.7.0-preview.260526.1" />
<PackageReference Include="Aspire.Hosting.AgentFramework.DevUI" />
paket add Aspire.Hosting.AgentFramework.DevUI --version 1.7.0-preview.260526.1
#r "nuget: Aspire.Hosting.AgentFramework.DevUI, 1.7.0-preview.260526.1"
#:package Aspire.Hosting.AgentFramework.DevUI@1.7.0-preview.260526.1
#addin nuget:?package=Aspire.Hosting.AgentFramework.DevUI&version=1.7.0-preview.260526.1&prerelease
#tool nuget:?package=Aspire.Hosting.AgentFramework.DevUI&version=1.7.0-preview.260526.1&prerelease
Aspire.Hosting.AgentFramework.DevUI library
Provides extension methods and resource definitions for an Aspire AppHost to configure a DevUI resource for testing and debugging AI agents built with Microsoft Agent Framework.
Getting started
Prerequisites
Agent services must expose the OpenAI Responses and Conversations API endpoints. This is compatible with services using Microsoft Agent Framework with MapOpenAIResponses() and MapOpenAIConversations() mapped.
Install the package
In your AppHost project, install the Aspire Agent Framework DevUI Hosting library with NuGet:
dotnet add package Aspire.Hosting.AgentFramework.DevUI
Usage example
Then, in the AppHost.cs file of AppHost, add a DevUI resource and connect it to your agent services using the following methods:
var writerAgent = builder.AddProject<Projects.WriterAgent>("writer-agent")
.WithHttpHealthCheck("/health");
var editorAgent = builder.AddProject<Projects.EditorAgent>("editor-agent")
.WithHttpHealthCheck("/health");
var devui = builder.AddDevUI("devui")
.WithAgentService(writerAgent)
.WithAgentService(editorAgent)
.WaitFor(writerAgent)
.WaitFor(editorAgent);
Each agent service only needs to map the standard OpenAI API endpoints — no custom discovery endpoints are required:
// In the agent service's Program.cs
builder.AddAIAgent("writer", "You write short stories.");
builder.Services.AddOpenAIResponses();
builder.Services.AddOpenAIConversations();
var app = builder.Build();
app.MapOpenAIResponses();
app.MapOpenAIConversations();
How it works
AddDevUI starts an in-process aggregator inside the AppHost — no external container image is needed. The aggregator is a lightweight Kestrel server that:
- Serves the DevUI frontend from the
Microsoft.Agents.AI.DevUIassembly's embedded resources (loaded at runtime). If the assembly is not available, it falls back to proxying the frontend from the first backend. - Aggregates entities from all configured agent service backends into a single
/v1/entitieslisting. Each entity ID is prefixed with the backend name to ensure uniqueness across services (e.g.,writer-agent/writer,editor-agent/editor). - Routes requests to the correct backend based on the entity ID prefix. When DevUI sends a
POST /v1/responsesor/v1/conversationsrequest, the aggregator strips the prefix and forwards it to the appropriate service. - Streams SSE responses for the
/v1/responsesendpoint, so agent responses stream back to the DevUI frontend in real time.
The aggregator publishes its URL to the Aspire dashboard, where it appears as a clickable link.
Agent discovery
By default, WithAgentService declares a single agent named after the Aspire resource. You can provide explicit agent metadata when the agent name differs from the resource name, or when a service hosts multiple agents:
builder.AddDevUI("devui")
.WithAgentService(writerAgent, agents: [new("writer", "Writes short stories")])
.WithAgentService(editorAgent, agents: [new("editor", "Edits and formats stories")]);
Agent metadata is declared at the AppHost level so the aggregator builds the entity listing directly — agent services don't need a /v1/entities endpoint.
Configuration
Custom entity ID prefix
By default, entity IDs are prefixed with the Aspire resource name. You can specify a custom prefix:
builder.AddDevUI("devui")
.WithAgentService(myService, entityIdPrefix: "custom-prefix");
Custom port
You can specify a fixed host port for the DevUI web interface:
builder.AddDevUI("devui", port: 8090);
DevUI frontend assembly
To serve the DevUI frontend directly from the aggregator (instead of proxying from a backend), add the Microsoft.Agents.AI.DevUI NuGet package to your AppHost project. The aggregator loads its embedded resources at runtime via Assembly.Load.
Additional documentation
- https://github.com/microsoft/agent-framework
- https://github.com/microsoft/agent-framework/tree/main/dotnet/src/Microsoft.Agents.AI.DevUI
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aspire.Hosting (>= 13.1.0)
- Newtonsoft.Json (>= 13.0.4)
-
net8.0
- Aspire.Hosting (>= 13.1.0)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.6)
- Newtonsoft.Json (>= 13.0.4)
-
net9.0
- Aspire.Hosting (>= 13.1.0)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.6)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Aspire.Hosting.AgentFramework.DevUI:
| Repository | Stars |
|---|---|
|
foxminchan/BookWorm
The practical implementation of Aspire using Microservices, AI-Agents
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.7.0-preview.260526.1 | 19 | 5/26/2026 |
| 1.6.2-preview.260521.1 | 73 | 5/22/2026 |
| 1.6.1-preview.260514.1 | 101 | 5/14/2026 |
| 1.6.0-preview.260512.1 | 54 | 5/13/2026 |
| 1.5.0-preview.260507.1 | 111 | 5/8/2026 |
| 1.4.0-preview.260505.1 | 50 | 5/5/2026 |
| 1.3.0-preview.260423.1 | 371 | 4/24/2026 |