Getting Started
This guide will help you set up and run the AI Ingredient Scanner on your machine.
Prerequisitesโ
| Requirement | Version |
|---|---|
| Python | 3.11+ |
| Node.js | 18+ (for mobile app) |
| Google Cloud API key | Gemini |
| Qdrant Cloud account | Free tier available |
Backend Setupโ
1. Clone Repositoryโ
git clone https://github.com/udaytamma/AiIngredientScanner.git
cd AiIngredientScanner
2. Create Virtual Environmentโ
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
3. Install Dependenciesโ
pip install -r requirements.txt
4. Configure Environmentโ
Create a .env file in the project root:
# Required
GOOGLE_API_KEY=your_gemini_api_key
QDRANT_URL=your_qdrant_cloud_url
QDRANT_API_KEY=your_qdrant_api_key
# Optional
REDIS_URL=your_redis_connection_string
LANGCHAIN_API_KEY=your_langsmith_api_key
Getting API Keys
- Google Gemini: Google AI Studio
- Qdrant Cloud: Qdrant Cloud Console
5. Verify Connectionsโ
python test_connections.py
6. Run the Applicationโ
Option A: Streamlit Web Interface
streamlit run app.py
Option B: REST API (for mobile app)
uvicorn api:app --host 0.0.0.0 --port 8000
Mobile App Setupโ
See the Mobile App Setup Guide for detailed instructions.
Quick Startโ
cd mobile
npm install
# Update API URL in src/services/api.ts
# Replace with your machine's IP address
npx expo start
# Scan QR code with Expo Go app
First Analysisโ
- Open the Streamlit interface at
http://localhost:8501 - Enter a product name (optional)
- Paste an ingredient list
- Configure your profile (allergies, skin type)
- Click Analyze
- View your personalized safety report!
Project Structureโ
AiIngredientScanner/
โโโ app.py # Streamlit web interface
โโโ api.py # FastAPI REST endpoints
โโโ graph.py # LangGraph workflow
โโโ agents/ # AI agents
โ โโโ research.py # Ingredient research
โ โโโ analysis.py # Report generation
โ โโโ critic.py # Quality validation
โ โโโ supervisor.py # Workflow routing
โโโ tools/ # Utility tools
โโโ prompts/ # LLM prompts
โโโ config/ # Configuration
โโโ mobile/ # React Native app
โโโ tests/ # Test suite
Next Stepsโ
Troubleshootingโ
Common Issuesโ
"Cannot connect to Qdrant"
- Verify your
QDRANT_URLandQDRANT_API_KEYare correct - Check your network connection
"API key not valid"
- Ensure
GOOGLE_API_KEYis set correctly - Check if the key has Gemini API access enabled
"Module not found"
- Activate your virtual environment
- Run
pip install -r requirements.txtagain