Debug UI for Microsoft Agent Framework with OpenAI-compatible API server.
Project description
DevUI - A Sample App for Running Agents and Workflows
A lightweight, standalone sample app interface for running entities (agents/workflows) in the Microsoft Agent Framework supporting directory-based discovery, in-memory entity registration, and sample entity gallery.
[!IMPORTANT] DevUI is a sample app to help you get started with the Agent Framework. It is not intended for production use. For production, or for features beyond what is provided in this sample app, it is recommended that you build your own custom interface and API server using the Agent Framework SDK.
Quick Start
# Install
pip install agent-framework-devui --pre
You can also launch it programmatically
from agent_framework import ChatAgent
from agent_framework.openai import OpenAIChatClient
from agent_framework.devui import serve
def get_weather(location: str) -> str:
"""Get weather for a location."""
return f"Weather in {location}: 72°F and sunny"
# Create your agent
agent = ChatAgent(
name="WeatherAgent",
chat_client=OpenAIChatClient(),
tools=[get_weather]
)
# Launch debug UI - that's it!
serve(entities=[agent], auto_open=True)
# → Opens browser to http://localhost:8080
In addition, if you have agents/workflows defined in a specific directory structure (see below), you can launch DevUI from the cli to discover and run them.
# Launch web UI + API server
devui ./agents --port 8080
# → Web UI: http://localhost:8080
# → API: http://localhost:8080/v1/*
When DevUI starts with no discovered entities, it displays a sample entity gallery with curated examples from the Agent Framework repository to help you get started quickly.
Directory Structure
For your agents to be discovered by the DevUI, they must be organized in a directory structure like below. Each agent/workflow must have an __init__.py that exports the required variable (agent or workflow).
Note: .env files are optional but will be automatically loaded if present in the agent/workflow directory or parent entities directory. Use them to store API keys, configuration variables, and other environment-specific settings.
agents/
├── weather_agent/
│ ├── __init__.py # Must export: agent = ChatAgent(...)
│ ├── agent.py
│ └── .env # Optional: API keys, config vars
├── my_workflow/
│ ├── __init__.py # Must export: workflow = WorkflowBuilder()...
│ ├── workflow.py
│ └── .env # Optional: environment variables
└── .env # Optional: shared environment variables
Viewing Telemetry (Otel Traces) in DevUI
Agent Framework emits OpenTelemetry (Otel) traces for various operations. You can view these traces in DevUI by enabling tracing when starting the server.
devui ./agents --tracing framework
OpenAI-Compatible API
For convenience, you can interact with the agents/workflows using the standard OpenAI API format. Just specify the entity_id in the extra_body field. This can be an agent_id or workflow_id.
# Standard OpenAI format
curl -X POST http://localhost:8080/v1/responses \
-H "Content-Type: application/json" \
-d @- << 'EOF'
{
"model": "agent-framework",
"input": "Hello world",
"extra_body": {"entity_id": "weather_agent"}
}
CLI Options
devui [directory] [options]
Options:
--port, -p Port (default: 8080)
--host Host (default: 127.0.0.1)
--headless API only, no UI
--config YAML config file
--tracing none|framework|workflow|all
--reload Enable auto-reload
Key Endpoints
GET /v1/entities- List discovered agents/workflowsGET /v1/entities/{entity_id}/info- Get detailed entity informationPOST /v1/entities/add- Add entity from URL (for gallery samples)DELETE /v1/entities/{entity_id}- Remove remote entityPOST /v1/responses- Execute agent/workflow (streaming or sync)GET /health- Health checkPOST /v1/threads- Create thread for agent (optional)GET /v1/threads?agent_id={id}- List threads for agentGET /v1/threads/{thread_id}- Get thread infoDELETE /v1/threads/{thread_id}- Delete threadGET /v1/threads/{thread_id}/messages- Get thread messages
Implementation
- Discovery:
agent_framework_devui/_discovery.py - Execution:
agent_framework_devui/_executor.py - Message Mapping:
agent_framework_devui/_mapper.py - Session Management:
agent_framework_devui/_session.py - API Server:
agent_framework_devui/_server.py - CLI:
agent_framework_devui/_cli.py
Examples
See samples/ for working agent and workflow implementations.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_framework_devui-1.0.0b251007.tar.gz.
File metadata
- Download URL: agent_framework_devui-1.0.0b251007.tar.gz
- Upload date:
- Size: 639.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f89a54fe20bd440e996838f7ca7ffaf0ea74a9b0f514b1b5dbf85726f49d5864
|
|
| MD5 |
0fbe89cfc2d1272c0ba56b4928c6fe4d
|
|
| BLAKE2b-256 |
179b4bc4f9f94caa233e9191e1e2d66dad6388443f7f5c20788503e454326b53
|
File details
Details for the file agent_framework_devui-1.0.0b251007-py3-none-any.whl.
File metadata
- Download URL: agent_framework_devui-1.0.0b251007-py3-none-any.whl
- Upload date:
- Size: 268.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
350952d2c6442702b0281dfb4736cf9d94e1a7ea30de7f1c4419ad9408b42b2e
|
|
| MD5 |
14b81a5a9cbc07f00ab565d0bb968540
|
|
| BLAKE2b-256 |
5db6ab40dc4f768104bfaa43523e003c88aded8f79428f6c73a22f9547ddc752
|