# Project export: Plateful

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 12.0
- Tagline: Plateful is your AI kitchen agent that plans meals, orders groceries from Kroger, tracks your pantry, and guides you step-by-step with a voice companion to make cooking effortless.
- Devpost: https://devpost.com/software/agentic-grocery
- GitHub: https://github.com/ZaidMadanat/Grocery-agent
- Video: https://www.youtube.com/embed/K6Z3Z-k6NYQ?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 3 GitHub contributor(s) — Zaid Madanat (8 commits), Priyadarsi Mishra (7 commits), amin-mobedi (2 commits)

## Devpost submission (written by the team)

### Inspiration

The daily question of "What's for dinner?" often leads to decision fatigue, wasted food, and last-minute unhealthy choices. We were inspired to streamline the entire meal preparation process, from initial idea to finished plate. We envisioned a single, intelligent agent that could handle the mental load of planning, shopping, and tracking, allowing people to rediscover the joy of cooking without the usual stress. Plateful was born from the desire to make home cooking not just easier, but truly effortless and enjoyable.

### What it does

Plateful is a comprehensive kitchen assistant, powered by a sophisticated two-agent system and delivered through a native mobile experience. Personalized AI Meal Planning (Recipe Agent): The Recipe Agent, built on the Claude API, is the core planner. It analyzes your user profile—including macros, daily calorie targets, and dietary restrictions—to generate a full week of personalized recipes. Using a Retrieval-Augmented Generation (RAG) architecture, it learns from your meal history stored in a ChromaDB vector store to make its suggestions smarter and more tailored over time. Smart Grocery Ordering (Grocery Agent): Once you approve a meal plan, the Grocery Agent takes over. It communicates directly with the Recipe Agent, receives the ingredient list, and uses tools to interact with the Kroger Public API. It populates your cart with the exact items and quantities needed, making your entire weekly shop ready for checkout with a single click. Context-Aware Voice Companion: Elevating the cooking experience, our voice companion offers hands-free guidance. Built with LiveKit for real-time audio streaming and LlamaIndex for context-awareness, it knows exactly which step you're on. You can ask questions and control the flow of the recipe with your voice, making the process interactive and seamless.

### How we built it

Plateful is built with a modern, mobile-first tech stack designed for a responsive user experience and a powerful, AI-driven backend. Mobile App (Frontend): A fully native iOS application built with Swift & SwiftUI to provide a fluid and intuitive user interface. Backend: A high-performance asynchronous backend built with Python & FastAPI, powering our agent-based system and managing all business logic. AI & Language Models: Agentic Framework: Our multi-agent system is built using the uAgents framework from Fetch.AI, which orchestrates communication and tasks between our agents. Core Agent Logic: The Claude API serves as the foundational intelligence for both the Recipe and Grocery agents, handling reasoning, planning, and tool usage within the uAgents framework. Memory & Personalization: We use a Retrieval-Augmented Generation (RAG) architecture with ChromaDB as the vector store to provide our agents with long-term memory of user preferences. Voice Context: LlamaIndex is used to build the context-aware query engine for the voice companion, allowing it to understand the recipe state. Agentic Framework: Our multi-agent system is built using the uAgents framework from Fetch.AI, which orchestrates communication and tasks between our agents. Core Agent Logic: The Claude API serves as the foundational intelligence for both the Recipe and Grocery agents, handling reasoning, planning, and tool usage within the uAgents framework. Memory & Personalization: We use a Retrieval-Augmented Generation (RAG) architecture with ChromaDB as the vector store to provide our agents with long-term memory of user preferences. Voice Context: LlamaIndex is used to build the context-aware query engine for the voice companion, allowing it to understand the recipe state. Database: User Data: A SQL Database (e.g., PostgreSQL) stores user profiles, dietary information, and application data. Vector Storage: ChromaDB is used for embedding and storing user meal interaction history. User Data: A SQL Database (e.g., PostgreSQL) stores user profiles, dietary information, and application data. Vector Storage: ChromaDB is used for embedding and storing user meal interaction history. APIs & Real-Time Communication: Groceries: Kroger Public API for product lookup and cart management. Voice Streaming: LiveKit for real-time, low-latency audio and data streaming for the voice companion. Groceries: Kroger Public API for product lookup and cart management. Voice Streaming: LiveKit for real-time, low-latency audio and data streaming for the voice companion.

### Challenges we ran into

Agent Reliability: Ensuring the Claude-powered agents within the uAgents framework could reliably interpret user needs, generate valid recipes, and correctly format API calls to Kroger required extensive prompt engineering and structured output validation. Real-Time Voice Context: Managing the conversational state between the user, LiveKit, and the LlamaIndex query engine in real-time was complex. Achieving low latency and accurate context-awareness to avoid frustrating the user during a hands-on cooking task was a major hurdle. RAG Pipeline Tuning: Fine-tuning the process of embedding user feedback (recipe selections/skips) and ensuring the retrieval from ChromaDB consistently provided useful, non-repetitive context for the LLM was a significant challenge.

### Accomplishments we're proud of

Successfully creating a seamless, end-to-end workflow from AI-driven meal plan generation to a verified Kroger grocery cart with a single click. Building a sophisticated RAG pipeline that truly learns from user behavior, making meal planning increasingly personalized and effective with each use. Implementing a genuinely context-aware voice companion that provides a hands-free cooking experience that feels natural and truly helpful, not robotic.

### What we learned

The Power of Agentic Architecture: Structuring our backend with the uAgents framework from Fetch.AI to create distinct agents (Recipe, Grocery) powered by a powerful LLM like Claude allows for modular, scalable, and highly capable systems. State Management is Crucial: For a feature like a voice companion, managing the state of the conversation and the recipe is just as important as the AI model itself. A small error can ruin the user experience. Data is Key for Personalization: A simple AI model can give generic answers, but integrating a RAG system with a vector database is what unlocks true, meaningful personalization that users notice and appreciate.

### What's next

Multi-Store Support: Expanding our grocery integration to include other major retailers like Safeway, Walmart, and Instacart. Recipe Discovery & Import: Allowing users to import recipes from their favorite websites and have Plateful automatically parse ingredients and instructions. Android Application: Developing a native Android version of Plateful to reach a wider audience. Smart Appliance Integration: Connecting with smart ovens, refrigerators, and other kitchen gadgets to further automate the cooking process.

## README (from the GitHub repository)

# Plateful

> Your AI kitchen agent that plans meals, orders groceries from Kroger, tracks your pantry, and guides you step-by-step with a voice companion to make cooking effortless.

<img src="./logo.png" alt="Plateful App" width="600">

---

## Authors

* [Zaid Madanat][linkedin-url-1]
* [Priyadarsi Mishra][linkedin-url-2]
* [Rajeev Duggirala][linkedin-url-3]
* [Ameen Mobedi][linkedin-url-4]

---

## Inspiration

The daily question of "What's for dinner?" often leads to decision fatigue, wasted food, and last-minute unhealthy choices. We were inspired to streamline the entire meal preparation process, from initial idea to finished plate. We envisioned a single, intelligent agent that could handle the mental load of planning, shopping, and tracking, allowing people to rediscover the joy of cooking without the usual stress. Plateful was born from the desire to make home cooking not just easier, but truly effortless and enjoyable.

---

## What it does

Plateful is a comprehensive kitchen assistant, powered by a sophisticated two-agent system and delivered through a native mobile experience.
1.  **Personalized AI Meal Planning (Recipe Agent):** The **Recipe Agent**, built on the **Claude API**, is the core planner. It analyzes your user profile—including macros, daily calorie targets, and dietary restrictions—to generate a full week of personalized recipes. Using a **Retrieval-Augmented Generation (RAG)** architecture, it learns from your meal history stored in a **ChromaDB** vector store to make its suggestions smarter and more tailored over time.
2.  **Smart Grocery Ordering (Grocery Agent):** Once you approve a meal plan, the **Grocery Agent** takes over. It communicates directly with the Recipe Agent, receives the ingredient list, and uses tools to interact with the **Kroger Public API**. It populates your cart with the exact items and quantities needed, making your entire weekly shop ready for checkout with a single click. 
3.  **Context-Aware Voice Companion:** Elevating the cooking experience, our voice companion offers hands-free guidance. Built with **LiveKit** for real-time audio streaming and **LlamaIndex** for context-awareness, it knows exactly which step you're on. You can ask questions and control the flow of the recipe with your voice, making the process interactive and seamless.

---

## How we built it

Plateful is built with a modern, mobile-first tech stack designed for a responsive user experience and a powerful, AI-driven backend.
* **Mobile App (Frontend):** A fully native iOS application built with **Swift** & **SwiftUI** to provide a fluid and intuitive user interface.
* **Backend:** A high-performance asynchronous backend built with **Python** & **FastAPI**, powering our agent-based system and managing all business logic.
* **AI & Language Models:**
    * **Agentic Framework:** Our multi-agent system is built using the **uAgents framework from Fetch.AI**, which orchestrates communication and tasks between our agents.
    * **Core Agent Logic:** The **Claude API** serves as the foundational intelligence for both the Recipe and Grocery agents, handling reasoning, planning, and tool usage within the uAgents framework.
    * **Memory & Personalization:** We use a **Retrieval-Augmented Generation (RAG)** architecture with **ChromaDB** as the vector store to provide our agents with long-term memory of user preferences.
    * **Voice Context:** **LlamaIndex** is used to build the context-aware query engine for the voice companion, allowing it to understand the recipe state.
* **Database:**
    * **User Data:** A **SQL Database** (e.g., PostgreSQL) stores user profiles, dietary information, and application data.
    * **Vector Storage:** **ChromaDB** is used for embedding and storing user meal interaction history.
* **APIs & Real-Time Communication:**
    * **Groceries:** **Kroger Public API** for product lookup and cart management.
    * **Voice Streaming:** **LiveKit** for real-time, low-latency audio and data streaming for the voice companion.

---

## Challenges we ran into

1.  **Agent Reliability:** Ensuring the Claude-powered agents within the uAgents framework could reliably interpret user needs, generate valid recipes, and correctly format API calls to Kroger required extensive prompt engineering and structured output validation.
2.  **Real-Time Voice Context:** Managing the conversational state between the user, LiveKit, and the LlamaIndex query engine in real-time was complex. Achieving low latency and accurate context-awareness to avoid frustrating the user during a hands-on cooking task was a major hurdle.
3.  **RAG Pipeline Tuning:** Fine-tuning the process of embedding user feedback (recipe selections/skips) and ensuring the retrieval from ChromaDB consistently provided useful, non-repetitive context for the LLM was a significant challenge.

---

## Accomplishments that we're proud of

* Successfully creating a seamless, end-to-end workflow from AI-driven meal plan generation to a verified Kroger grocery cart with a single click.
* Building a sophisticated RAG pipeline that truly learns from user behavior, making meal planning increasingly personalized.
* Implementing a genuinely context-aware voice companion that provides a hands-free cooking experience that feels natural and truly helpful.
---

## What we learned

* **The Power of Agentic Architecture:** Structuring our backend with the **uAgents framework from Fetch.AI** to create distinct agents (Recipe, Grocery) powered by a powerful LLM like Claude allows for modular, scalable, and highly capable systems.
* **State Management is Crucial:** For a feature like a voice companion, managing the state of the conversation and the recipe is just as important as the AI model itself. A small error can ruin the user experience.
* **Data is Key for Personalization:** A simple AI model can give generic answers, but integrating a RAG system with a vector database is what unlocks true, meaningful personalization that users notice and appreciate.

---

## What's next for Plateful

1.  **Multi-Store Support:** Expanding our grocery integration to include other major retailers like Safeway, Walmart, and Instacart.
2.  **Recipe Discovery & Import:** Allowing users to import recipes from their favorite websites and have Plateful automatically parse ingredients and instructions.
3.  **Android Application:** Developing a native Android version of Plateful to reach a wider audience.
4.  **Smart Appliance Integration:** Connecting with smart ovens, refrigerators, and other kitchen gadgets to further automate the cooking process.

---

[linkedin-url-1]: https://www.linkedin.com/in/zaid-madanat-8257001b3/
[linkedin-url-2]: https://www.linkedin.com/in/priyadarsi-mishra/
[linkedin-url-3]: https://www.linkedin.com/in/rajeev-duggirala-7307992b6/
[linkedin-url-4]: https://www.linkedin.com/in/aminmobedi/


## Detected evidence (automated analysis)

Indexed codebase: 99 recognized source files, 564 KB.
- Anthropic (technology) — detected in the code
- FastAPI (technology) — detected in the code
- Python (language) — detected in the code
- Swift (language) — detected in the code
- LlamaIndex (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (120 of 129)

```
.gitignore
AUTH_FLOW.md
buildServer.json
CalHacks-Agents/.gitignore
CalHacks-Agents/agentic_grocery_cursor_prompt.txt
CalHacks-Agents/agents/__init__.py
CalHacks-Agents/agents/grocery_agent/__init__.py
CalHacks-Agents/agents/grocery_agent/agent.py
CalHacks-Agents/agents/recipe_agent/__init__.py
CalHacks-Agents/agents/recipe_agent/agent.py
CalHacks-Agents/agents/recipe_agent/daily_meals.py
CalHacks-Agents/auth.py
CalHacks-Agents/chroma_service.py
CalHacks-Agents/data/user_profile.json
CalHacks-Agents/database.py
CalHacks-Agents/debug_grocery_endpoint.py
CalHacks-Agents/debug_recipe_agent.py
CalHacks-Agents/debug_registration.py
CalHacks-Agents/env.example
CalHacks-Agents/grocery_list_kroger.json
CalHacks-Agents/LICENSE
CalHacks-Agents/main.py
CalHacks-Agents/README.md
CalHacks-Agents/requirements.txt
CalHacks-Agents/test_api.py
CalHacks-Agents/test_both_grocery_endpoints.py
CalHacks-Agents/test_complete_recipe_to_grocery_flow.py
CalHacks-Agents/test_complete_recipe_to_grocery_with_kroger.py
CalHacks-Agents/test_daily_meals.py
CalHacks-Agents/test_direct_db.py
CalHacks-Agents/test_e2e_user_flow.py
CalHacks-Agents/test_grocery_flow_with_sample_recipe.py
CalHacks-Agents/test_improved_kroger_search.py
CalHacks-Agents/test_kroger_api_direct.py
CalHacks-Agents/test_kroger_api.py
CalHacks-Agents/test_kroger_comprehensive.py
CalHacks-Agents/test_kroger_endpoint_direct.py
CalHacks-Agents/test_minimal_registration.py
CalHacks-Agents/test_protocol.py
CalHacks-Agents/test_recipe_agent_simple.py
CalHacks-Agents/test_recipe_agent_weekly.py
CalHacks-Agents/test_recipe_agent.py
CalHacks-Agents/TEST_SUMMARY.md
CalHacks-Agents/test_weekly_recipes_by_day.py
CalHacks-Agents/utils/__init__.py
CalHacks-Agents/utils/image_generator.py
CalHacks-Agents/utils/logger.py
CalHacks-Agents/weekly_recipes_20251025_173747.json
CalHacks-Agents/weekly_recipes_20251025_174013.json
CalHacks-Agents/weekly_recipes_20251025_174456.json
CalHacks-Agents/weekly_summary_20251025_173747.json
CalHacks-Agents/weekly_summary_20251025_174013.json
CalHacks-Agents/weekly_summary_20251025_174456.json
Cooking-Companion/.gitignore
Cooking-Companion/cooking_companion.py
Cooking-Companion/cooking-companion.config.yaml
Cooking-Companion/data/recipe.txt
Cooking-Companion/requirements.txt
Cooking-Companion/tasks.yaml
ENV_SETUP.md
Grocery-Agent-ios/.gitignore
Grocery-Agent-ios/.Rules
Grocery-Agent-ios/build.log
Grocery-Agent-ios/buildServer.json
Grocery-Agent-ios/Grocery Agent.xcodeproj/project.pbxproj
Grocery-Agent-ios/Grocery Agent.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Grocery-Agent-ios/Grocery Agent.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Grocery-Agent-ios/Grocery Agent.xcodeproj/xcuserdata/madanat.xcuserdatad/xcschemes/xcschememanagement.plist
Grocery-Agent-ios/Grocery Agent/Assets.xcassets/AccentColor.colorset/Contents.json
Grocery-Agent-ios/Grocery Agent/Assets.xcassets/AppIcon.appiconset/Contents.json
Grocery-Agent-ios/Grocery Agent/Assets.xcassets/Contents.json
Grocery-Agent-ios/Grocery Agent/Components/FloatingActionButton.swift
Grocery-Agent-ios/Grocery Agent/Components/MacroRing.swift
Grocery-Agent-ios/Grocery Agent/Components/MacroSlidersView.swift
Grocery-Agent-ios/Grocery Agent/Components/MealCardView.swift
Grocery-Agent-ios/Grocery Agent/Components/SelectableChip.swift
Grocery-Agent-ios/Grocery Agent/ContentView.swift
Grocery-Agent-ios/Grocery Agent/Grocery_AgentApp.swift
Grocery-Agent-ios/Grocery Agent/Models/AuthDTOs.swift
Grocery-Agent-ios/Grocery Agent/Models/BackendDTOs.swift
Grocery-Agent-ios/Grocery Agent/Models/GroceryModels.swift
Grocery-Agent-ios/Grocery Agent/Models/MealModels.swift
Grocery-Agent-ios/Grocery Agent/Models/NotificationModels.swift
Grocery-Agent-ios/Grocery Agent/Models/UserPreferences.swift
Grocery-Agent-ios/Grocery Agent/Services/APIClient.swift
Grocery-Agent-ios/Grocery Agent/Services/AppEnvironment.swift
Grocery-Agent-ios/Grocery Agent/Services/AuthService.swift
Grocery-Agent-ios/Grocery Agent/Services/MockDataService.swift
Grocery-Agent-ios/Grocery Agent/Services/PreferenceStore.swift
Grocery-Agent-ios/Grocery Agent/Services/VoiceService.swift
Grocery-Agent-ios/Grocery Agent/Services/VoiceSessionManager.swift
Grocery-Agent-ios/Grocery Agent/Theme/AgentColors.swift
Grocery-Agent-ios/Grocery Agent/Utilities/DateFormatter+Extensions.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/AppViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/DashboardViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/GroceryListViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/InventoryViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/LoginViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/MacroAnalyticsViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/NotificationsViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/OnboardingViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/PreferencesViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/RecipeDetailViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/SettingsViewModel.swift
Grocery-Agent-ios/Grocery Agent/ViewModels/SignUpViewModel.swift
Grocery-Agent-ios/Grocery Agent/Views/Analytics/MacroAnalyticsView.swift
Grocery-Agent-ios/Grocery Agent/Views/Auth/LoginView.swift
Grocery-Agent-ios/Grocery Agent/Views/Auth/SignUpView.swift
Grocery-Agent-ios/Grocery Agent/Views/Dashboard/DashboardView.swift
Grocery-Agent-ios/Grocery Agent/Views/Grocery/GroceryListView.swift
Grocery-Agent-ios/Grocery Agent/Views/Inventory/InventoryView.swift
Grocery-Agent-ios/Grocery Agent/Views/MainShellView.swift
Grocery-Agent-ios/Grocery Agent/Views/Notifications/NotificationsView.swift
Grocery-Agent-ios/Grocery Agent/Views/Onboarding/OnboardingFlowView.swift
Grocery-Agent-ios/Grocery Agent/Views/Preferences/PreferencesView.swift
Grocery-Agent-ios/Grocery Agent/Views/Recipe/RecipeDetailView.swift
Grocery-Agent-ios/Grocery Agent/Views/Settings/SettingsView.swift
Grocery-Agent-ios/Grocery-Agent-Info.plist
ops/gpt_tasks.yaml
QUICK_START.md
[9 more files omitted for size]
```

### Dependencies

- CalHacks-Agents/requirements.txt: anthropic@==0.18.1, fastapi@==0.109.0, httpx@==0.26.0, jinja2@==3.1.3, passlib[bcrypt]@==1.7.4, pydantic@==2.8.2, python-dotenv@==1.0.0, python-jose[cryptography]@==3.3.0, requests@==2.31.0, rich@==13.7.0, sqlalchemy@==2.0.23, uagents@==0.20.1, uvicorn[standard]@==0.30.6
- Cooking-Companion/requirements.txt: anthropic@>=0.69, duckduckgo-search@>=8.0, livekit-agents[openai, cartesia, elevenlabs, deepgram, silero, turn-detector, mcp, anthropic]@>=1.0, llama-index-core@>=0.14, llama-index-embeddings-openai@>=0.5, llama-index-llms-anthropic@>=0.9, python-dotenv@>=1.0

### Recent commits (newest first)

- Minor fix
- Minor fixes
- Merge branch 'main' of https://github.com/ZaidMadanat/Grocery-agent
- Pushing final
- Update README.md
- Update README.md
- Update README.md
- Update README.md
- Update README.md
- Add files via upload
- Create README.md
- cooking companion works
- added full livekit functionality, TD: format reading
- backend, livekit, frontend fix
- Merge pull request #1 from ZaidMadanat/my-feature
- fixed issue
- fixes to backend, api calls
- implementation of API and Full Stack v1
- Monorepo: convert submodules to regular dirs; integrate LiveKit session token + agent handoff, weekly meal generation, grocery item CRUD, inventory + notifications, recipe detail + QA; add ops/gpt_tasks.yaml and ENV_SETUP.md; update README.
- Integrate LiveKit token endpoints, inventory/notification models, and ops tasks

## Key source files (fetched from GitHub, selected and truncated for size)

### ENV_SETUP.md

```markdown
# Environment Configuration

This workspace relies on a shared `.env` file at the repository root. It centralizes the credentials needed by the FastAPI backend, the LiveKit worker, and any CLI tooling.

## Active Secrets

| Variable | Service | Purpose |
| --- | --- | --- |
| `LIVEKIT_URL` | LiveKit Cloud | WebSocket endpoint for realtime sessions |
| `LIVEKIT_API_KEY` / `LIVEKIT_API_SECRET` | LiveKit Cloud | Signs room tokens for voice sessions |
| `ANTHROPIC_API_KEY` | Anthropic Claude | LLM generations (recipes, RAG answers) |
| `DEEPGRAM_API_KEY` | Deepgram | Speech-to-text and text-to-speech for the cooking companion |
| `OPENAI_API_KEY` | OpenAI | Embeddings (LlamaIndex recipe vectorization) |

All values are recorded as plain key/value pairs inside `.env`. The file is ignored by Git, so the secrets remain local by default.

## Usage

1. **Load locally**
   ```bash
   source .env
   ```
   or rely on tools like `python-dotenv` / `dotenv` which read automatically.

2. **Backend (`CalHacks-Agents`)**
   - The FastAPI app pulls these keys at startup (`python main.py` or `uvicorn` run).

3. **LiveKit worker (`Cooking-Companion`)**
   - The worker imports `dotenv` at launch (`python cooking_companion.py`) and uses the same `.env`.

4. **iOS client**
   - The app should request LiveKit tokens via `/session/create`; do **not** hardcode secrets in Swift code.

## Security Notes

- Keep `.env` out of source control (see `.gitignore` entry).
- Rotate keys periodically, especially for demo environments.
- When sharing the repo externally, supply a sanitized `.env.example` instead of the live file.

```

### QUICK_START.md

```markdown
# 🚀 Quick Start Guide

## ✅ CURRENT STATUS

- **Backend API**: ✅ RUNNING on http://localhost:8000
- **Voice Worker**: Ready to start
- **iOS App**: Ready to run

---

## 📱 TO RUN THE APP

### 1️⃣ Backend (Already running!)

The backend is already running! You can:
- View API docs: http://localhost:8000/docs
- Health check: http://localhost:8000/health
- Stop it: `pkill -f uvicorn` (if needed)

### 2️⃣ Voice Worker (Optional)

In a NEW terminal:
```bash
cd /Users/madanat/Documents/Grocery-agent
./start_voice_worker.sh
```

### 3️⃣ iOS App

Open Xcode:
```bash
open "Grocery-Agent-ios/Grocery Agent.xcodeproj"
```

Then:
- Press ⌘B to build
- Press ⌘R to run
- Choose a simulator or device

---

## 🧪 TEST THE BACKEND

Register a user:
```bash
curl -X POST http://localhost:8000/auth/register \
  -H 'Content-Type: application/json' \
  -d '{
    "email":"test@example.com",
    "username":"testuser",
    "password":"testpass123",
    "name":"Test User",
    "daily_calories":2200,
    "dietary_restrictions":["vegetarian"],
    "likes":["indian"]
  }'
```

Login (get token):
```bash
curl -X POST http://localhost:8000/auth/login \
  -H 'Content-Type: application/json' \
  -d '{
    "email":"test@example.com",
    "password":"testpass123"
  }'
```

---

## 🛑 TO STOP EVERYTHING

```bash
# Stop backend
pkill -f uvicorn

# Stop voice worker  
pkill -f cooking_companion
```

---

## 📝 WHAT'S RUNNING

- **Backend**: FastAPI with recipe/grocery agents
- **Voice Worker**: LiveKit + Claude for cooking instructions  
- **iOS App**: Your SwiftUI grocery management app

See `STARTUP_GUIDE.md` for full details!

```

### CalHacks-Agents/requirements.txt

```
fastapi==0.109.0
uvicorn[standard]==0.30.6
uagents==0.20.1
pydantic==2.8.2
httpx==0.26.0
anthropic==0.18.1
python-dotenv==1.0.0
requests==2.31.0
jinja2==3.1.3
rich==13.7.0
sqlalchemy==2.0.23
passlib[bcrypt]==1.7.4
python-jose[cryptography]==3.3.0

```

### Cooking-Companion/requirements.txt

```
livekit-agents[openai, cartesia, elevenlabs, deepgram, silero, turn-detector, mcp, anthropic]>=1.0
python-dotenv>=1.0
duckduckgo-search>=8.0

# LlamaIndex (for RAG over recipes) - updated versions for compatibility
llama-index-core>=0.14
llama-index-llms-anthropic>=0.9
llama-index-embeddings-openai>=0.5
# Anthropic SDK
anthropic>=0.69

```

### start_voice_worker.sh

```shell
#!/bin/bash
set -e

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"

if [ -f "$ROOT_DIR/.venv-worker/bin/activate" ]; then
  source "$ROOT_DIR/.venv-worker/bin/activate"
fi

echo "🎙️  Starting Voice Worker (LiveKit + Claude)"
python Cooking-Companion/cooking_companion.py dev

```

### start_backend.sh

```shell
#!/bin/bash
set -e

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR/CalHacks-Agents"

if [ -f "$ROOT_DIR/.venv/bin/activate" ]; then
  # Reuse the repo-managed virtualenv when available
  source "$ROOT_DIR/.venv/bin/activate"
fi

export PYTHONPATH="$ROOT_DIR:$PYTHONPATH"
echo "🚀 Starting Backend API on http://localhost:8000"
echo "📖 API Docs: http://localhost:8000/docs"
uvicorn main:app --host 0.0.0.0 --port 8000 --reload

```

### scripts/run_worker.sh

```shell
#!/usr/bin/env bash
set -euo pipefail

if [ ! -d .venv-worker ]; then
  echo "[run_worker] Missing .venv-worker. Run scripts/setup_worker.sh first." >&2
  exit 1
fi

source .venv-worker/bin/activate
exec python Cooking-Companion/cooking_companion.py

```

### scripts/setup_backend.sh

```shell
#!/usr/bin/env bash
set -euo pipefail

echo "[setup_backend] Creating Python virtual environment .venv"
python -m venv .venv
source .venv/bin/activate

echo "[setup_backend] Upgrading pip toolchain"
python -m pip install --upgrade pip setuptools wheel

echo "[setup_backend] Installing backend requirements"
pip install -r CalHacks-Agents/requirements.txt

echo "[setup_backend] Done. Activate with: source .venv/bin/activate"

```

### scripts/setup_worker.sh

```shell
#!/usr/bin/env bash
set -euo pipefail

echo "[setup_worker] Creating Python virtual environment .venv-worker"
python -m venv .venv-worker
source .venv-worker/bin/activate

echo "[setup_worker] Upgrading pip toolchain"
python -m pip install --upgrade pip setuptools wheel

echo "[setup_worker] Installing worker requirements"
pip install -r Cooking-Companion/requirements.txt

echo "[setup_worker] Done. Activate with: source .venv-worker/bin/activate"

```

### scripts/run_backend.sh

```shell
#!/usr/bin/env bash
set -euo pipefail

# Ensure backend venv exists
if [ ! -d .venv ]; then
  echo "[run_backend] Missing .venv. Run scripts/setup_backend.sh first." >&2
  exit 1
fi

# Activate venv
source .venv/bin/activate

# Run from the backend project root so 'agents' is importable
cd CalHacks-Agents

# Ensure repo root is on PYTHONPATH (for imports like 'database', 'auth')
export PYTHONPATH="$(dirname "$PWD"):${PYTHONPATH:-}"

echo "[run_backend] Starting FastAPI at http://localhost:8000 (docs at /docs)"
exec uvicorn main:app --host 0.0.0.0 --port 8000

```

[88 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]