Share via


Samples

This page provides links to sample agents and workflows designed for use with DevUI.

Coming Soon

DevUI samples for C# are coming soon. Please check back later or refer to the Python samples for guidance.

Getting Started Samples

The Agent Framework repository includes sample agents and workflows in the python/samples/getting_started/devui/ directory:

Sample Description
weather_agent_azure A weather agent using Azure OpenAI
foundry_agent Agent using Azure AI Foundry
azure_responses_agent Agent using Azure Responses API
fanout_workflow Workflow demonstrating fan-out pattern
spam_workflow Workflow for spam detection
workflow_agents Multiple agents in a workflow

Running the Samples

Clone and Navigate

git clone https://github.com/microsoft/agent-framework.git
cd agent-framework/python/samples/getting_started/devui

Set Up Environment

Each sample may require environment variables. Check for .env.example files:

# Copy and edit the example file
cp weather_agent_azure/.env.example weather_agent_azure/.env
# Edit .env with your credentials

Launch DevUI

# Discover all samples
devui .

# Or run a specific sample
devui ./weather_agent_azure

In-Memory Mode

The in_memory_mode.py script demonstrates running agents without directory discovery:

python in_memory_mode.py

This opens the browser with pre-configured agents and a basic workflow, showing how to use serve() programmatically.

When DevUI starts with no discovered entities, it displays a sample gallery with curated examples. From the gallery, you can:

  1. Browse available samples
  2. View sample descriptions and requirements
  3. Download samples to your local machine
  4. Run samples directly

Creating Your Own Samples

Follow the Directory Discovery guide to create your own agents and workflows compatible with DevUI.

Minimal Agent Template

# my_agent/__init__.py
from agent_framework import ChatAgent
from agent_framework.openai import OpenAIChatClient

agent = ChatAgent(
    name="my_agent",
    chat_client=OpenAIChatClient(),
    instructions="You are a helpful assistant."
)

Minimal Workflow Template

# my_workflow/__init__.py
from agent_framework.workflows import WorkflowBuilder

# Define your workflow
workflow = (
    WorkflowBuilder()
    # Add executors and edges
    .build()
)

Next Steps