RecipeRAG is an intelligent, Agentic RAG (Retrieval-Augmented Generation) application designed for recipe retrieval, culinary queries, and ingredient scaling. Unlike traditional single-pass RAG pipelines, RecipeRAG utilizes an LLM-driven router to classify user intents dynamically, apply semantic guardrails, and generate formatted, context-aware culinary advice.
The application is deployed with a modern, dark-themed Glassmorphism UI via Streamlit and is fully configured for Streamlit Cloud deployment.
- Autonomous Agentic Execution (
app.py&llm.py): Fully deprecated staticif/elserouting. Utilizes native LLM Tool Calling (Function Calling) within an autonomous ReAct loop. The Agent decides when to search the cookbook, calculate ingredient scaling, or directly answer questions. - Semantic Guardrails (
prompting.py): Uses a strict system prompt to intercept off-topic queries (e.g., politics, coding), preventing out-of-domain hallucinations. - Vector Search: Utilizes
sentence-transformers(all-MiniLM-L6-v2) with cosine similarity scoring, exposed directly to the LLM as asearch_cookbooktool. - Streamlit Cloud Ready: Zero-config deployment bridging local
.envvariables withst.secrets.
The RAG pipeline is evaluated via an automated test suite. If an API rate limit (429 Too Many Requests) occurs during testing, that query is cleanly skipped from the final averages.
Run the evaluation:
python scripts/rag_evaluator.pyInstead of rigid string matching, an evaluator LLM scores the generated answer against the ground truth based on Faithfulness (no hallucinations) and Completeness. High scores indicate correct, human-like summarization.
Measures exact structural string matching (Longest Common Subsequence). In Agentic RAG, ROUGE-L is a secondary metric; a high LLM score paired with a moderate ROUGE-L score indicates the Agent is successfully synthesizing information rather than blindly copy-pasting.
End-to-end execution time. Simple responses take ~1-2s, while autonomous Tool Calling (ReAct loops) naturally take 10-15s to complete the full "Think
📊 Evaluation Summary
==================================================
Total Queries Evaluated : 2
Total Queries Skipped : 3
Average LLM Judge Score : 8.00 / 10.0 (Semantic Accuracy)
Average System Latency : 12.88 seconds/query
==================================================
- Environment Setup:
pip install -r requirements.txt
- API Configuration:
Create a
.envfile in the root directory:OPENAI_API=your_api_key_here OPENAI_BASE_URL=https://integrate.api.nvidia.com/v1 OPENAI_MODEL=meta/llama-3.1-70b-instruct
- Launch the UI:
streamlit run streamlit_app.py