Skip to main content

Introduction

Welcome to the Indian Food Companion documentation. This guide will teach you how to build a complete AI-powered food recommendation application from scratch.

What You'll Build

By the end of this guide, you'll have built a fully functional chat application that:

  • Understands natural language - "I want something spicy for breakfast"
  • Provides personalized recommendations - Based on dietary preferences and allergies
  • Streams responses in real-time - Just like ChatGPT
  • Uses your own curated data - Not just relying on the AI's training data

Architecture Overview

┌─────────────────────────────────────────────────────────────────┐
│ User Interface │
│ (React + shadcn/ui) │
└─────────────────────────┬───────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│ FastAPI Backend │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │
│ │ Chat API │ │ Preferences │ │ MCP Server │ │
│ │ (SSE) │ │ API │ │ (AI Tool Access) │ │
│ └──────┬───────┘ └──────────────┘ └──────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ RAG Pipeline │ │
│ │ 1. Query → 2. Retrieve from ChromaDB → 3. Generate │ │
│ └──────────────────────────────────────────────────────────┘ │
└─────────────────────────┬───────────────────────────────────────┘

┌───────────────┼───────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────────┐
│ ChromaDB │ │ Postgres │ │ OpenAI API │
│ (Vectors)│ │ (Users) │ │ (LLM) │
└──────────┘ └──────────┘ └──────────────┘

Prerequisites

Before starting, you should be comfortable with:

  • React - Component-based UI development
  • REST APIs - HTTP methods, JSON, request/response patterns
  • Docker - Basic containerization concepts
  • Python - Basic syntax (we'll teach you FastAPI)

You don't need prior experience with:

  • Large Language Models (LLMs)
  • Vector databases
  • Embeddings
  • RAG (Retrieval-Augmented Generation)
  • MCP (Model Context Protocol)

We'll explain all of these concepts as we go.

Tech Stack

ComponentTechnologyWhy We Use It
FrontendReact + ViteFast development, modern tooling
UI Componentsshadcn/uiBeautiful, accessible, customizable
StylingTailwind CSSUtility-first, rapid prototyping
BackendFastAPIAsync Python, automatic API docs
Vector DBChromaDBSimple, embeddable, perfect for learning
DatabasePostgreSQLReliable, feature-rich
LLMOpenAIBest-in-class, easy to use
ToolsMCPStandardized AI tool protocol

How This Guide is Organized

  1. Getting Started - Set up your development environment
  2. Core Concepts - Understand LLMs, RAG, embeddings, and MCP
  3. Backend Development - Build the FastAPI server step by step
  4. Frontend Development - Create the React chat interface
  5. Deployment - Containerize and run with Docker

Let's begin!