# microsoft/openaiworkshop architecture

> Architecture diagram of the GitHub repository microsoft/openaiworkshop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/openaiworkshop
- Repository: https://github.com/microsoft/openaiworkshop

## Overview

##### Project type and purpose
- This is a full-stack “Agentic AI Workshop” application that lets users build, compare, and run single- and multi-agent solutions using Microsoft Azure AI Agent Service, Semantic Kernel, or Autogen.
- The README and ARCHITECTURE.md emphasize a FastAPI backend, a Streamlit frontend, a pluggable agent framework, a small backend microservice (MCP), and a SQLite knowledge base.

##### File structure
- Top-level directories and files:
- agentic_ai/agents – all agent implementations (base, Azure Agent Service, Autogen, Semantic Kernel; single & multi-agent)
- agentic_ai/applications – the application entrypoints (frontend.py = Streamlit, backend.py = FastAPI, run scripts, .env sample, requirements)
- agentic_ai/backend_services – an MCP microservice (Python + Dockerfile + SQLite DB + data files + deployment script)
- Various markdowns (SETUP.md, ARCHITECTURE.md, SCENARIO.md, DATA.md) describing environment, architecture, scenario, and data.
- Configuration artifacts: .env, Dockerfile.mcp, deploy_azure.sh, run_application.sh.

##### README for additional insights
- Confirms the 3 agent platforms, the full-stack design, session-based chat, environment configuration, and the existence of RESTful endpoints (chat, reset, history).

##### Elements
- Clear labels on each component (e.g., “Streamlit Frontend,” “FastAPI Backend,” “Agent Manager,” “Autogen Agent,” “Azure AI Service,” “MCP Microservice,” “SQLite DB”)
– Agent implementation plugins (shaded group)

##### Final recommendations
- Be detailed: break the agent layer into its subcomponents (single vs. multi, each platform).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        UI["Streamlit Frontend"]:::ui
    end

    %% Backend Layer
    subgraph "Backend Layer"
        API["FastAPI Backend"]:::backend
        Config[".env Configuration"]:::config
        RunScript["Run Application Script"]:::script
        AgentMgr["Agent Manager & Orchestration"]:::backend
    end

    %% Agent Implementations
    subgraph "Agent Implementations"
        Base["Base Agent"]:::agent
        subgraph "Azure AI Agent Service"
            AzureAgent["Azure Service Agent"]:::agent
        end
        subgraph "Autogen Agents"
            AG_Single_Loop["Loop Agent"]:::agent
            AG_Single_Console["Console Sample Agent"]:::agent
            subgraph "Multi-Agent"
                AG_MRR["Round Robin Agent"]:::agent
                AG_MSel["Selector Group Agent"]:::agent
                AG_Handoff["Handoff Multi-Domain Agent"]:::agent
                AG_Reflect["Reflection Agent"]:::agent
                AG_SampMA["Sample Console Agent"]:::agent
            end
        end
        subgraph "Semantic Kernel Agents"
            SK_Single["Chat Agent"]:::agent
            subgraph "Multi-Agent"
                SK_Collab["Collaborative Agent"]:::agent
                SK_Handoff_SK["Handoff Agent"]:::agent
                SK_Reflect_SK["Reflection Agent"]:::agent
            end
        end
    end

    %% Microservice Layer
    subgraph "Microservice Layer"
        MCP["MCP Microservice"]:::service
    end

    %% Data Stores
    subgraph "Data Stores"
        DB["SQLite Database"]:::db
        KB["Knowledge Base (kb.json)"]:::db
    end

    %% External Services
    subgraph "External AI Services"
        AzureAPI["Azure OpenAI Service"]:::external
        SKService["Semantic Kernel Runtime"]:::external
    end

    %% Connections
    UI -->|chat request| API
    API -->|reads config| Config
    RunScript -->|launches| API
    API -->|invoke| AgentMgr
    AgentMgr -->|uses plugin| Base
    AgentMgr --> AzureAgent
    AgentMgr --> AG_Single_Loop
    AgentMgr --> AG_Single_Console
    AgentMgr --> AG_MRR
    AgentMgr --> AG_MSel
    AgentMgr --> AG_Handoff
    AgentMgr --> AG_Reflect
    AgentMgr --> AG_SampMA
    AgentMgr --> SK_Single
    AgentMgr --> SK_Collab
    AgentMgr --> SK_Handoff_SK
    AgentMgr --> SK_Reflect_SK

    AzureAgent -->|calls| AzureAPI
    AG_Single_Loop -->|calls| AzureAPI
    AG_Single_Console -->|calls| AzureAPI
    AG_MRR -->|calls| AzureAPI
    AG_MSel -->|calls| AzureAPI
    AG_Handoff -->|calls| AzureAPI
    AG_Reflect -->|calls| AzureAPI
    AG_SampMA -->|calls| AzureAPI
    SK_Single -->|calls| SKService
    SK_Collab -->|calls| SKService
    SK_Handoff_SK -->|calls| SKService
    SK_Reflect_SK -->|calls| SKService

    AgentMgr -->|requests orchestration| MCP
    MCP -->|reads/writes| DB
    MCP -->|reads| KB
    API -->|session history| DB
    API -->|knowledge lookup| KB
    API -->|response| UI

    %% Click Events
    click UI "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/applications/frontend.py"
    click API "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/applications/backend.py"
    click Config "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/applications/.env.sample"
    click RunScript "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/applications/run_application.sh"
    click Base "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/base_agent.py"
    click AzureAgent "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/agent_service/single_agent/agent.py"
    click AG_Single_Loop "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/autogen/single_agent/loop_agent.py"
    click AG_Single_Console "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/autogen/single_agent/sample_console_agent.py"
    click AG_MRR "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/autogen/multi_agent/collaborative_multi_agent_round_robin.py"
    click AG_MSel "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/autogen/multi_agent/collaborative_multi_agent_selector_group.py"
    click AG_Handoff "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/autogen/multi_agent/handoff_multi_domain_agent.py"
    click AG_Reflect "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/autogen/multi_agent/reflection_agent.py"
    click AG_SampMA "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/autogen/multi_agent/sample_console_agent.py"
    click SK_Single "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/semantic_kernel/single_agent/chat_agent.py"
    click SK_Collab "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/semantic_kernel/multi_agent/collaborative_multi_agent.py"
    click SK_Handoff_SK "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/semantic_kernel/multi_agent/handoff_multi_agent.py"
    click SK_Reflect_SK "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/agents/semantic_kernel/multi_agent/reflection_agent.py"
    click MCP "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/backend_services/mcp_service.py"
    click MCP "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/backend_services/Dockerfile.mcp"
    click DB "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/backend_services/data/contoso.db"
    click KB "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/backend_services/data/kb.json"
    click DB "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/backend_services/data/create_db.py"
    click MCP "https://github.com/microsoft/openaiworkshop/blob/main/agentic_ai/backend_services/deploy_azure.sh"

    %% Styles
    classDef ui fill:#AEDFF7,stroke:#0279C4,color:#000;
    classDef backend fill:#E2E2F1,stroke:#6F61AC,color:#000;
    classDef agent fill:#FFF2CC,stroke:#D4A017,color:#000;
    classDef service fill:#FDE2E1,stroke:#D1495B,color:#000;
    classDef db fill:#D3E4CD,stroke:#2F5D62,color:#000;
    classDef external fill:#E8F6EF,stroke:#2E8B57,color:#000;
    classDef config fill:#E8E8E8,stroke:#808080,color:#000;
    classDef script fill:#F0E68C,stroke:#BDB76B,color:#000;
```
