# ajay700-oss/multiple-agent architecture

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

- Interactive diagram: https://gitdiagram.com/ajay700-oss/multiple-agent
- Repository: https://github.com/ajay700-oss/multiple-agent

## Overview

ShopAI is a Flask-backed conversational shopping assistant. A user opens its page, then can submit chat history to the chat endpoint; the endpoint validates and trims history, builds a prompt, and tries configured Gemini keys and models until one responds. The response is returned as JSON. The excerpts show the page-rendering route but not the template or stylesheet contents, so their client-side behavior and any link from the page to the chat endpoint cannot be verified.

Main entry points: [`app.py`](https://github.com/ajay700-oss/multiple-agent/blob/master/app.py) (Chat endpoint), [`templates/index.html`](https://github.com/ajay700-oss/multiple-agent/blob/master/templates/index.html) (Shopping page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["ShopAI web app"]
  node_app["Flask application<br/>[app.py]"]
  node_page["Shopping page<br/>[index.html]"]
  node_style["Page styles<br/>[style.css]"]
  node_health["Health endpoint<br/>[app.py]"]
end

subgraph group_ai["AI conversation"]
  node_chat["Chat endpoint<br/>[app.py]"]
  node_messages["Prompt and history builder<br/>[app.py]"]
end

node_user(("Shopper"))
node_gemini["Gemini models"]

node_app -->|"renders"| node_page
node_app -->|"routes requests"| node_chat
node_app -->|"routes requests"| node_health
node_chat -->|"builds messages"| node_messages
node_chat -->|"calls models"| node_gemini
node_gemini -->|"returns reply"| node_chat

click node_app "https://github.com/ajay700-oss/multiple-agent/blob/master/app.py"
click node_page "https://github.com/ajay700-oss/multiple-agent/blob/master/templates/index.html"
click node_style "https://github.com/ajay700-oss/multiple-agent/blob/master/static/style.css"
click node_chat "https://github.com/ajay700-oss/multiple-agent/blob/master/app.py"
click node_messages "https://github.com/ajay700-oss/multiple-agent/blob/master/app.py"
click node_health "https://github.com/ajay700-oss/multiple-agent/blob/master/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_page,node_style,node_health toneBlue
class node_chat,node_messages toneAmber
class node_user,node_gemini toneIndigo
```

## Components

### ShopAI web app

- [Flask application](https://github.com/ajay700-oss/multiple-agent/blob/master/app.py): `app.py`
- [Shopping page](https://github.com/ajay700-oss/multiple-agent/blob/master/templates/index.html): `templates/index.html`
- [Page styles](https://github.com/ajay700-oss/multiple-agent/blob/master/static/style.css): `static/style.css`
- [Health endpoint](https://github.com/ajay700-oss/multiple-agent/blob/master/app.py): `app.py`

### AI conversation

- [Chat endpoint](https://github.com/ajay700-oss/multiple-agent/blob/master/app.py): `app.py`
- [Prompt and history builder](https://github.com/ajay700-oss/multiple-agent/blob/master/app.py): `app.py`

### Other components

- **Shopper**
- **Gemini models**

## Connections

- Flask application → Shopping page: renders (evidence: `app.py`)
- Flask application → Chat endpoint: routes requests (evidence: `app.py`)
- Flask application → Health endpoint: routes requests (evidence: `app.py`)
- Chat endpoint → Prompt and history builder: builds messages (evidence: `app.py`)
- Chat endpoint → Gemini models: calls models (evidence: `app.py`)
- Gemini models → Chat endpoint: returns reply (evidence: `app.py`)
