# gopalvutukuri14-netizen/retailmindai architecture

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

- Interactive diagram: https://gitdiagram.com/gopalvutukuri14-netizen/retailmindai
- Repository: https://github.com/gopalvutukuri14-netizen/retailmindai

## Overview

RetailMind AI is a conversational smartphone recommendation product. The main path runs from a shopper’s query and profile through intent parsing, conditional routing, product retrieval and preference lookup, ranking, explanations and follow-up suggestions, then a structured response in the chat UI. The README also documents an offline sentiment-and-embedding preparation pipeline. Source excerpts establish several calls and graph transitions; README statements support documented branches and data stages where implementation details were not sampled.

Main entry points: [`backend/orchestrator/nodes.py`](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/orchestrator/nodes.py) (Agent wrappers and routing), [`backend/orchestrator/graph.py`](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/orchestrator/graph.py) (LangGraph workflow), [`backend/Agents/response/agent.py`](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/response/agent.py) (Response synthesis), [`frontend/src/App.jsx`](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/frontend/src/App.jsx) (Chat interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Chat experience"]
  node_chat["Chat interface<br/>[App.jsx]"]
  node_chat_views["Chat views<br/>[MessageBubble.jsx]"]
  node_api_client["Recommendation client<br/>[recommend.js]"]
end

subgraph group_orchestration["API and orchestration"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_graph["LangGraph workflow<br/>[graph.py]"]
  node_state["Pipeline state<br/>[state.py]"]
  node_agent_nodes["Agent wrappers and routing<br/>[nodes.py]"]
end

subgraph group_recommendation["Recommendation agents"]
  node_understanding["Query understanding<br/>[agent.py]"]
  node_retrieval_agent["Retrieval agent<br/>[agent.py]"]
  node_memory_agent["Preference memory<br/>[agent.py]"]
  node_ranking["Product ranking<br/>[agent.py]"]
  node_xai["Product explanations<br/>[agent.py]"]
  node_followup["Follow-up suggestions<br/>[agent.py]"]
  node_response["Response synthesis<br/>[agent.py]"]
end

subgraph group_catalog["Catalog and data preparation"]
  node_retriever["Semantic product search<br/>[retrieval.py]"]
  node_sentiment["Sentiment aggregation"]
  node_sentiment_full["Sentiment analysis<br/>[sentiment_full.py]"]
  node_embeddings["Embedding generation"]
  node_catalog_loader["Catalog loading<br/>[load_chromadb.py]"]
end

subgraph group_integrations["External services"]
  node_vector_store[("Product vector store")]
  node_profile_store[("SQLite profiles")]
  node_gemini["Gemini service"]
end

node_shopper(("Shopper"))

node_shopper -->|"submits query"| node_chat
node_chat -->|"requests recommendations"| node_api_client
node_api_client -.->|"calls API"| node_api
node_api -->|"runs workflow"| node_graph
node_graph -->|"dispatches nodes"| node_agent_nodes
node_agent_nodes -->|"parses query"| node_understanding
node_agent_nodes -->|"retrieves candidates"| node_retrieval_agent
node_retrieval_agent -->|"searches products"| node_retriever
node_retriever -->|"queries catalog"| node_vector_store
node_agent_nodes -->|"loads preferences"| node_memory_agent
node_memory_agent -.->|"reads profiles"| node_profile_store
node_agent_nodes -->|"scores candidates"| node_ranking
node_agent_nodes -->|"explains rankings"| node_xai
node_agent_nodes -->|"suggests actions"| node_followup
node_agent_nodes -->|"synthesizes response"| node_response
node_response -.->|"generates response"| node_gemini
node_xai -.->|"generates explanations"| node_gemini
node_graph -->|"accumulates results"| node_state
node_chat -->|"renders messages"| node_chat_views
node_sentiment_full -.->|"feeds aggregation"| node_sentiment
node_sentiment -.->|"prepares catalog data"| node_embeddings
node_embeddings -.->|"loads embeddings"| node_catalog_loader
node_catalog_loader -.->|"loads catalog"| node_vector_store
node_graph -->|"routes product queries"| node_retrieval_agent
node_graph -.->|"routes general replies"| node_response
node_graph -.->|"routes context replies"| node_response

click node_chat "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/frontend/src/App.jsx"
click node_chat_views "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/frontend/src/components/MessageBubble.jsx"
click node_api_client "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/frontend/src/api/recommend.js"
click node_api "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/main.py"
click node_graph "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/orchestrator/graph.py"
click node_state "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/orchestrator/state.py"
click node_agent_nodes "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/orchestrator/nodes.py"
click node_understanding "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/query_understanding/agent.py"
click node_retrieval_agent "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/retrieval/agent.py"
click node_retriever "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/retrieval.py"
click node_memory_agent "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/memory/agent.py"
click node_ranking "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/ranking/agent.py"
click node_xai "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/xai/agent.py"
click node_followup "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/follow_up/agent.py"
click node_response "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/response/agent.py"
click node_sentiment "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/aggregate_sentiment.py"
click node_sentiment_full "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/sentiment_full.py"
click node_embeddings "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/generate_embeddings.py"
click node_catalog_loader "https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/load_chromadb.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_chat,node_chat_views,node_api_client toneBlue
class node_api,node_graph,node_state,node_agent_nodes toneAmber
class node_understanding,node_retrieval_agent,node_memory_agent,node_ranking,node_xai,node_followup,node_response toneMint
class node_retriever,node_sentiment,node_sentiment_full,node_embeddings,node_catalog_loader toneRose
class node_vector_store,node_profile_store,node_gemini,node_shopper toneIndigo
```

## Components

### Chat experience

- [Chat interface](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Chat views](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/frontend/src/components/MessageBubble.jsx): `frontend/src/components/MessageBubble.jsx`
- [Recommendation client](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/frontend/src/api/recommend.js): `frontend/src/api/recommend.js`

### API and orchestration

- [FastAPI endpoints](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/main.py): `backend/main.py`
- [LangGraph workflow](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/orchestrator/graph.py): `backend/orchestrator/graph.py`
- [Pipeline state](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/orchestrator/state.py): `backend/orchestrator/state.py`
- [Agent wrappers and routing](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/orchestrator/nodes.py): `backend/orchestrator/nodes.py`

### Recommendation agents

- [Query understanding](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/query_understanding/agent.py): `backend/Agents/query_understanding/agent.py`
- [Retrieval agent](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/retrieval/agent.py): `backend/Agents/retrieval/agent.py`
- [Preference memory](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/memory/agent.py): `backend/Agents/memory/agent.py`
- [Product ranking](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/ranking/agent.py): `backend/Agents/ranking/agent.py`
- [Product explanations](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/xai/agent.py): `backend/Agents/xai/agent.py`
- [Follow-up suggestions](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/follow_up/agent.py): `backend/Agents/follow_up/agent.py`
- [Response synthesis](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/Agents/response/agent.py): `backend/Agents/response/agent.py`

### Catalog and data preparation

- [Semantic product search](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/retrieval.py): `backend/pipeline/retrieval.py`
- [Sentiment aggregation](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/aggregate_sentiment.py): `backend/pipeline/aggregate_sentiment.py`
- [Sentiment analysis](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/sentiment_full.py): `backend/pipeline/sentiment_full.py`
- [Embedding generation](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/generate_embeddings.py): `backend/pipeline/generate_embeddings.py`
- [Catalog loading](https://github.com/gopalvutukuri14-netizen/retailmindai/blob/main/backend/pipeline/load_chromadb.py): `backend/pipeline/load_chromadb.py`

### External services

- **Product vector store**
- **SQLite profiles**
- **Gemini service**

### Other components

- **Shopper**

## Connections

- Shopper → Chat interface: submits query (evidence: `frontend/src/App.jsx`)
- Chat interface → Recommendation client: requests recommendations (evidence: `frontend/src/App.jsx`)
- Recommendation client → FastAPI endpoints: calls API
- FastAPI endpoints → LangGraph workflow: runs workflow (evidence: `backend/main.py`)
- LangGraph workflow → Agent wrappers and routing: dispatches nodes (evidence: `backend/orchestrator/graph.py`)
- Agent wrappers and routing → Query understanding: parses query
- Agent wrappers and routing → Retrieval agent: retrieves candidates
- Retrieval agent → Semantic product search: searches products (evidence: `backend/Agents/retrieval/agent.py`)
- Semantic product search → Product vector store: queries catalog (evidence: `backend/pipeline/retrieval.py`)
- Agent wrappers and routing → Preference memory: loads preferences (evidence: `backend/orchestrator/nodes.py`)
- Preference memory → SQLite profiles: reads profiles
- Agent wrappers and routing → Product ranking: scores candidates
- Agent wrappers and routing → Product explanations: explains rankings
- Agent wrappers and routing → Follow-up suggestions: suggests actions
- Agent wrappers and routing → Response synthesis: synthesizes response
- Response synthesis → Gemini service: generates response
- Product explanations → Gemini service: generates explanations
- LangGraph workflow → Pipeline state: accumulates results (evidence: `backend/orchestrator/graph.py`)
- Chat interface → Chat views: renders messages (evidence: `frontend/src/App.jsx`)
- Sentiment analysis → Sentiment aggregation: feeds aggregation
- Sentiment aggregation → Embedding generation: prepares catalog data
- Embedding generation → Catalog loading: loads embeddings
- Catalog loading → Product vector store: loads catalog
- LangGraph workflow → Retrieval agent: routes product queries (evidence: `backend/orchestrator/graph.py`)
- LangGraph workflow → Response synthesis: routes general replies
- LangGraph workflow → Response synthesis: routes context replies
