# sinchanacsajjanashettar/dishcovery architecture

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

- Interactive diagram: https://gitdiagram.com/sinchanacsajjanashettar/dishcovery
- Repository: https://github.com/sinchanacsajjanashettar/dishcovery

## Overview

DishCovery turns ingredient and dietary inputs into structured Indian recipe guidance. The main workflow runs through a FastAPI/LangGraph agent with safety screening, recipe retrieval, substitution/critique, generation and repair; the browser UI is the user-facing entry point. Separately, a CSV ingestion pipeline cleans and translates recipes, embeds them and indexes them for retrieval. The README documents these capabilities, but sampled code is partial, so internal workflow ordering and unsampled API details are not asserted.

Main entry points: [`dishcovery.py`](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py) (LangGraph workflow), [`create_vector.py`](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/create_vector.py) (Ingestion pipeline), [`index.html`](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/index.html) (Browser interface), [`chroma_db/chroma.sqlite3`](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/chroma_db/chroma.sqlite3) (ChromaDB)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Recipe Ingestion"]
  node_ingest_pipeline["Ingestion pipeline<br/>[create_vector.py]"]
  node_cleaning["Clean and translate<br/>[create_vector.py]"]
  node_embedding["Recipe embeddings<br/>[create_vector.py]"]
  node_vector_index["Recipe indexing<br/>[create_vector.py]"]
end

subgraph group_agent["Recipe Agent"]
  node_api["FastAPI service<br/>[dishcovery.py]"]
  node_workflow["LangGraph workflow<br/>[dishcovery.py]"]
  node_safety["Safety gate<br/>[dishcovery.py]"]
  node_retrieval["Recipe retrieval<br/>[dishcovery.py]"]
  node_substitution["Critique and substitute<br/>[dishcovery.py]"]
  node_generation["Recipe generation<br/>[dishcovery.py]"]
  node_fixer["Recipe fixer<br/>[dishcovery.py]"]
end

subgraph group_integrations["Stores and Models"]
  node_chroma[("ChromaDB<br/>[chroma.sqlite3]")]
  node_gemma["Gemma 3"]
  node_llama["Llama 3.3"]
  node_spoonacular["Spoonacular"]
end

subgraph group_interface["User Interface"]
  node_web_ui["Browser interface<br/>[index.html]"]
end

node_user(("Recipe seeker"))
node_csv["Indian recipe data"]

node_user -->|"provides request"| node_web_ui
node_web_ui -->|"calls API"| node_api
node_api -->|"serves workflow"| node_workflow
node_csv -->|"reads recipes"| node_ingest_pipeline
node_ingest_pipeline -->|"cleans and translates"| node_cleaning
node_cleaning -->|"prepares for embedding"| node_embedding
node_embedding -->|"indexes vectors"| node_vector_index
node_vector_index -->|"writes collection"| node_chroma
node_workflow -->|"includes gate"| node_safety
node_workflow -->|"includes retrieval"| node_retrieval
node_workflow -->|"includes critique"| node_substitution
node_workflow -->|"includes generation"| node_generation
node_workflow -->|"includes repair"| node_fixer
node_retrieval -->|"searches recipes"| node_chroma
node_generation -->|"generates with"| node_gemma
node_fixer -->|"repairs with"| node_llama
node_substitution -.->|"requests substitutes"| node_spoonacular

click node_csv "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/IndianFoodDatasetXLS%20(1).csv"
click node_ingest_pipeline "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/create_vector.py"
click node_cleaning "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/create_vector.py"
click node_embedding "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/create_vector.py"
click node_vector_index "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/create_vector.py"
click node_web_ui "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/index.html"
click node_api "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py"
click node_workflow "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py"
click node_safety "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py"
click node_retrieval "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py"
click node_substitution "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py"
click node_generation "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py"
click node_fixer "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py"
click node_chroma "https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/chroma_db/chroma.sqlite3"

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_ingest_pipeline,node_cleaning,node_embedding,node_vector_index toneBlue
class node_api,node_workflow,node_safety,node_retrieval,node_substitution,node_generation,node_fixer toneAmber
class node_chroma,node_gemma,node_llama,node_spoonacular toneMint
class node_web_ui toneRose
class node_user toneIndigo
class node_csv toneTeal
```

## Components

### Recipe Ingestion

- [Ingestion pipeline](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/create_vector.py): `create_vector.py`
- [Clean and translate](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/create_vector.py): `create_vector.py`
- [Recipe embeddings](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/create_vector.py): `create_vector.py`
- [Recipe indexing](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/create_vector.py): `create_vector.py`

### Recipe Agent

- [FastAPI service](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py): `dishcovery.py`
- [LangGraph workflow](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py): `dishcovery.py`
- [Safety gate](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py): `dishcovery.py`
- [Recipe retrieval](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py): `dishcovery.py`
- [Critique and substitute](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py): `dishcovery.py`
- [Recipe generation](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py): `dishcovery.py`
- [Recipe fixer](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/dishcovery.py): `dishcovery.py`

### Stores and Models

- [ChromaDB](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/chroma_db/chroma.sqlite3): `chroma_db/chroma.sqlite3`
- **Gemma 3**
- **Llama 3.3**
- **Spoonacular**

### User Interface

- [Browser interface](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/index.html): `index.html`

### Other components

- **Recipe seeker**
- [Indian recipe data](https://github.com/sinchanacsajjanashettar/dishcovery/blob/main/IndianFoodDatasetXLS%20(1).csv): `IndianFoodDatasetXLS (1).csv`

## Connections

- Recipe seeker → Browser interface: provides request (evidence: `README.md`)
- Browser interface → FastAPI service: calls API (evidence: `README.md`)
- FastAPI service → LangGraph workflow: serves workflow (evidence: `README.md`)
- Indian recipe data → Ingestion pipeline: reads recipes (evidence: `README.md`)
- Ingestion pipeline → Clean and translate: cleans and translates (evidence: `README.md`)
- Clean and translate → Recipe embeddings: prepares for embedding (evidence: `README.md`)
- Recipe embeddings → Recipe indexing: indexes vectors (evidence: `README.md`)
- Recipe indexing → ChromaDB: writes collection (evidence: `README.md`)
- LangGraph workflow → Safety gate: includes gate (evidence: `README.md`)
- LangGraph workflow → Recipe retrieval: includes retrieval (evidence: `README.md`)
- LangGraph workflow → Critique and substitute: includes critique (evidence: `README.md`)
- LangGraph workflow → Recipe generation: includes generation (evidence: `README.md`)
- LangGraph workflow → Recipe fixer: includes repair (evidence: `README.md`)
- Recipe retrieval → ChromaDB: searches recipes (evidence: `README.md`)
- Recipe generation → Gemma 3: generates with (evidence: `dishcovery.py`)
- Recipe fixer → Llama 3.3: repairs with (evidence: `dishcovery.py`)
- Critique and substitute → Spoonacular: requests substitutes (evidence: `dishcovery.py`)
