Skip to content

sample/demo application to showcase Microsoft Agent Framework with Group Chat pattern

Notifications You must be signed in to change notification settings

sohamda/route-optimization-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Route Optimization Multi-Agent System

A multi-agent route optimization system using Microsoft Agent Framework with Group Chat pattern. Automatically redistributes delivery routes when a driver becomes unavailable.

Architecture

                    ┌──────────────┐
                    │ Orchestrator │ ◄── Azure OpenAI (GPT-4o)
                    └──────┬───────┘
               ┌──────────┼──────────┐
               ▼          ▼          ▼
          ┌───────┐  ┌────────┐  ┌────────┐
          │ Route │  │Schedule│  │ Driver │
          │Analyzer│ │Optimizer│ │Assigner│
          └───────┘  └────────┘  └────────┘

Agents: RouteAnalyzer (identifies affected routes) → ScheduleOptimizer (plans redistribution) → DriverAssigner (matches drivers) → Orchestrator (synthesizes plan)

Prerequisites

Quick Start

azd auth login
azd env new dev
azd env set AZURE_LOCATION eastus2
azd up

Frontend

A web-based UI is included at src/frontend/index.html for interacting with the optimization system.

Frontend Screenshot

Features:

  • Visual agent workflow progress
  • Real-time chat interface showing agent conversations
  • Driver selection dropdown
  • Markdown-rendered agent responses

Running locally: Open src/frontend/index.html in a browser after configuring config.local.js with your API endpoint.

After deployment: The postprovision hook generates config.local.js with your Azure Function URL.

API Endpoints

Endpoint Method Description
/api/health GET Health check
/api/optimize-routes POST Trigger optimization {"driver_id": "D001", "reason": "..."}
/api/drivers GET List all drivers
/api/routes/{driver_id} GET Get driver's route details

Local Development

cd src/functions
python -m venv .venv && .venv\Scripts\activate
pip install -r requirements.txt
# Update local.settings.json with AZURE_OPENAI_ENDPOINT
func start

Project Structure

├── azure.yaml              # azd configuration
├── infra/                  # Bicep IaC (OpenAI, Functions, Monitoring)
├── src/
│   ├── functions/          # Python Azure Functions (API + Agents)
│   └── frontend/           # Web UI (HTML + Tailwind CSS)
└── hooks/                  # azd lifecycle hooks

Azure Resources

Azure OpenAI (GPT-4o) • AI Foundry Hub & Project • Azure Functions • Application Insights • Storage Account

Monitoring

Azure OpenAI usage is logged to Log Analytics. See Azure OpenAI Monitoring Queries for KQL queries to track:

  • Token usage - Prompt and completion tokens over time
  • API calls - Total calls per model, streaming vs non-streaming
  • Latency - Per request and per model (avg, max, P95)
  • Request details - Individual request inspection, slow request detection

Clean Up

azd down

License

MIT

About

sample/demo application to showcase Microsoft Agent Framework with Group Chat pattern

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published