# microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp architecture

> Architecture diagram of the GitHub repository microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp
- Repository: https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp

## Overview

##### Project type and purpose
- This is not a standard web or mobile app, but a hands-on lab/tutorial repository for “LAB571: Build a Pizza Ordering Agent with Microsoft Foundry and MCP.”
- The goal is to demonstrate how to build, prompt-tune, and extend a domain-specific AI agent (the Contoso PizzaBot) using:
- Microsoft Foundry Agent Service (for hosting and running the agent)
- Python (the implementation language via the Foundry SDK)
- RAG (Retrieval-Augmented Generation) for knowledge
- Tool calling (e.g., pizza calculator)
- MCP (Microsoft Cloud Platform) for live menu and order handling

##### File structure
- Top-level config:
- .devcontainer/, .vscode/ – development environment settings (VS Code + Docker)
- .github/ – CI/workflow and contributor guidance
- requirements.txt – Python dependencies (Foundry SDK, Azure SDKs, etc.)
- Documentation & lab flows:
- lab/1.md–lab/6.md – step-by-step workshop modules
- lab/foundry/ – likely the sample code that students will run
- AGENTS.md – details on agent definitions
- No “frontend” or “backend” folders per se, because this is a service-based AI agent with no UI code in this repo.

##### README for additional insights
- Confirms the session teaches: system prompts, custom instructions, RAG, tool calling, MCP integration
- Mentions Python and the Foundry SDK as the technical stack

##### Main components
a. Developer Environment
- VS Code (local machine / devcontainer)
- Python + Foundry SDK (requirements.txt)
- GitHub actions (for CI, automated lab validation)
b. Agent Service (Hosted in Microsoft Foundry)
- Core “PizzaBot” agent definition (system prompt, user prompt flows)
- Components: Prompt templates, RAG retriever, tool‐calling interface
c. Tools & Skills
- Pizza Calculator (Python function or microservice)
- Additional skill modules as defined in AGENTS.md
d. Knowledge Store (RAG)
- Vector store / embeddings (e.g., Azure Cognitive Search + Azure OpenAI)
- Source documents (menu, FAQs) loaded at runtime
e. External Services (via MCP)
- Live menu API (Contoso Pizza Menu Service)
- Order Management API (place, update, retrieve orders)
f. End Users
- Chat interface (CLI, custom frontend, or VS Code extension) interacting with the running agent

##### Relationships and interactions
- Developer pushes code (labs & agent definitions) → CI/CD → Foundry Agent Service
- End user sends a query → Foundry Agent Service
→ system prompt + user prompt processed
→ RAG retriever queries vector store for domain knowledge
→ tool‐calling layer invokes Pizza Calculator or MCP APIs
→ Aggregated response returned to user
- Any data or telemetry flows back to Azure (monitoring/logging)

##### Architectural patterns & design principles
- Modular “Skill” or “Tool” pattern for each unit of functionality (calculator, order API)
- RAG pattern: separation of prompt logic and knowledge retrieval
- Service-oriented: the agent orchestrates external microservices rather than hard-coding logic

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Environment
    subgraph "Developer Environment"
        direction TB
        DevContainer["VS Code + DevContainer"]:::dev
        VSCode["VS Code Settings"]:::dev
        Requirements["Python + Foundry SDK\n(requirements.txt)"]:::compute
    end

    %% CI/CD
    subgraph "CI/CD Pipeline"
        direction TB
        CI["GitHub Actions\n(add-to-project.yml)"]:::dev
        Instructions["MS Learn Instructions\n(MSLearn.instructions.md)"]:::dev
    end

    %% Agent Service
    subgraph "Foundry Agent Service" 
        direction TB
        AgentCore["PizzaBot Agent Service"]:::service
        PromptTemplates["Prompt Templates"]:::service
        RAGRetriever["RAG Retriever"]:::service
        ToolInterface["Tool‐Calling Interface"]:::service
        AgentCore -->|uses| PromptTemplates
        AgentCore -->|queries| RAGRetriever
        AgentCore -->|invokes| ToolInterface
    end

    %% Tool Modules
    subgraph "Tool Modules"
        direction TB
        PizzaCalc["Pizza Calculator"]:::service
        OrderSkill["Order API Skill"]:::service
    end

    %% Knowledge Store
    subgraph "Knowledge Store"
        direction TB
        VectorStore["Vector Store\n(Azure Cognitive Search + OpenAI)"]:::datastore
    end

    %% External Services
    subgraph "External Services"
        direction TB
        LiveMenu["Live Menu API\n(Contoso Pizza)"]:::external
        OrderAPI["Order Management API"]:::external
    end

    %% End User
    subgraph "End User"
        direction TB
        UserInterface["Chat Interface\n(CLI/Frontend/VSCode)"]:::external
    end

    %% Flows
    DevContainer -->|code push| CI
    VSCode --> CI
    Requirements --> CI

    CI -->|deploy code| AgentCore

    UserInterface -->|user query| AgentCore
    AgentCore -->|retrieve knowledge| VectorStore
    VectorStore -->|return docs| AgentCore
    AgentCore -->|call tool| PizzaCalc
    AgentCore -->|call tool| OrderSkill
    PizzaCalc -->|compute| AgentCore
    OrderSkill -->|invoke| LiveMenu
    OrderSkill -->|invoke| OrderAPI
    LiveMenu -->|response| AgentCore
    OrderAPI -->|response| AgentCore
    AgentCore -->|response| UserInterface

    %% Click Events
    click DevContainer "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/.devcontainer/devcontainer.json"
    click VSCode "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/tree/main/.vscode/"
    click Requirements "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/requirements.txt"
    click CI "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/.github/workflows/add-to-project.yml"
    click Instructions "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/.github/instructions/MSLearn.instructions.md"
    click AgentCore "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/tree/main/lab/foundry/"
    click PromptTemplates "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/AGENTS.md"
    click PizzaCalc "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/AGENTS.md"
    click OrderSkill "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/AGENTS.md"
    click VectorStore "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/requirements.txt"
    click UserInterface "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/README.md"
    click Lab1 "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/lab/1.md"
    click Lab2 "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/lab/2.md"
    click Lab3 "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/lab/3.md"
    click Lab4 "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/lab/4.md"
    click Lab5 "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/lab/5.md"
    click Lab6 "https://github.com/microsoft/ignite25-lab571-build-a-pizza-ordering-agent-with-microsoft-foundry-and-mcp/blob/main/lab/6.md"

    %% Styles
    classDef dev fill:#d3d3d3,stroke:#999,stroke-width:1px
    classDef compute fill:#b2f2bb,stroke:#2f8f2f,stroke-width:1px
    classDef service fill:#8fd3f4,stroke:#0e6fbf,stroke-width:1px
    classDef datastore fill:#a0c4ff,stroke:#003f91,stroke-width:1px
    classDef external fill:#ffd6a5,stroke:#bf5f00,stroke-width:1px
```
