# srivenkateshmani/food-recommendation-system architecture

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

- Interactive diagram: https://gitdiagram.com/srivenkateshmani/food-recommendation-system
- Repository: https://github.com/srivenkateshmani/food-recommendation-system

## Overview

This is a Python CLI food recommendation system: it loads and normalizes a JSON food dataset, indexes food descriptions in a cosine-similarity vector collection, then lets users search and view recommendations, including cuisine and calorie filters. An enhanced RAG chatbot and query-comparison capability are also present, though the default startup flow launches the basic chatbot. The graph follows shown calls and documented behavior; the RAG model’s external service connection is supported by its configuration, while unsampled implementation details are omitted.

Main entry points: [`main.py`](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/main.py) (Application startup), [`src/chatbot.py`](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/chatbot.py) (Interactive chatbot), [`src/search_handlers.py`](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/search_handlers.py) (Search handlers), [`src/rag.py`](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/rag.py) (RAG responses)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and data"]
  node_entry["Application startup<br/>[main.py]"]
  node_dataset["Food dataset<br/>[FoodDataSet.json]"]
  node_loader["Data normalization<br/>[data_loader.py]"]
end

subgraph group_index["Vector indexing"]
  node_ingestion["Document ingestion<br/>[ingestion.py]"]
  node_vector_setup["Collection setup<br/>[vector_store.py]"]
  node_collection[("Chroma collection")]
end

subgraph group_search["Search experience"]
  node_chatbot["Interactive chatbot<br/>[chatbot.py]"]
  node_handlers["Search handlers<br/>[search_handlers.py]"]
  node_retrieval["Similarity retrieval<br/>[retrieval.py]"]
  node_display["Results display<br/>[display.py]"]
end

subgraph group_rag["Enhanced RAG"]
  node_rag["RAG responses<br/>[rag.py]"]
  node_model_config["Granite model config<br/>[config.py]"]
end

node_user(("CLI user"))
node_watsonx{{"IBM Watsonx.ai"}}

node_user -->|"starts"| node_entry
node_entry -->|"loads data"| node_loader
node_loader -->|"reads JSON"| node_dataset
node_entry -->|"creates collection"| node_vector_setup
node_entry -->|"populates collection"| node_ingestion
node_entry -->|"starts chatbot"| node_chatbot
node_vector_setup -->|"creates"| node_collection
node_ingestion -->|"adds documents"| node_collection
node_user -->|"enters query"| node_chatbot
node_chatbot -->|"dispatches search"| node_handlers
node_handlers -->|"requests results"| node_retrieval
node_retrieval -->|"queries"| node_collection
node_handlers -->|"formats results"| node_display
node_chatbot -->|"offers RAG mode"| node_rag
node_rag -->|"retrieves matches"| node_retrieval
node_rag -->|"uses model"| node_model_config
node_model_config -->|"configures inference"| node_watsonx

click node_entry "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/main.py"
click node_dataset "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/data/FoodDataSet.json"
click node_loader "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/data_loader.py"
click node_ingestion "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/ingestion.py"
click node_vector_setup "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/vector_store.py"
click node_chatbot "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/chatbot.py"
click node_handlers "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/search_handlers.py"
click node_retrieval "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/retrieval.py"
click node_display "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/display.py"
click node_rag "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/rag.py"
click node_model_config "https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/config.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_entry,node_dataset,node_loader,node_user toneBlue
class node_ingestion,node_vector_setup,node_collection toneAmber
class node_chatbot,node_handlers,node_retrieval,node_display toneMint
class node_rag,node_model_config toneRose
class node_watsonx toneIndigo
```

## Components

### Startup and data

- [Application startup](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/main.py): `main.py`
- [Food dataset](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/data/FoodDataSet.json): `data/FoodDataSet.json`
- [Data normalization](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/data_loader.py): `src/data_loader.py`

### Vector indexing

- [Document ingestion](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/ingestion.py): `src/ingestion.py`
- [Collection setup](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/vector_store.py): `src/vector_store.py`
- **Chroma collection**

### Search experience

- [Interactive chatbot](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/chatbot.py): `src/chatbot.py`
- [Search handlers](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/search_handlers.py): `src/search_handlers.py`
- [Similarity retrieval](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/retrieval.py): `src/retrieval.py`
- [Results display](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/display.py): `src/display.py`

### Enhanced RAG

- [RAG responses](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/rag.py): `src/rag.py`
- [Granite model config](https://github.com/srivenkateshmani/food-recommendation-system/blob/main/src/config.py): `src/config.py`

### Other components

- **CLI user**
- **IBM Watsonx.ai**

## Connections

- CLI user → Application startup: starts (evidence: `README.md`)
- Application startup → Data normalization: loads data (evidence: `main.py`)
- Data normalization → Food dataset: reads JSON (evidence: `src/data_loader.py`)
- Application startup → Collection setup: creates collection (evidence: `main.py`)
- Application startup → Document ingestion: populates collection (evidence: `main.py`)
- Application startup → Interactive chatbot: starts chatbot (evidence: `main.py`)
- Collection setup → Chroma collection: creates (evidence: `src/vector_store.py`)
- Document ingestion → Chroma collection: adds documents (evidence: `src/ingestion.py`)
- CLI user → Interactive chatbot: enters query (evidence: `src/chatbot.py`)
- Interactive chatbot → Search handlers: dispatches search (evidence: `src/chatbot.py`)
- Search handlers → Similarity retrieval: requests results (evidence: `src/search_handlers.py`)
- Similarity retrieval → Chroma collection: queries (evidence: `src/retrieval.py`)
- Search handlers → Results display: formats results (evidence: `src/search_handlers.py`)
- Interactive chatbot → RAG responses: offers RAG mode (evidence: `src/chatbot.py`)
- RAG responses → Similarity retrieval: retrieves matches (evidence: `src/rag.py`)
- RAG responses → Granite model config: uses model (evidence: `src/rag.py`)
- Granite model config → IBM Watsonx.ai: configures inference (evidence: `src/config.py`)
