Content
# 🧑🍳 Le Cellier Lite
> An autonomous culinary assistant powered by **LangGraph**, **MCP (Model Context Protocol)**, and **Groq**. This project demonstrates an advanced agentic workflow with parallel execution and human-in-the-loop validation.
[](https://python.org)
[](https://github.com/langchain-ai/langgraph)
[](https://modelcontextprotocol.io/)
---
## 🏗️ Architecture
Le Cellier Lite is built as a **Stateful Directed Acyclic Graph (DAG)** where multiple agents collaborate to manage food inventory and suggest recipes.
### 🧠 The Graph Workflow
1. **Fetch Inventory**: Connects to a local **MCP SQL Server** to retrieve current stock.
2. **Propose Recipes**: A creative agent uses **DuckDuckGo Web Search** to find recipe ideas based on available ingredients.
3. **Human Interrupt**: The system pauses and waits for user validation (Selection 1, 2, or Ignore).
4. **Parallel Execution**:
- **Executive Chef**: Writes detailed cooking instructions.
- **Nutritionist**: Performs a macro-nutritional analysis.
5. **Inventory Consumption**: Automatically deducts ingredients from the stock via the MCP tool.
```mermaid
graph TD
Start((START)) --> Fetch[Fetch Inventory]
Fetch --> Propose[Propose 2 Recipes]
Propose --> Interrupt{{Human Validation}}
Interrupt -- "Select 1/2" --> Chef[Chef: Write Recipe]
Interrupt -- "Select 1/2" --> Nutri[Nutritionist: Analysis]
Chef --> Aggregator[Aggregator]
Nutri --> Aggregator
Aggregator --> Consume[Consume Inventory Tool]
Consume --> End((END))
```
---
## ✨ Features
- 🛠️ **Custom MCP Server**: Implements the **Model Context Protocol** to interface with a local SQLite database.
- ⏸️ **Human-in-the-loop**: Uses LangGraph's `interrupt_before` to ensure the user stays in control of inventory changes.
- ⚡ **Parallel Processing**: Agents work in parallel to speed up the final recipe synthesis.
- 🔍 **Dynamic Research**: Real-time web search for recipes, ensuring variety and up-to-date suggestions.
---
## 🚀 Quick Start
### Prerequisites
- Python 3.10+
- A [Groq API Key](https://console.groq.com/) (Llama-3 models)
### Installation
```bash
git clone https://github.com/Barthelemew/LeCellierLite.git
cd LeCellierLite
python -m venv venv
source venv/bin/activate
pip install langgraph langchain-groq mcp pydantic python-dotenv duckduckgo-search
```
### Configuration
```env
# .env
GROQ_API_KEY=gsk_your_key
```
### Run
The system initializes a sample SQLite database on the first run.
```bash
python main.py
```
---
## 🛠️ Tech Stack
- **Orchestration**: LangGraph
- **LLMs**: Llama-3.3-70b (Proposer) & Llama-3.1-8b (Chef/Nutritionist) via Groq
- **Database Access**: MCP (Model Context Protocol) over SQLite
- **Observability**: Ready for LangSmith integration
---
*Built with ❤️ by [Nicolas TEYRAS](https://github.com/Barthelemew) — AI Systems Engineer*