Skip to content

abliskan/rag-chatbot-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

rag-chatbot-backend

SourChef is an intelligent, RAG-enhanced chatbot designed for nutrition-focused food recommendations, personalized meal planning, dietary filtering, calorie/macronutrient tracking, and YouTube video recipe suggestions. Built with Gemini Pro (via LangChain), Pinecone, Langfuse, Gradio, and PostgreSQL.

Problem Definition

  • Information Overload & Confusion: 68% of people report being confused about nutrition advice due to conflicting information
  • Lack of Personalization: people often find that generic "one-size-fits-all" nutrition advice, like following a fixed calorie count or macronutrient ratio, doesn't work for them
  • Recipe-Nutrition Disconnect: people can't easily connect recipes to their nutritional goals

Key Features

  • Conversational Intelligence: User can get recommends personalized, health-aligned food and recipes using memory-augmented retrieval and reasoning.
  • Retrieval-Augmented Generation (RAG) Implementation from vectorized food, nutrition, and recipe knowledge base via Pinecone vectorstore.
  • Dietary filtering: Chatbot can act like a helpful "personal diet planner" (e.g. vegan, keto, gluten-free).
  • Calorie & macronutrient calculator: Chabot use nutrition and calorie from external source to prepare your nutrition and recipe data before jumping into recommendation.
  • YouTube recipe video suggestions: Videos displayed alongside recipe responses.
  • LLM monitoring: Traces, tags, and logs every user query and LLM response.

Project Structure

coming-soon

Project Architecture

coming-soon

Tech Stack

  • Frontend: Gradio
  • Backend: Python (FastAPI)
  • Embedding model: Gemini API/models/embedding-001
  • LLM model: Gemini API/models/gemini-2.0-flash
  • AI Framework: LangChain
  • Relational Database: PostgreSQL
  • Vector Database: Pinecone via docker
  • LLM Monitoring: Langfuse via docker
  • Chat Memory: ConversationBufferMemory
  • Containerization: Docker
  • Deployment: Gradio
  • CI/CD Pipeline: Github actions
  • Package Manager: uv
  • Python Linting: ruff

Getting Started and Running

1. Get the API key

2. Clone the repo

git git@github.com:abliskan/rag-chatbot-backend.git
cd rag-chatbot-backend

3. Install dependencies (via uv or pip)

conda create --name <environment_name> python=<python_version>
conda activate <env_name>
pip install uv
uv venv
.venv\Scripts\activate
uv pip install python-dotenv langchain langchain-community langchain-pinecone langchain-google-genai langchainhub langfuse pandas gradio requests google-api-python-client
uv pip install --dev pytest
uv pip list

4. Change your .env file

touch .env

# insert the API Key
GOOGLE_API_KEY=your_google_api_key
PINECONE_API_KEY=your_pinecone_key
PINECONE_ENVIRONMENT=your_pinecone_env
PINECONE_INDEX_NAME=your_pinecone_index
YOUTUBE_API_KEY=your_serpapi_key
NUTRITIONIX_APP_ID=your_nutritionix_app_id
NUTRITIONIX_API_KEY=your_nutritionix_key
LANGFUSE_PUBLIC_KEY=your_langfuse_public_key
LANGFUSE_SECRET_KEY=your_langfuse_secret_key
LANGFUSE_HOST=https://app.langfuse.com

5. Run the App

Run the gradio from your local computer

python main.py

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors