# mudiyamganesh/recipegpt architecture

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

- Interactive diagram: https://gitdiagram.com/mudiyamganesh/recipegpt
- Repository: https://github.com/mudiyamganesh/recipegpt

## Overview

RecipeGPT is a recipe-question chat application: a user asks for recipes or ingredient and meal-planning help, the backend retrieves recipe-dataset context, and a conversational LLM returns an answer. The React interface also supports recent-chat management and food imagery. The backend persists conversations as JSON and serves images from a local directory. The README excerpt is unreadable, so capabilities are based on the prompt and sampled source; the excerpts do not show every interface detail.

Main entry points: [`main.py`](https://github.com/mudiyamganesh/recipegpt/blob/main/main.py) (API and chat state), [`frontend/src/App.jsx`](https://github.com/mudiyamganesh/recipegpt/blob/main/frontend/src/App.jsx) (Chat UI), [`recipe.py`](https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py) (Chain setup), [`faiss_index/index.faiss`](https://github.com/mudiyamganesh/recipegpt/blob/main/faiss_index/index.faiss) (FAISS index)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Chat interface"]
  node_ui["Chat UI<br/>[App.jsx]"]
end

subgraph group_api["Chat API"]
  node_backend["API and chat state<br/>[main.py]"]
  node_conversation_files[("Saved conversations<br/>[main.py]")]
  node_image_files[("Local food images<br/>[main.py]")]
end

subgraph group_knowledge["Recipe knowledge"]
  node_dataset["Recipe dataset<br/>[Dataset.csv]"]
  node_faiss[("FAISS index<br/>[index.faiss]")]
  node_retriever["Recipe retrieval<br/>[recipe.py]"]
end

subgraph group_generation["Answer generation"]
  node_chain_setup["Chain setup<br/>[recipe.py]"]
  node_memory["Conversation memory<br/>[recipe.py]"]
  node_prompt["Recipe prompt<br/>[recipe.py]"]
  node_llm["Groq language model<br/>[recipe.py]"]
end

node_user(("User"))
node_groq{{"Groq service"}}

node_user -->|"asks"| node_ui
node_ui -->|"sends chat and history requests"| node_backend
node_backend -->|"creates chain via"| node_chain_setup
node_chain_setup -->|"loads"| node_dataset
node_chain_setup -->|"loads or builds"| node_faiss
node_chain_setup -->|"configures"| node_retriever
node_backend -->|"queries through chain"| node_retriever
node_retriever -->|"searches"| node_faiss
node_backend -->|"uses chain memory"| node_memory
node_backend -->|"invokes through chain"| node_llm
node_retriever -->|"supplies context"| node_prompt
node_memory -->|"supplies history"| node_prompt
node_prompt -->|"guides generation"| node_llm
node_llm -.->|"calls"| node_groq
node_backend -->|"reads and writes"| node_conversation_files
node_backend -->|"reads"| node_image_files
node_backend -->|"returns answers and chat data"| node_ui
node_backend -->|"returns images"| node_ui
node_ui -->|"displays responses"| node_user

click node_ui "https://github.com/mudiyamganesh/recipegpt/blob/main/frontend/src/App.jsx"
click node_backend "https://github.com/mudiyamganesh/recipegpt/blob/main/main.py"
click node_conversation_files "https://github.com/mudiyamganesh/recipegpt/blob/main/main.py"
click node_image_files "https://github.com/mudiyamganesh/recipegpt/blob/main/main.py"
click node_chain_setup "https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py"
click node_dataset "https://github.com/mudiyamganesh/recipegpt/blob/main/Dataset.csv"
click node_faiss "https://github.com/mudiyamganesh/recipegpt/blob/main/faiss_index/index.faiss"
click node_retriever "https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py"
click node_memory "https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py"
click node_prompt "https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py"
click node_llm "https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.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_ui,node_user toneBlue
class node_backend,node_conversation_files,node_image_files toneAmber
class node_dataset,node_faiss,node_retriever toneMint
class node_chain_setup,node_memory,node_prompt,node_llm toneRose
class node_groq toneIndigo
```

## Components

### Chat interface

- [Chat UI](https://github.com/mudiyamganesh/recipegpt/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Chat API

- [API and chat state](https://github.com/mudiyamganesh/recipegpt/blob/main/main.py): `main.py`
- [Saved conversations](https://github.com/mudiyamganesh/recipegpt/blob/main/main.py): `main.py`
- [Local food images](https://github.com/mudiyamganesh/recipegpt/blob/main/main.py): `main.py`

### Recipe knowledge

- [Recipe dataset](https://github.com/mudiyamganesh/recipegpt/blob/main/Dataset.csv): `Dataset.csv`
- [FAISS index](https://github.com/mudiyamganesh/recipegpt/blob/main/faiss_index/index.faiss): `faiss_index/index.faiss`
- [Recipe retrieval](https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py): `recipe.py`

### Answer generation

- [Chain setup](https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py): `recipe.py`
- [Conversation memory](https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py): `recipe.py`
- [Recipe prompt](https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py): `recipe.py`
- [Groq language model](https://github.com/mudiyamganesh/recipegpt/blob/main/recipe.py): `recipe.py`

### Other components

- **User**
- **Groq service**

## Connections

- User → Chat UI: asks
- Chat UI → API and chat state: sends chat and history requests
- API and chat state → Chain setup: creates chain via
- Chain setup → Recipe dataset: loads
- Chain setup → FAISS index: loads or builds
- Chain setup → Recipe retrieval: configures
- API and chat state → Recipe retrieval: queries through chain
- Recipe retrieval → FAISS index: searches
- API and chat state → Conversation memory: uses chain memory
- API and chat state → Groq language model: invokes through chain
- Recipe retrieval → Recipe prompt: supplies context
- Conversation memory → Recipe prompt: supplies history
- Recipe prompt → Groq language model: guides generation
- Groq language model → Groq service: calls
- API and chat state → Saved conversations: reads and writes
- API and chat state → Local food images: reads
- API and chat state → Chat UI: returns answers and chat data
- API and chat state → Chat UI: returns images
- Chat UI → User: displays responses
