# thirumurugan240/content_marketing_agent architecture

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

- Interactive diagram: https://gitdiagram.com/thirumurugan240/content_marketing_agent
- Repository: https://github.com/thirumurugan240/content_marketing_agent

## Overview

This Streamlit app accepts a topic and generates an SEO-optimized article through a sequential research, writing, and SEO workflow. The UI tracks agent progress and keeps generated articles in session-state chat history. The source shows the workflow configuration and UI call; it does not expose the internals of CrewAI or the search service.

Main entry points: [`app.py`](https://github.com/thirumurugan240/content_marketing_agent/blob/main/app.py) (Topic UI), [`crew.py`](https://github.com/thirumurugan240/content_marketing_agent/blob/main/crew.py) (Crew Runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Streamlit Interface"]
  node_ui["Topic UI<br/>[app.py]"]
  node_chats[("Chat History<br/>[app.py]")]
end

subgraph group_workflow["Content Workflow"]
  node_crew["Crew Runner<br/>[crew.py]"]
  node_research["Trend Research<br/>[crew.py]"]
  node_writing["Article Writing<br/>[crew.py]"]
  node_seo["SEO Optimization<br/>[crew.py]"]
end

node_user(("User"))
node_search["Google Search"]

node_user -->|"enters topic"| node_ui
node_ui -->|"invokes generation"| node_crew
node_crew -->|"runs first"| node_research
node_research -->|"provides context"| node_writing
node_writing -->|"provides context"| node_seo
node_research -->|"uses tool"| node_search
node_crew -->|"returns article"| node_ui
node_ui -->|"stores article"| node_chats
node_chats -->|"supplies selected chat"| node_ui

click node_ui "https://github.com/thirumurugan240/content_marketing_agent/blob/main/app.py"
click node_chats "https://github.com/thirumurugan240/content_marketing_agent/blob/main/app.py"
click node_crew "https://github.com/thirumurugan240/content_marketing_agent/blob/main/crew.py"
click node_research "https://github.com/thirumurugan240/content_marketing_agent/blob/main/crew.py"
click node_writing "https://github.com/thirumurugan240/content_marketing_agent/blob/main/crew.py"
click node_seo "https://github.com/thirumurugan240/content_marketing_agent/blob/main/crew.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_ui,node_chats,node_user toneBlue
class node_crew,node_research,node_writing,node_seo toneAmber
class node_search toneIndigo
```

## Components

### Streamlit Interface

- [Topic UI](https://github.com/thirumurugan240/content_marketing_agent/blob/main/app.py): `app.py`
- [Chat History](https://github.com/thirumurugan240/content_marketing_agent/blob/main/app.py): `app.py`

### Content Workflow

- [Crew Runner](https://github.com/thirumurugan240/content_marketing_agent/blob/main/crew.py): `crew.py`
- [Trend Research](https://github.com/thirumurugan240/content_marketing_agent/blob/main/crew.py): `crew.py`
- [Article Writing](https://github.com/thirumurugan240/content_marketing_agent/blob/main/crew.py): `crew.py`
- [SEO Optimization](https://github.com/thirumurugan240/content_marketing_agent/blob/main/crew.py): `crew.py`

### Other components

- **User**
- **Google Search**

## Connections

- User → Topic UI: enters topic (evidence: `app.py`)
- Topic UI → Crew Runner: invokes generation (evidence: `app.py`)
- Crew Runner → Trend Research: runs first (evidence: `crew.py`)
- Trend Research → Article Writing: provides context (evidence: `crew.py`)
- Article Writing → SEO Optimization: provides context (evidence: `crew.py`)
- Trend Research → Google Search: uses tool (evidence: `crew.py`)
- Crew Runner → Topic UI: returns article (evidence: `crew.py`)
- Topic UI → Chat History: stores article (evidence: `app.py`)
- Chat History → Topic UI: supplies selected chat (evidence: `app.py`)
