Update nutrition score retrieval using OFF v2 REST API and title cleaning

This commit is contained in:
sriram
2026-08-10 18:54:27 +05:30
parent 72dd9f8296
commit 370f867355
43 changed files with 2088 additions and 373 deletions

View File

@@ -1,4 +1,4 @@
# Kirana AI — RAG-Powered Brand Product Search Engine
# RAG-Powered Brand Product Search Engine
This is the v2.0 upgrade of the Indian FMCG product catalog project: the
same discovery/enrichment pipeline (Ollama + pgvector + S3 image
@@ -38,27 +38,28 @@ main docs once.
> write-up, or jump straight to `backend/scripts/enrich_nutrition.py`
> and `backend/scripts/train_nutrition_models.py` to try it.
## Fastest path to a working demo
## Fastest Path to Execute Project (Instant 1-Command Startup)
The project now includes a **unified single-command launcher** and **automated background initialization**. You no longer need to manually run multiple seed scripts or manage separate terminals:
```bash
# 1. Backend
cd backend
python3 -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env # edit DB_PASSWORD, see docs
docker compose -f ../docker-compose.yml up -d # local Postgres+pgvector (skip if you already have one)
python scripts/seed_sample_data.py # loads bundled sample catalogs - no LLM needed
ollama pull qwen2.5:1.5b # one-time
uvicorn app.main:app --reload --port 8000
# Single command from project root (starts Docker, Backend, and Frontend):
python run_project.py
# 2. Frontend (new terminal)
cd frontend
npm install
npm run dev
# Or on Windows, double-click:
start_app.bat
```
Open http://localhost:5173, pick a brand, try the search bar, then switch
to **Ask AI** and ask something like "recommend a low sugar biscuit".
The system automatically:
1. Starts the PostgreSQL container via Docker Desktop.
2. Checks database status and skips redundant seeding for instant boot (< 2 seconds).
3. Launches Backend API (`http://localhost:8000`) and Frontend UI (`http://localhost:5173`) concurrently.
4. Auto-seeds missing catalogs or store intelligence in the background if the database is empty.
### Individual Commands (Optional / Advanced)
- Backend: `start_backend.bat` or `python -m uvicorn app.main:app --reload --port 8000`
- Frontend: `start_frontend.bat` or `npm run dev`
- System Status API: `http://localhost:8000/api/system/status`
## Why this exists (what changed from v1.0)