# datatalksclub/build-media-agent-workshop architecture

> Architecture diagram of the GitHub repository datatalksclub/build-media-agent-workshop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/datatalksclub/build-media-agent-workshop
- Repository: https://github.com/datatalksclub/build-media-agent-workshop

## Overview

This repository presents a workshop prototype for a media agent: a CPU-based agent coordinates GPU media-generation models, with an image-generation tool as the first capability and text-to-speech added through MCP. The documented workflow also compares always-on Serverless Endpoints with batch Jobs for generating 50 records. The only source excerpt is project metadata; notebook contents were not provided, so notebook-to-component assignments are tentative and relationships below are supported by the README rather than inspected runtime code.

Main entry points: [`notebook.ipynb`](https://github.com/datatalksclub/build-media-agent-workshop/blob/main/notebook.ipynb) (MCP Tool Interface), [`01_simple_media_agent.ipynb`](https://github.com/datatalksclub/build-media-agent-workshop/blob/main/01_simple_media_agent.ipynb) (Image Tool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent Control Plane"]
  node_cpu_agent["CPU Agent<br/>[notebook.ipynb]"]
  node_mcp["MCP Tool Interface<br/>[notebook.ipynb]"]
end

subgraph group_generation["Media Generation"]
  node_image_tool["Image Tool"]
  node_speech_tool["Speech Tool<br/>[notebook.ipynb]"]
  node_image_model["Text-to-Image Model"]
  node_speech_model["Text-to-Speech Model"]
end

subgraph group_execution["GPU Execution"]
  node_object_storage[("Object Storage")]
  node_endpoint["Serverless Endpoint"]
  node_batch_job["Batch Job"]
  node_comparison["Latency and Cost Comparison<br/>[notebook.ipynb]"]
end

node_user(("User"))
node_brief["Media Brief"]

node_user -->|"provides brief"| node_cpu_agent
node_cpu_agent -->|"selects tools"| node_mcp
node_mcp -->|"dispatches"| node_image_tool
node_mcp -->|"dispatches"| node_speech_tool
node_image_tool -->|"invokes"| node_endpoint
node_endpoint -->|"runs"| node_image_model
node_image_tool -->|"returns link"| node_object_storage
node_speech_tool -->|"invokes"| node_speech_model
node_comparison -->|"compares latency"| node_endpoint
node_comparison -->|"compares cost"| node_batch_job
node_batch_job -->|"runs generation"| node_image_model

click node_cpu_agent "https://github.com/datatalksclub/build-media-agent-workshop/blob/main/notebook.ipynb"
click node_mcp "https://github.com/datatalksclub/build-media-agent-workshop/blob/main/notebook.ipynb"
click node_image_tool "https://github.com/datatalksclub/build-media-agent-workshop/blob/main/01_simple_media_agent.ipynb"
click node_speech_tool "https://github.com/datatalksclub/build-media-agent-workshop/blob/main/notebook.ipynb"
click node_comparison "https://github.com/datatalksclub/build-media-agent-workshop/blob/main/notebook.ipynb"

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_cpu_agent,node_mcp,node_user toneBlue
class node_image_tool,node_speech_tool,node_image_model,node_speech_model toneAmber
class node_object_storage,node_endpoint,node_batch_job,node_comparison toneMint
class node_brief toneIndigo
```

## Components

### Agent Control Plane

- [CPU Agent](https://github.com/datatalksclub/build-media-agent-workshop/blob/main/notebook.ipynb): `notebook.ipynb`
- [MCP Tool Interface](https://github.com/datatalksclub/build-media-agent-workshop/blob/main/notebook.ipynb): `notebook.ipynb`

### Media Generation

- [Image Tool](https://github.com/datatalksclub/build-media-agent-workshop/blob/main/01_simple_media_agent.ipynb): `01_simple_media_agent.ipynb`
- [Speech Tool](https://github.com/datatalksclub/build-media-agent-workshop/blob/main/notebook.ipynb): `notebook.ipynb`
- **Text-to-Image Model**
- **Text-to-Speech Model**

### GPU Execution

- **Object Storage**
- **Serverless Endpoint**
- **Batch Job**
- [Latency and Cost Comparison](https://github.com/datatalksclub/build-media-agent-workshop/blob/main/notebook.ipynb): `notebook.ipynb`

### Other components

- **User**
- **Media Brief**

## Connections

- User → CPU Agent: provides brief (evidence: `README.md`)
- CPU Agent → MCP Tool Interface: selects tools (evidence: `README.md`)
- MCP Tool Interface → Image Tool: dispatches (evidence: `README.md`)
- MCP Tool Interface → Speech Tool: dispatches (evidence: `README.md`)
- Image Tool → Serverless Endpoint: invokes (evidence: `README.md`)
- Serverless Endpoint → Text-to-Image Model: runs (evidence: `README.md`)
- Image Tool → Object Storage: returns link (evidence: `README.md`)
- Speech Tool → Text-to-Speech Model: invokes (evidence: `README.md`)
- Latency and Cost Comparison → Serverless Endpoint: compares latency (evidence: `README.md`)
- Latency and Cost Comparison → Batch Job: compares cost (evidence: `README.md`)
- Batch Job → Text-to-Image Model: runs generation (evidence: `README.md`)
