# deeparajasabeson/microsoftfoundryportal-multiagents architecture

> Architecture diagram of the GitHub repository deeparajasabeson/microsoftfoundryportal-multiagents, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deeparajasabeson/microsoftfoundryportal-multiagents
- Repository: https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents

## Overview

This repository is a FastAPI customer-service multi-agent demo. A customer query enters the query endpoint, is classified by a coordinator, then goes to support, sales, or a general LLM response. Specialist agents are initialized with purpose-specific tool definitions; the shared Foundry client manages agent versions and conversations, and provides cleanup. The README also documents deployment information and cleanup endpoints. Relationships below are based on the README and excerpted files; no database is shown, and the tool definitions and local function-call dispatcher do not appear to have matching function names.

Main entry points: [`agents/client.py`](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/client.py) (Foundry Client), [`main.py`](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/main.py) (FastAPI Endpoints), [`agents/coordinator.py`](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/coordinator.py) (Coordinator), [`agents/support.py`](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/support.py) (Support Agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_api["FastAPI Endpoints<br/>[main.py]"]
  node_deployment["Deployment Info<br/>[main.py]"]
  node_cleanup["Agent Cleanup<br/>[main.py]"]
end

subgraph group_routing["Query Routing"]
  node_coordinator["Coordinator<br/>[coordinator.py]"]
  node_general["General Assistant<br/>[coordinator.py]"]
end

subgraph group_specialists["Specialist Agents"]
  node_support["Support Agent<br/>[support.py]"]
  node_sales["Sales Agent<br/>[sales.py]"]
  node_base["Agent Base<br/>[base.py]"]
  node_tooldefs["Tool Definitions<br/>[tools.py]"]
end

subgraph group_foundry["Foundry Integration"]
  node_client["Foundry Client<br/>[client.py]"]
  node_function_dispatch["Function Dispatcher<br/>[client.py]"]
end

node_customer(("Customer"))
node_azure_foundry{{"Azure AI Foundry"}}
node_model{{"LLM Responses"}}

node_customer -->|"submits query"| node_api
node_api -->|"routes query"| node_coordinator
node_api -->|"initializes"| node_support
node_api -->|"initializes"| node_sales
node_api -->|"initializes"| node_coordinator
node_coordinator -->|"requests routing"| node_client
node_coordinator -->|"dispatches support"| node_support
node_coordinator -->|"dispatches sales"| node_sales
node_coordinator -->|"handles general"| node_general
node_general -->|"requests response"| node_model
node_support -->|"inherits"| node_base
node_sales -->|"inherits"| node_base
node_support -->|"configures FAQ tools"| node_tooldefs
node_sales -->|"configures promotion tool"| node_tooldefs
node_base -->|"creates and runs agents"| node_client
node_client -->|"creates agent versions"| node_azure_foundry
node_client -->|"creates conversations"| node_azure_foundry
node_client -->|"runs agent responses"| node_azure_foundry
node_client -->|"executes calls"| node_function_dispatch
node_function_dispatch -->|"returns tool results"| node_client
node_api -->|"reads deployment settings"| node_client
node_api -->|"cleans up agents"| node_client
node_client -->|"deletes versions"| node_azure_foundry

click node_api "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/main.py"
click node_deployment "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/main.py"
click node_cleanup "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/main.py"
click node_coordinator "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/coordinator.py"
click node_general "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/coordinator.py"
click node_support "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/support.py"
click node_sales "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/sales.py"
click node_base "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/base.py"
click node_tooldefs "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/tools.py"
click node_client "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/client.py"
click node_function_dispatch "https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/client.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_deployment,node_cleanup toneBlue
class node_coordinator,node_general toneAmber
class node_support,node_sales,node_base,node_tooldefs toneMint
class node_client,node_function_dispatch toneRose
class node_customer,node_azure_foundry,node_model toneIndigo
```

## Components

### HTTP API

- [FastAPI Endpoints](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/main.py): `main.py`
- [Deployment Info](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/main.py): `main.py`
- [Agent Cleanup](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/main.py): `main.py`

### Query Routing

- [Coordinator](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/coordinator.py): `agents/coordinator.py`
- [General Assistant](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/coordinator.py): `agents/coordinator.py`

### Specialist Agents

- [Support Agent](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/support.py): `agents/support.py`
- [Sales Agent](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/sales.py): `agents/sales.py`
- [Agent Base](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/base.py): `agents/base.py`
- [Tool Definitions](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/tools.py): `agents/tools.py`

### Foundry Integration

- [Foundry Client](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/client.py): `agents/client.py`
- [Function Dispatcher](https://github.com/deeparajasabeson/microsoftfoundryportal-multiagents/blob/main/agents/client.py): `agents/client.py`

### Other components

- **Customer**
- **Azure AI Foundry**
- **LLM Responses**

## Connections

- Customer → FastAPI Endpoints: submits query (evidence: `README.md`)
- FastAPI Endpoints → Coordinator: routes query (evidence: `main.py`)
- FastAPI Endpoints → Support Agent: initializes (evidence: `main.py`)
- FastAPI Endpoints → Sales Agent: initializes (evidence: `main.py`)
- FastAPI Endpoints → Coordinator: initializes (evidence: `main.py`)
- Coordinator → Foundry Client: requests routing (evidence: `agents/coordinator.py`)
- Coordinator → Support Agent: dispatches support (evidence: `agents/coordinator.py`)
- Coordinator → Sales Agent: dispatches sales (evidence: `agents/coordinator.py`)
- Coordinator → General Assistant: handles general (evidence: `agents/coordinator.py`)
- General Assistant → LLM Responses: requests response (evidence: `agents/coordinator.py`)
- Support Agent → Agent Base: inherits (evidence: `agents/support.py`)
- Sales Agent → Agent Base: inherits (evidence: `agents/sales.py`)
- Support Agent → Tool Definitions: configures FAQ tools (evidence: `agents/support.py`)
- Sales Agent → Tool Definitions: configures promotion tool (evidence: `agents/sales.py`)
- Agent Base → Foundry Client: creates and runs agents (evidence: `agents/base.py`)
- Foundry Client → Azure AI Foundry: creates agent versions (evidence: `agents/client.py`)
- Foundry Client → Azure AI Foundry: creates conversations (evidence: `agents/client.py`)
- Foundry Client → Azure AI Foundry: runs agent responses (evidence: `agents/client.py`)
- Foundry Client → Function Dispatcher: executes calls (evidence: `agents/client.py`)
- Function Dispatcher → Foundry Client: returns tool results (evidence: `agents/client.py`)
- FastAPI Endpoints → Foundry Client: reads deployment settings (evidence: `main.py`)
- FastAPI Endpoints → Foundry Client: cleans up agents (evidence: `main.py`)
- Foundry Client → Azure AI Foundry: deletes versions (evidence: `agents/client.py`)
