# tharani927/infosys_freightquote_ai architecture

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

- Interactive diagram: https://gitdiagram.com/tharani927/infosys_freightquote_ai
- Repository: https://github.com/tharani927/infosys_freightquote_ai

## Overview

FreightQuote AI is a Streamlit maritime-freight decision-support platform. The documented user workflow combines route and port analysis, pricing, carrier and weather risk, margin, customs, document handling, translation, and PDF retrieval, with a Copilot for grounded questions. The sampled Milestone2 application provides authentication, operational views, ML models, alerts, and administration. The README documents additional agents and capabilities whose implementations are not identifiable in the sampled source, so they are represented as documented subsystems rather than inferred call chains.

Main entry points: [`Milestone2/app.py`](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/app.py) (Streamlit platform), [`Milestone2/db.py`](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/db.py) (FreightQuote SQLite), [`Milestone2`](https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2) (Other freight agents), [`Milestone2/notifications.py`](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/notifications.py) (Notification center)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Platform experience"]
  node_app["Streamlit platform<br/>[app.py]"]
  node_copilot["AI Copilot<br/>[app.py]"]
  node_theme["Shared UI theme<br/>[ui_theme.py]"]
end

subgraph group_freight["Freight intelligence"]
  node_pricing["Freight pricing<br/>[agent2_freight.py]"]
  node_route["Route and weather risk<br/>[agent2_freight.py]"]
  node_carrier["Carrier audit<br/>[agent3_freight.py]"]
  node_weather["Port weather context<br/>[weather_context.py]"]
  node_other_agents["Other freight agents"]
  node_customs["Customs and tariffs"]
  node_documents["OCR and documents"]
  node_translation["Maritime translation"]
end

subgraph group_services["Platform services"]
  node_rag["PDF knowledge RAG"]
  node_llm["LLM generation<br/>[llm_engine.py]"]
  node_ml["ML training<br/>[train_ml.py]"]
  node_db[("FreightQuote SQLite<br/>[db.py]")]
end

subgraph group_governance["Access and operations"]
  node_auth["Authentication and RBAC<br/>[auth.py]"]
  node_admin["Admin dashboard<br/>[admin_dash.py]"]
  node_alerts["Notification center<br/>[notifications.py]"]
end

node_user(("Freight user"))

node_user -->|"uses"| node_app
node_app -->|"requires session"| node_auth
node_app -->|"presents"| node_copilot
node_app -->|"routes to"| node_pricing
node_app -->|"routes to"| node_route
node_app -->|"routes to"| node_carrier
node_app -->|"routes to"| node_admin
node_app -->|"uses"| node_weather
node_app -->|"uses"| node_alerts
node_app -->|"uses"| node_llm
node_app -->|"reads"| node_db
node_app -->|"invokes"| node_ml
node_pricing -.->|"uses context"| node_weather
node_route -.->|"reads conditions"| node_weather
node_carrier -->|"updates carriers"| node_db
node_carrier -->|"sends alert"| node_alerts
node_admin -->|"reads data"| node_db
node_admin -->|"reads alerts"| node_alerts
node_alerts -->|"stores alerts"| node_db
node_auth -.->|"accesses"| node_db
node_ml -->|"logs metrics"| node_db
node_copilot -.->|"generates with"| node_llm
node_app -->|"uses styling"| node_theme
node_app -.->|"coordinates"| node_other_agents
node_other_agents -.->|"includes capability"| node_customs
node_other_agents -.->|"includes capability"| node_documents
node_other_agents -.->|"includes capability"| node_translation
node_copilot -.->|"retrieves knowledge"| node_rag

click node_app "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/app.py"
click node_copilot "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/app.py"
click node_pricing "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/agent2_freight.py"
click node_route "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/agent2_freight.py"
click node_carrier "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/agent3_freight.py"
click node_weather "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/weather_context.py"
click node_other_agents "https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2"
click node_customs "https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2"
click node_documents "https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2"
click node_translation "https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2"
click node_rag "https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2"
click node_llm "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/llm_engine.py"
click node_ml "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/train_ml.py"
click node_db "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/db.py"
click node_auth "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/auth.py"
click node_admin "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/admin_dash.py"
click node_alerts "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/notifications.py"
click node_theme "https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/ui_theme.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_copilot,node_theme,node_user toneBlue
class node_pricing,node_route,node_carrier,node_weather,node_other_agents,node_customs,node_documents,node_translation toneAmber
class node_rag,node_llm,node_ml,node_db toneMint
class node_auth,node_admin,node_alerts toneRose
```

## Components

### Platform experience

- [Streamlit platform](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/app.py): `Milestone2/app.py`
- [AI Copilot](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/app.py): `Milestone2/app.py`
- [Shared UI theme](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/ui_theme.py): `Milestone2/ui_theme.py`

### Freight intelligence

- [Freight pricing](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/agent2_freight.py): `Milestone2/agent2_freight.py`
- [Route and weather risk](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/agent2_freight.py): `Milestone2/agent2_freight.py`
- [Carrier audit](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/agent3_freight.py): `Milestone2/agent3_freight.py`
- [Port weather context](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/weather_context.py): `Milestone2/weather_context.py`
- [Other freight agents](https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2): `Milestone2`
- [Customs and tariffs](https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2): `Milestone2`
- [OCR and documents](https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2): `Milestone2`
- [Maritime translation](https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2): `Milestone2`

### Platform services

- [PDF knowledge RAG](https://github.com/tharani927/infosys_freightquote_ai/tree/main/Milestone2): `Milestone2`
- [LLM generation](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/llm_engine.py): `Milestone2/llm_engine.py`
- [ML training](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/train_ml.py): `Milestone2/train_ml.py`
- [FreightQuote SQLite](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/db.py): `Milestone2/db.py`

### Access and operations

- [Authentication and RBAC](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/auth.py): `Milestone2/auth.py`
- [Admin dashboard](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/admin_dash.py): `Milestone2/admin_dash.py`
- [Notification center](https://github.com/tharani927/infosys_freightquote_ai/blob/main/Milestone2/notifications.py): `Milestone2/notifications.py`

### Other components

- **Freight user**

## Connections

- Freight user → Streamlit platform: uses (evidence: `README.md`)
- Streamlit platform → Authentication and RBAC: requires session (evidence: `Milestone2/app.py`)
- Streamlit platform → AI Copilot: presents (evidence: `Milestone2/app.py`)
- Streamlit platform → Freight pricing: routes to (evidence: `Milestone2/app.py`)
- Streamlit platform → Route and weather risk: routes to (evidence: `Milestone2/app.py`)
- Streamlit platform → Carrier audit: routes to (evidence: `Milestone2/app.py`)
- Streamlit platform → Admin dashboard: routes to (evidence: `Milestone2/app.py`)
- Streamlit platform → Port weather context: uses (evidence: `Milestone2/app.py`)
- Streamlit platform → Notification center: uses (evidence: `Milestone2/app.py`)
- Streamlit platform → LLM generation: uses (evidence: `Milestone2/app.py`)
- Streamlit platform → FreightQuote SQLite: reads (evidence: `Milestone2/app.py`)
- Streamlit platform → ML training: invokes (evidence: `Milestone2/app.py`)
- Freight pricing → Port weather context: uses context (evidence: `Milestone2/agent2_freight.py`)
- Route and weather risk → Port weather context: reads conditions (evidence: `Milestone2/agent2_freight.py`)
- Carrier audit → FreightQuote SQLite: updates carriers (evidence: `Milestone2/agent3_freight.py`)
- Carrier audit → Notification center: sends alert (evidence: `Milestone2/agent3_freight.py`)
- Admin dashboard → FreightQuote SQLite: reads data (evidence: `Milestone2/admin_dash.py`)
- Admin dashboard → Notification center: reads alerts (evidence: `Milestone2/admin_dash.py`)
- Notification center → FreightQuote SQLite: stores alerts (evidence: `Milestone2/notifications.py`)
- Authentication and RBAC → FreightQuote SQLite: accesses
- ML training → FreightQuote SQLite: logs metrics (evidence: `Milestone2/train_ml.py`)
- AI Copilot → LLM generation: generates with (evidence: `Milestone2/app.py`)
- Streamlit platform → Shared UI theme: uses styling (evidence: `Milestone2/app.py`)
- Streamlit platform → Other freight agents: coordinates (evidence: `Milestone2/app.py`)
- Other freight agents → Customs and tariffs: includes capability (evidence: `README.md`)
- Other freight agents → OCR and documents: includes capability (evidence: `README.md`)
- Other freight agents → Maritime translation: includes capability (evidence: `README.md`)
- AI Copilot → PDF knowledge RAG: retrieves knowledge (evidence: `README.md`)
