Inspiration

We've been developing findify.best, an AI-powered shopping assistant that helps users find the right products based on their preferences. It worked well, but relied entirely on server-based AI - meaning slow API calls, privacy concerns about data leaving the user's device, and constant server costs.

When Chrome announced Gemini Nano, I saw this as more than just a new feature. It was a technical challenge: could we take an existing server-based AI application and successfully migrate it to run entirely in the browser? Could we compress all that functionality - the AI model, the analysis logic, the data processing - into a Chrome extension that runs completely on-device?

This wasn't about building something from scratch. This was about proving that complex AI applications could be freed from servers and brought directly to where users actually shop, with zero latency and complete privacy.

What It Does

Findify is a Chrome extension that transforms online shopping using Gemini Nano:

Core Features:

  • Personalized product scoring (0-100) based on individual user preferences
  • Smart comparison of up to 5 products with AI-generated analysis
  • Review sentiment analysis that processes hundreds of reviews instantly
  • Track Me mode that automatically analyzes products across multiple pages as you browse
  • Multi-language support (English, Turkish, French, Spanish)
  • Works on Amazon, eBay, AliExpress, Walmart, Best Buy, and Target

What makes it different: Everything runs on-device. The extension injects directly into shopping pages, extracts product information, and analyzes it using Gemini Nano - all without sending a single byte to any server.

How We Built It

We migrated our server-based application to run entirely in the browser using Gemini Nano. This required a complete architectural rewrite.

Technical Stack:

  • Gemini Nano via Chrome's Prompt API
  • Manifest V3 service worker architecture
  • 24 modular JavaScript files (11,734 lines)
  • Content scripts for real-time page integration

Key Implementations:

  • Rewrote AI prompts from 1000+ to 250-800 characters for speed
  • AI session warmup system reducing first response time by 50%
  • Batch processing for browser memory constraints
  • Site-specific extractors with flexible selectors
  • Security measures: prompt injection protection and XSS prevention

The extension is a complete rewrite, not a port. We rethought data flow, state management, and user interactions for the browser environment.

Challenges We Faced

1. Gemini Nano's Inconsistent Responses The same prompt would sometimes return well-formatted JSON, sometimes plain text, sometimes incomplete responses. This made reliable parsing extremely difficult. Solution: Implemented multiple parsing strategies with fallbacks, strict prompt engineering with explicit output format instructions, and retry logic for malformed responses.

2. Performance Optimization Initial responses took 60-90 seconds. Solution: Session warmup, prompt optimization (1000+ chars to 250-800 chars), and batch processing reduced average to 10-12 seconds.

3. Regex Hell for Product Extraction Each e-commerce site structures data differently. eBay's API was inconsistent, Amazon changes selectors frequently, AliExpress uses dynamic class names. Regex patterns that worked one day would break the next. Solution: Built multiple extraction strategies per site with cascading fallbacks, combining CSS selectors, regex patterns, and DOM traversal.

4. Browser Memory Constraints Analyzing 100+ products across multiple pages pushed browser limits. Solution: Smart session management, efficient batch processing (5 products at a time), and aggressive cleanup on page navigation.

5. Cross-Site Compatibility Testing on 20+ regional sites revealed unique quirks for each. Solution: Flexible site-configs with locale-specific selectors and extensive real-world testing.

What We Learned

On-device AI requires architectural rethinking. Performance constraints forced better design decisions. Privacy becomes automatic when there's no server.

Key insights:

  • Gemini Nano's inconsistency taught us to build robust parsing with multiple fallback strategies
  • Shorter prompts (250-800 chars) are faster, not just smaller
  • Browser memory limits inspire efficient algorithms
  • Regex patterns need constant maintenance across e-commerce sites
  • What worked on servers often doesn't work in browsers - migration requires humility to rewrite working code

The result: The extension is faster, more private, and offers features (like Track Me mode) impossible with server-based approaches.


What's Next

Short Term:

  • More sites
  • Price history tracking
  • Deal alerts
  • Export comparisons

Medium Term:

  • Budget optimization
  • Visual similarity search
  • Community ratings

Long Term:

  • Integration with future Chrome AI capabilities
  • Multi-modal analysis (image + text)

Built With

  • gemini-nano
  • gemininano
  • javascript-(es6+)
Share this project:

Updates