# azure-samples/dream-team architecture

> Architecture diagram of the GitHub repository azure-samples/dream-team, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure-samples/dream-team
- Repository: https://github.com/azure-samples/dream-team

## Overview

##### Project type and purpose
- This is a full-stack, Azure-centric multi-agent AI application (“Dream Team”) combining a React/Vite/Tailwind frontend with a Python-based backend (FastAPI + AutoGen/Magentic One) and a supporting microservice (mcp).
- It ingests documents into Azure AI Search, orchestrates multiple specialized agents via Autogen, executes sandboxed code in container sessions, and presents results in a responsive web UI.

##### File structure
- Top-level folders:
- infra – Azure Bicep templates for provisioning Container Apps, AI Search, Key Vault, Container Registry, monitoring, networks.
- backend – Python FastAPI app, AutoGen agent definitions, ingestion scripts, data files, schemas, Dockerfile, pyproject.
- frontend – React/TypeScript app (Vite + Tailwind + Shadcn UI), contexts, hooks, pages, static web app config.
- mcp – standalone Python microservice (Magentic One custom MCP agent), its own Dockerfile and dependencies.
- CI/CD: GitHub workflows for deploy-frontend, deploy-backend, overall deploy.
- Dev container support and AzD (Azure Developer CLI) integration for “azd up”.

##### README for additional insights
- Architecture is event-driven and asynchronous (Autogen 0.4 + Magentic One).
- One-line deployment with AzD, managed identities for secure access, sandboxed containers for code execution, observability via PromptFlow tracing and Azure Monitor.
- Frontend served as a static web app; backend and mcp run in containerized Azure Container Apps.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User / Browser"]:::user
    subgraph "UI Layer"
        FE["Static Frontend\n(React/Vite/Tailwind)"]:::frontend
    end
    subgraph "API / Ingress"
        GW["API Gateway / Ingress"]:::infra
    end
    subgraph "Compute Layer"
        BE["Backend API\n(FastAPI + AutoGen)"]:::compute
        MCP["MCP Microservice"]:::compute
        SESS["Container Sessions\n(dynamic code exec)"]:::compute
    end
    subgraph "Data & AI Services"
        AIS["Azure AI Search"]:::data
        OAI["Azure OpenAI Service"]:::data
    end
    subgraph "Infra Services"
        ACR["Azure Container Registry"]:::infra
        KV["Key Vault"]:::infra
        MI["Managed Identities"]:::infra
        AI["Application Insights\n& Azure Monitor"]:::infra
    end
    subgraph "Infra IaC"
        IR["Infra Main\n(bicep templates)"]:::infra
        IB["Backend IaC\n(app/backend.bicep)"]:::infra
        IF["Frontend IaC\n(app/frontend.bicep)"]:::infra
        IS["Shared IaC\n(shared/)"]:::infra
    end

    User --> FE
    FE --> GW
    GW --> BE
    BE --> AIS
    BE --> OAI
    BE --> MCP
    BE --> SESS
    BE --> KV
    MCP --> KV
    SESS --> ACR
    BE --> MI
    MCP --> MI
    SESS --> MI
    BE --> AI
    MCP --> AI
    SESS --> AI

    click FE "https://github.com/azure-samples/dream-team/tree/main/frontend/src/"
    click BE "https://github.com/azure-samples/dream-team/blob/main/backend/main.py"
    click MCP "https://github.com/azure-samples/dream-team/blob/main/mcp/main.py"
    click IR "https://github.com/azure-samples/dream-team/blob/main/infra/main.bicep"
    click IB "https://github.com/azure-samples/dream-team/blob/main/infra/app/backend.bicep"
    click IF "https://github.com/azure-samples/dream-team/blob/main/infra/app/frontend.bicep"
    click IS "https://github.com/azure-samples/dream-team/tree/main/infra/shared/"

    classDef user fill:#EFEFFF,stroke:#333,stroke-width:1px
    classDef frontend fill:#D0E6FF,stroke:#0366d6,stroke-width:1px
    classDef compute fill:#D0F0D8,stroke:#28a745,stroke-width:1px
    classDef data fill:#FFE5B4,stroke:#ff8c00,stroke-width:1px
    classDef infra fill:#E0E0E0,stroke:#666,stroke-width:1px
```
