# zuzith3art1st/updated-mvi-agri-agent architecture

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

- Interactive diagram: https://gitdiagram.com/zuzith3art1st/updated-mvi-agri-agent
- Repository: https://github.com/zuzith3art1st/updated-mvi-agri-agent

## Overview

Seed2Harvest is a Streamlit agricultural sales assistant for South African farmers. The user workflow is onboarding, then a bounded agricultural chat or product browsing, followed by basket preparation and a reservation quotation. The app also documents dialect normalization, inventory and transactional order persistence, delivery-location lookup, and payment/email aids. The excerpts show inventory retrieval and external-service calls, but do not show the reservation flow invoking the database transaction; that connection is therefore not asserted.

Main entry points: [`app.py`](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py) (Streamlit application), [`The_Database.py`](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/The_Database.py) (Inventory database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Farmer experience"]
  node_streamlit_app["Streamlit application<br/>[app.py]"]
  node_onboarding["Client onboarding<br/>[app.py]"]
end

subgraph group_commerce["Commerce and records"]
  node_catalogue["Product catalogue<br/>[app.py]"]
  node_inventory_db[("Inventory database<br/>[The_Database.py]")]
  node_basket["Basket and totals<br/>[app.py]"]
  node_reservation["Order quotation<br/>[app.py]"]
  node_order_records[("Order transactions<br/>[The_Database.py]")]
  node_payment_qr["Payment QR codes<br/>[app.py]"]
  node_email_link["Email handoff<br/>[app.py]"]
end

subgraph group_integrations["Assistant and integrations"]
  node_agri_middleware["Dialect mapping<br/>[app.py]"]
  node_strategic_chat["Agricultural chat<br/>[app.py]"]
  node_groq["Groq model"]
  node_location_lookup["Location lookup<br/>[app.py]"]
  node_nominatim["Nominatim service"]
end

node_farmer(("Farmer"))

node_farmer -->|"uses"| node_streamlit_app
node_streamlit_app -->|"presents"| node_onboarding
node_streamlit_app -->|"routes to"| node_strategic_chat
node_strategic_chat -->|"normalizes dialect"| node_agri_middleware
node_strategic_chat -->|"requests completion"| node_groq
node_streamlit_app -->|"routes to"| node_catalogue
node_streamlit_app -->|"routes to"| node_reservation
node_streamlit_app -->|"fetches inventory"| node_inventory_db
node_catalogue -->|"updates quantities"| node_basket
node_streamlit_app -->|"looks up address"| node_location_lookup
node_location_lookup -->|"queries"| node_nominatim
node_reservation -->|"generates codes"| node_payment_qr
node_reservation -->|"builds mail link"| node_email_link

click node_streamlit_app "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py"
click node_onboarding "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py"
click node_agri_middleware "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py"
click node_strategic_chat "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py"
click node_catalogue "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py"
click node_inventory_db "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/The_Database.py"
click node_basket "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py"
click node_reservation "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py"
click node_order_records "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/The_Database.py"
click node_location_lookup "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py"
click node_payment_qr "https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py"
click node_email_link "https://github.com/zuzith3art1st/updated-mvi-agri-agent/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_streamlit_app,node_onboarding toneBlue
class node_catalogue,node_inventory_db,node_basket,node_reservation,node_order_records,node_payment_qr,node_email_link toneAmber
class node_agri_middleware,node_strategic_chat,node_groq,node_location_lookup,node_nominatim toneMint
class node_farmer toneIndigo
```

## Components

### Farmer experience

- [Streamlit application](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`
- [Client onboarding](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`

### Commerce and records

- [Product catalogue](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`
- [Inventory database](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/The_Database.py): `The_Database.py`
- [Basket and totals](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`
- [Order quotation](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`
- [Order transactions](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/The_Database.py): `The_Database.py`
- [Payment QR codes](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`
- [Email handoff](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`

### Assistant and integrations

- [Dialect mapping](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`
- [Agricultural chat](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`
- **Groq model**
- [Location lookup](https://github.com/zuzith3art1st/updated-mvi-agri-agent/blob/main/app.py): `app.py`
- **Nominatim service**

### Other components

- **Farmer**

## Connections

- Farmer → Streamlit application: uses (evidence: `README.md`)
- Streamlit application → Client onboarding: presents (evidence: `app.py`)
- Streamlit application → Agricultural chat: routes to (evidence: `app.py`)
- Agricultural chat → Dialect mapping: normalizes dialect (evidence: `app.py`)
- Agricultural chat → Groq model: requests completion (evidence: `app.py`)
- Streamlit application → Product catalogue: routes to (evidence: `app.py`)
- Streamlit application → Order quotation: routes to (evidence: `app.py`)
- Streamlit application → Inventory database: fetches inventory (evidence: `app.py`)
- Product catalogue → Basket and totals: updates quantities (evidence: `app.py`)
- Streamlit application → Location lookup: looks up address (evidence: `app.py`)
- Location lookup → Nominatim service: queries (evidence: `app.py`)
- Order quotation → Payment QR codes: generates codes (evidence: `app.py`)
- Order quotation → Email handoff: builds mail link (evidence: `app.py`)
