# talkitdoit/azure-ai-agent-team architecture

> Architecture diagram of the GitHub repository talkitdoit/azure-ai-agent-team, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/talkitdoit/azure-ai-agent-team
- Repository: https://github.com/talkitdoit/azure-ai-agent-team

## Overview

#### Purpose and entry point
This is a Python 3.11+ batch code-review application. It scans a local input directory, routes each supported source file to a language-specialized Azure AI Foundry agent, and writes a consolidated Markdown report. The executable entry point is `agent_team_code_review.py`; its primary input/output boundary is `code-input/` → `code_review_report.md`.

#### Runtime and Azure boundary
The process runs locally under Python, with dependency definitions in `requirements.txt` and `pyproject.toml`. It loads environment settings from `.env` (template: `.env_sample`), notably `PROJECT_ENDPOINT` and `MODEL_DEPLOYMENT_NAME`. Authentication is delegated to Azure Default Credentials, supporting Azure CLI login locally and service-principal environment variables in CI/production. The remote execution boundary is Azure AI Foundry/Azure OpenAI model deployments.

#### Orchestration layer
`agent_team_code_review.py` coordinates the review run: initialize Azure connectivity, load agent definitions, discover reviewable files, invoke agents, and produce the final report. It is the control-plane owner for lifecycle sequencing and likely the correct integration point for CLI options, batching, failure policy, or report-level metadata.

#### Agent-team abstraction
`utils/agent_team.py` encapsulates creation and use of the multi-agent team. This separates Azure agent/client mechanics from the application workflow and is the key boundary for changing agent execution models, polling/thread behavior, prompt submission, or result collection. Team-specific behavior is configured by `utils/agent_team_config.yaml`.

#### Language routing and specialist agents
`language_agents.yaml` defines the architecture’s routing table: source-file extensions map to language identifiers, which map to named expert agents and their review instructions. The orchestrator uses this configuration to select an appropriate reviewer per file rather than applying one generic prompt. Adding language support should primarily be a configuration change here, subject to supported agent-team behavior in `utils/agent_team.py`.

#### Review data flow
1. Source files are discovered under `code-input/`.
2. File extensions are resolved through `language_agents.yaml`.
3. Supported files and their contents are sent to a corresponding Azure-hosted language agent.
4. Agent responses are aggregated by the orchestrator.
5. The combined review is persisted as `code_review_report.md`.

Current example inputs span C# and Python: `code-input/AzureResourceService.cs` and `code-input/cloud_resources.py`. Unsupported or absent input files are an explicit operational boundary.

#### Observability and output
The application supports OpenTelemetry-based Azure AI tracing, with tracing guidance in `README_TRACING.md`. When Azure AI Foundry/Application Insights is configured, agent execution and model interactions can be inspected remotely; content capture is governed by `AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED`. The durable local product is the generated Markdown report at `code_review_report.md`, while console output provides run-progress feedback.

Main entry points: [`agent_team_code_review.py`](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/agent_team_code_review.py) (Review orchestrator), [`utils/agent_team.py`](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/utils/agent_team.py) (Agent team adapter), [`code-input/AzureResourceService.cs`](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/code-input/AzureResourceService.cs) (C# example source), [`code-input/cloud_resources.py`](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/code-input/cloud_resources.py) (Python example source)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_local["Local batch runtime"]
  node_entry["Review orchestrator<br/>Python entry point"]
  node_input["Source input directory<br/>input files"]
  node_csharp_input["C&#35; example source<br/>C&#35; source"]
  node_python_input["Python example source<br/>Python source<br/>[cloud_resources.py]"]
  node_report["Markdown review report<br/>durable output"]
  node_console["Console progress<br/>runtime output"]
  node_team["Agent team adapter<br/>Azure agent abstraction<br/>[agent_team.py]"]
end

subgraph group_config["Configuration"]
  node_routing["Language routing table<br/>agent mapping"]
  node_team_config["Agent team configuration"]
  node_environment["Environment settings<br/>environment variables"]
  node_env_template["Environment template<br/>setup template<br/>[.env_sample]"]
  node_dependencies["Python dependencies<br/>dependency definition<br/>[requirements.txt]"]
  node_project["Python project metadata<br/>package definition<br/>[pyproject.toml]"]
end

subgraph group_azure["Azure services"]
  node_credentials{{"Azure Default Credentials<br/>authentication"}}
  node_foundry{{"Azure AI Foundry agents<br/>remote agent runtime"}}
  node_models{{"Azure OpenAI deployment<br/>model deployment"}}
  node_tracing["Azure AI tracing<br/>remote observability<br/>[README_TRACING.md]"]
end

node_csharp_input -->|"contained in"| node_input
node_python_input -->|"contained in"| node_input
node_input -->|"discover files"| node_entry
node_routing -->|"resolve reviewer"| node_entry
node_environment -->|"load settings"| node_entry
node_env_template -.->|"template"| node_environment
node_dependencies -.->|"runtime dependencies"| node_entry
node_project -.->|"Python 3.11+ project"| node_entry
node_entry -->|"invoke per supported file"| node_team
node_team_config -->|"configure team"| node_team
node_team -->|"authenticate"| node_credentials
node_credentials -->|"authorize access"| node_foundry
node_team -->|"submit prompts and collect results"| node_foundry
node_environment -->|"select deployment"| node_models
node_foundry -->|"execute reviews"| node_models
node_entry -->|"aggregate and write Markdown"| node_report
node_entry -->|"emit progress"| node_console
node_team -.->|"emit OpenTelemetry traces"| node_tracing

click node_entry "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/agent_team_code_review.py"
click node_csharp_input "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/code-input/AzureResourceService.cs"
click node_python_input "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/code-input/cloud_resources.py"
click node_report "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/code_review_report.md"
click node_team "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/utils/agent_team.py"
click node_routing "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/language_agents.yaml"
click node_team_config "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/utils/agent_team_config.yaml"
click node_env_template "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/.env_sample"
click node_dependencies "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/requirements.txt"
click node_project "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/pyproject.toml"
click node_tracing "https://github.com/talkitdoit/azure-ai-agent-team/blob/main/README_TRACING.md"

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_entry,node_input,node_csharp_input,node_python_input,node_report,node_console,node_team toneBlue
class node_routing,node_team_config,node_environment,node_env_template,node_dependencies,node_project toneAmber
class node_credentials,node_foundry,node_models,node_tracing toneMint
```

## Components

### Local batch runtime

- [Review orchestrator](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/agent_team_code_review.py): Python entry point · Coordinates discovery, routing, agent calls, and report generation. · `agent_team_code_review.py`
- **Source input directory**: input files · Supported files are discovered recursively for review.
- [C# example source](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/code-input/AzureResourceService.cs): C# source · `code-input/AzureResourceService.cs`
- [Python example source](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/code-input/cloud_resources.py): Python source · `code-input/cloud_resources.py`
- [Markdown review report](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/code_review_report.md): durable output · Consolidated review output. · `code_review_report.md`
- **Console progress**: runtime output
- [Agent team adapter](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/utils/agent_team.py): Azure agent abstraction · Encapsulates agent creation, invocation, polling, and result collection. · `utils/agent_team.py`

### Configuration

- [Language routing table](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/language_agents.yaml): agent mapping · Maps file extensions to specialist agents and review instructions. · `language_agents.yaml`
- [Agent team configuration](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/utils/agent_team_config.yaml): team config · `utils/agent_team_config.yaml`
- **Environment settings**: environment variables · Supplies endpoint and model deployment settings.
- [Environment template](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/.env_sample): setup template · `.env_sample`
- [Python dependencies](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/requirements.txt): dependency definition · `requirements.txt`
- [Python project metadata](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/pyproject.toml): package definition · `pyproject.toml`

### Azure services

- **Azure Default Credentials**: authentication · Uses Azure CLI locally or service-principal variables in CI.
- **Azure AI Foundry agents**: remote agent runtime · Hosts language-specialized agents and model execution.
- **Azure OpenAI deployment**: model deployment
- [Azure AI tracing](https://github.com/talkitdoit/azure-ai-agent-team/blob/main/README_TRACING.md): remote observability · Optional OpenTelemetry traces can be inspected in Foundry or Application Insights. · `README_TRACING.md`

## Connections

- C# example source → Source input directory: contained in
- Python example source → Source input directory: contained in
- Source input directory → Review orchestrator: discover files
- Language routing table → Review orchestrator: resolve reviewer
- Environment settings → Review orchestrator: load settings
- Environment template → Environment settings: template
- Python dependencies → Review orchestrator: runtime dependencies
- Python project metadata → Review orchestrator: Python 3.11+ project
- Review orchestrator → Agent team adapter: invoke per supported file
- Agent team configuration → Agent team adapter: configure team
- Agent team adapter → Azure Default Credentials: authenticate
- Azure Default Credentials → Azure AI Foundry agents: authorize access
- Agent team adapter → Azure AI Foundry agents: submit prompts and collect results
- Environment settings → Azure OpenAI deployment: select deployment
- Azure AI Foundry agents → Azure OpenAI deployment: execute reviews
- Review orchestrator → Markdown review report: aggregate and write Markdown
- Review orchestrator → Console progress: emit progress
- Agent team adapter → Azure AI tracing: emit OpenTelemetry traces
