Product Suggestor is an MVP that helps buyers make better purchase decisions before checkout. It analyzes Amazon and Flipkart product links, matches products against a pre-indexed review narrative dataset, and falls back to local LLM analysis when no strong dataset match exists.
E-commerce shoppers lack reliable decision support before purchase. They frequently face:
- Inconsistent sizing and quality expectations
- Misleading product representation
- Untrustworthy or low-signal review sections
This uncertainty contributes to high return rates (often 20-40%), logistics waste, and reduced user trust.
This project is a real-time decision intelligence platform that intercepts buyer uncertainty at the point of consideration.
- Input: A product URL from Amazon.in/Amazon.com or Flipkart.com
- Process: Scrape key product metadata, attempt dataset-based confidence match, then optionally run AI analysis
- Output: A concise objective insight (summary, pros/cons, verdict) to support purchase decisions
The backend uses a two-stage inference strategy:
- Fast deterministic dataset match
- AI fallback for unmatched products
dataset/final_narratives.csvis loaded at startup.- Product titles are indexed with Fuse.js fuzzy search.
- If a confident match is found (
score <= 0.35), the API returns precomputed narrative output immediately.
Benefits:
- Low latency
- Consistent output format
- No LLM dependency for known products
- If no confident dataset match exists, the system scrapes on-page reviews.
- Reviews and product metadata are sent to a local Ollama model.
- The model is prompted to return:
SUMMARY,PROS,CONS,VERDICT. - Response text is parsed into structured JSON for the UI.
- Runtime: Node.js + Express
- API route:
POST /api/analyze - Health route:
GET /api/health - Scraping: Puppeteer
- Matching: Fuse.js
- AI: Ollama local inference API
- Vanilla HTML/CSS/JS single-page interface
- URL validation for supported domains
- Loading skeleton + rotating status messages
- Result card with source labels:
- Dataset Match
- AI Generated
- Fallback
- User submits a product URL.
- API validates domain support.
- Scraper extracts title, price, rating, review count, image.
- Matcher searches dataset for confident title match.
- If matched: return precomputed narrative insight.
- If unmatched: scrape reviews and generate AI insight via Ollama.
- UI renders product facts + insight source and recommendation.
- Node.js
- Express
- Puppeteer
- Fuse.js
- csv-parser
- dotenv
- Ollama (local model serving)
.
├─ server.js # App bootstrap, dataset init, route mounting
├─ src/
│ ├─ routes/analyze.js # Main analyze endpoint
│ ├─ scraper.js # Amazon/Flipkart extraction logic
│ ├─ matcher.js # CSV indexing + fuzzy match logic
│ └─ ai.js # Ollama prompting + response parsing
├─ public/
│ ├─ index.html # UI layout
│ ├─ style.css # UI styling and animation
│ └─ app.js # UI behavior + API calls
└─ dataset/
├─ final_narratives.csv # Runtime matching dataset
└─ complete_results.csv # Extended processing artifact
- Node.js 18+
- npm
- (Optional but recommended) Ollama for AI fallback mode
npm installCreate an .env file in the project root:
PORT=3000
CSV_PATH=./dataset/final_narratives.csv
OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=gemma2-localNotes:
CSV_PATHdefaults to./dataset/final_narratives.csvif unset.- If Ollama is offline, dataset match mode still works.
Development:
npm run devProduction:
npm startOpen in browser:
http://localhost:3000
Request body:
{
"url": "https://www.amazon.in/..."
}Success response shape:
{
"product": {
"title": "string",
"price": "string",
"rating": "string",
"reviewCount": "string",
"image": "string|null",
"url": "string",
"site": "amazon|flipkart"
},
"insight": {
"summary": "string",
"pros": ["string"],
"cons": ["string"],
"verdict": "string",
"source": "dataset|ai|fallback"
}
}Possible error codes:
400: Missing/invalid URL or unsupported domain422: Product page scraping failed500: Unexpected server-side error
Returns:
- Server status and uptime
- Number of indexed products
- Ollama availability and discovered models
- Supports only Amazon and Flipkart domains.
- Scraping selectors may break if site markup changes.
- Dataset quality can affect narrative reliability.
- AI fallback quality depends on local model availability and hardware performance.
- No automated test suite is currently configured.
The system demonstrates a practical hybrid design for buyer decision support:
- Deterministic retrieval for speed and consistency
- Generative reasoning for long-tail products
- Source-aware transparency so users know where insight came from
This pattern can reduce uncertainty before purchase, improve trust, and potentially reduce avoidable returns.
- Add richer trust scoring and confidence calibration
- Expand site support and selector resilience
- Add review authenticity and anomaly checks
- Introduce evaluation benchmarks and automated tests
- Add persistent analytics for decision outcomes