An AI-powered chatbot designed to provide authentic Moroccan recipes using Retrieval-Augmented Generation (RAG). Users can ask about any Moroccan dish, and the chatbot responds with the recipe name, description, ingredients, preparation steps, and even images (if you're connected to the internet). Also the user can choose to search or recommed a recipe based on their ingredients.
You can choose your preferred LLM provider:
- π§ Ollama (Local inference)
- π OpenRouter (API-based inference)
- π RAG-powered Retrieval: Combines local/remote LLMs with vector-based document search to find the most relevant recipe.
- π¨βπ³ Authentic Recipe Info: Get detailed info including ingredients, instructions, and cultural context.
- π Dual LLM Support: Choose between Ollama (offline) or OpenRouter (online).
- πΌοΈ Dynamic Meal Images: If internet access is available, the chatbot fetches related images.
- π¬ Interactive Chat Interface: Friendly UI for conversational recipe discovery.
- π Secure API key handling via
.env
.
The project is organized as follows:
βββ .env # Environment variables (store OPENROUTER_API_KEY here)
βββ .gitignore # Git ignore rules
βββ README.md # Project documentation
βββ app.py # Main entry point for chatbot UI
βββ rag.py # RAG pipeline: document retrieval + LLM generation
βββ Moroccan_Recipes_FaissDB/ # Faiss vector database Contains Moroccan recipes
βββ imgs/ # Folder for images and UI screenshots
βββ Data_Preparation_Notebooks/ # Notebooks for data preparation and vector DB setup (recipe documents / embeddings)
git clone git@github.com:drisskhattabi6/Moroccan-Meal-Recipes-Chatbot.git
cd Moroccan-Meal-Recipes-Chatbot
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
- Get your API key from OpenRouter.ai
- Create a
.env
file and add your key:
OPENROUTER_API_KEY='your_api_key_here'
- Follow instructions at: https://ollama.com/download
- Pull a model:
ollama pull llama3.2-vision:latest
Start the app:
streamlit run app.py
- Select the LLM provider: Ollama or OpenRouter
- Ask: "How do I make couscous?"
- Get a beautifully formatted response including:
- πΌοΈ dish image
- π Recipe name and description
- π Ingredients list
- π Step-by-step instructions
- Internet connection is required only for image fetching and OpenRouter usage.
- All recipe data is stored and retrieved locally for fast, reliable results.