# moseskakuno/ai-mail-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/moseskakuno/ai-mail-assistant
- Repository: https://github.com/moseskakuno/ai-mail-assistant

## Overview

AI Mail Assistant is a small Streamlit app for turning a pasted customer email into structured guidance and a reply draft. The user submits an email; the app reads its OpenAI settings, requests analysis, displays the result, and offers a text download. The requested analysis covers category, priority, sentiment, summary, next steps, and a same-language reply. The README also emphasizes human review and that replies are not sent automatically. The graph reflects the single sampled implementation file; its capabilities are not separate modules.

Main entry points: [`app.py`](https://github.com/moseskakuno/ai-mail-assistant/blob/main/app.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_app["Streamlit app<br/>[app.py]"]
  node_settings["API settings<br/>[app.py]"]
end

subgraph group_analysis["AI analysis"]
  node_openai{{"OpenAI API"}}
  node_analysis_result["Email analysis and reply<br/>[app.py]"]
end

subgraph group_results["Review and export"]
  node_review(("Human review"))
  node_download["Text download<br/>[app.py]"]
end

node_user(("Support user"))

node_user -->|"submits email"| node_app
node_app -->|"reads credentials"| node_settings
node_settings -->|"returns settings"| node_app
node_app -->|"requests analysis"| node_openai
node_openai -->|"returns response"| node_app
node_app -->|"displays result"| node_analysis_result
node_analysis_result -->|"is reviewed"| node_review
node_app -->|"offers download"| node_download
node_user -->|"downloads text"| node_download

click node_app "https://github.com/moseskakuno/ai-mail-assistant/blob/main/app.py"
click node_settings "https://github.com/moseskakuno/ai-mail-assistant/blob/main/app.py"
click node_analysis_result "https://github.com/moseskakuno/ai-mail-assistant/blob/main/app.py"
click node_download "https://github.com/moseskakuno/ai-mail-assistant/blob/main/app.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_app,node_settings,node_user toneBlue
class node_openai,node_analysis_result toneAmber
class node_review,node_download toneMint
```

## Components

### User interaction

- [Streamlit app](https://github.com/moseskakuno/ai-mail-assistant/blob/main/app.py): `app.py`
- [API settings](https://github.com/moseskakuno/ai-mail-assistant/blob/main/app.py): `app.py`

### AI analysis

- **OpenAI API**
- [Email analysis and reply](https://github.com/moseskakuno/ai-mail-assistant/blob/main/app.py): `app.py`

### Review and export

- **Human review**
- [Text download](https://github.com/moseskakuno/ai-mail-assistant/blob/main/app.py): `app.py`

### Other components

- **Support user**

## Connections

- Support user → Streamlit app: submits email (evidence: `app.py`)
- Streamlit app → API settings: reads credentials (evidence: `app.py`)
- API settings → Streamlit app: returns settings (evidence: `app.py`)
- Streamlit app → OpenAI API: requests analysis (evidence: `app.py`)
- OpenAI API → Streamlit app: returns response (evidence: `app.py`)
- Streamlit app → Email analysis and reply: displays result (evidence: `app.py`)
- Email analysis and reply → Human review: is reviewed (evidence: `README.md`)
- Streamlit app → Text download: offers download (evidence: `app.py`)
- Support user → Text download: downloads text (evidence: `app.py`)
