# raviprassand/shopping_assistant architecture

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

- Interactive diagram: https://gitdiagram.com/raviprassand/shopping_assistant
- Repository: https://github.com/raviprassand/shopping_assistant

## Overview

This is a conversational shopping assistant whose implemented workflow is CLI input → LangGraph assistant → product-search tool → SQLite results → conversational output. The README also describes cart, checkout, and order-support capabilities, but the corresponding implementation files are absent from the tree, so those branches are shown as documented but unverified. The graph’s state uses in-memory checkpointing. Evidence is limited to the provided README and source excerpts.

Main entry points: [`main.py`](https://github.com/raviprassand/shopping_assistant/blob/main/main.py) (Conversation Graph), [`utils.py`](https://github.com/raviprassand/shopping_assistant/blob/main/utils.py) (Tool Router), [`tools.py`](https://github.com/raviprassand/shopping_assistant/blob/main/tools.py) (Product Search), [`FullStackSQL.db`](https://github.com/raviprassand/shopping_assistant/blob/main/FullStackSQL.db) (Product Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation"]
  node_cli["Shopping CLI<br/>[main.py]"]
  node_graph["Conversation Graph<br/>[main.py]"]
  node_assistant["Assistant Agent<br/>[main.py]"]
  node_llm["Groq LLM"]
  node_memory[("Conversation Memory<br/>[main.py]")]
  node_tool_router["Tool Router<br/>[utils.py]"]
end

subgraph group_product_data["Product Search"]
  node_search["Product Search<br/>[tools.py]"]
  node_query["SQL Query Helper<br/>[tools.py]"]
  node_products_db[("Product Database<br/>[FullStackSQL.db]")]
end

subgraph group_shopping_support["Shopping Support"]
  node_cart["Cart Management"]
  node_checkout["Checkout"]
  node_order_support["Order Support"]
end

node_shopper(("Shopper"))

node_shopper -->|"enters query"| node_cli
node_cli -->|"streams input"| node_graph
node_graph -->|"dispatches"| node_assistant
node_assistant -->|"invokes"| node_llm
node_assistant -->|"routes tool calls"| node_tool_router
node_tool_router -->|"executes tool"| node_search
node_search -->|"runs query"| node_query
node_query -->|"reads products"| node_products_db
node_graph -->|"checkpoints state"| node_memory
node_shopper -.->|"requests changes"| node_cart
node_shopper -.->|"requests checkout"| node_checkout
node_shopper -.->|"asks order questions"| node_order_support

click node_cli "https://github.com/raviprassand/shopping_assistant/blob/main/main.py"
click node_graph "https://github.com/raviprassand/shopping_assistant/blob/main/main.py"
click node_assistant "https://github.com/raviprassand/shopping_assistant/blob/main/main.py"
click node_memory "https://github.com/raviprassand/shopping_assistant/blob/main/main.py"
click node_tool_router "https://github.com/raviprassand/shopping_assistant/blob/main/utils.py"
click node_search "https://github.com/raviprassand/shopping_assistant/blob/main/tools.py"
click node_query "https://github.com/raviprassand/shopping_assistant/blob/main/tools.py"
click node_products_db "https://github.com/raviprassand/shopping_assistant/blob/main/FullStackSQL.db"

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_cli,node_graph,node_assistant,node_llm,node_memory,node_tool_router toneBlue
class node_search,node_query,node_products_db toneAmber
class node_cart,node_checkout,node_order_support toneMint
class node_shopper toneIndigo
```

## Components

### Conversation

- [Shopping CLI](https://github.com/raviprassand/shopping_assistant/blob/main/main.py): `main.py`
- [Conversation Graph](https://github.com/raviprassand/shopping_assistant/blob/main/main.py): `main.py`
- [Assistant Agent](https://github.com/raviprassand/shopping_assistant/blob/main/main.py): `main.py`
- **Groq LLM**
- [Conversation Memory](https://github.com/raviprassand/shopping_assistant/blob/main/main.py): `main.py`
- [Tool Router](https://github.com/raviprassand/shopping_assistant/blob/main/utils.py): `utils.py`

### Product Search

- [Product Search](https://github.com/raviprassand/shopping_assistant/blob/main/tools.py): `tools.py`
- [SQL Query Helper](https://github.com/raviprassand/shopping_assistant/blob/main/tools.py): `tools.py`
- [Product Database](https://github.com/raviprassand/shopping_assistant/blob/main/FullStackSQL.db): `FullStackSQL.db`

### Shopping Support

- **Cart Management**
- **Checkout**
- **Order Support**

### Other components

- **Shopper**

## Connections

- Shopper → Shopping CLI: enters query (evidence: `main.py`)
- Shopping CLI → Conversation Graph: streams input (evidence: `main.py`)
- Conversation Graph → Assistant Agent: dispatches (evidence: `main.py`)
- Assistant Agent → Groq LLM: invokes (evidence: `main.py`)
- Assistant Agent → Tool Router: routes tool calls (evidence: `main.py`)
- Tool Router → Product Search: executes tool (evidence: `main.py`)
- Product Search → SQL Query Helper: runs query (evidence: `tools.py`)
- SQL Query Helper → Product Database: reads products (evidence: `tools.py`)
- Conversation Graph → Conversation Memory: checkpoints state (evidence: `main.py`)
- Shopper → Cart Management: requests changes (evidence: `README.md`)
- Shopper → Checkout: requests checkout (evidence: `README.md`)
- Shopper → Order Support: asks order questions (evidence: `README.md`)
