💡 The Genesis of QuickMind: On-Device AI for Effortless Productivity
Inspiration
The project was born from the friction inherent in using modern cloud-based AI. Productivity is constantly disrupted by the multi-step process required: copying text, opening a new tab, pasting, prompting, and waiting for a distant server response. More critically, this process compromises user privacy by sending sensitive data to the cloud.
My goal was to create a productivity tool that was instant, private, and prompt-free. The solution was to leverage Google's built-in on-device AI (Gemini Nano), shifting processing locally to deliver immediate results while ensuring zero data leaves the device.
What it does
QuickMind is a Chrome Extension that transforms any highlighted text on the web into a condensed summary or a real-time translation—all with a single right-click.
- Instant Summarization: Summarizes articles and long texts.
- Multilingual Translation: Provides fast, on-device translation between languages.
- Privacy Guaranteed: All functions run 100% locally using Chrome's native AI APIs.
How we built it
QuickMind is a standard Chrome Extension structured with:
- A Service Worker (
background.js): Handles all communication with the underlying AI APIs. - A Content Script (
content.js): Manages the user interface, injecting the result dialog directly onto the active webpage.
The core functionality relies on two experimental native Chrome APIs: the Summarizer and the Translator. The architecture enforces a strict on-device only policy, with no cloud fallback.
Challenges we ran into
| Category | Challenge | Solution Implemented |
|---|---|---|
| Instability Risk: Service Worker Lifecycle | The greatest instability risk was the "long-running operation" of await Summarizer.create(). Since initialization can take several seconds, Chrome's lifecycle manager often killed the Service Worker before the model was ready. |
Implemented a defensive initialization pattern using global state flags and a polling promise. This ensures only one creation process runs at a time, protecting the worker from concurrent calls and premature death. |
| Token Limit & Long Context | The initial summarizer failed on long articles because the on-device API has limited input tokens ($\approx 6,144$ tokens, or $\approx 20,000$ characters for Gemini Nano). | Developed the Summary of Summaries technique (a recursive Map-Reduce algorithm) to chunk the text and progressively reduce it, enabling summarization of full-length articles. |
| Service Worker and Dynamic State | Switching between target languages created persistent errors. The Service Worker architecture caused the Translator object's state to be unstable, complicating instance management. |
The fix involved careful state tracking and safely resetting the instance to null before creating a new language pair object, working around the API's lack of a dispose() method. |
Accomplishments that we're proud of
- Overcoming Token Limits: Successfully implemented the Summary of Summaries Map-Reduce technique, a complex architectural fix that enables the extension to handle long documents where the underlying API would normally fail.
- Lifecycle Stability: Engineered a robust, defensive pattern to prevent the Service Worker from being killed during model initialization, ensuring high reliability for the core features.
- Guaranteed Privacy: Delivering a fully functional, AI-powered tool with the fundamental guarantee that no user data ever leaves their device.
- Translator Speed: Achieving near-instantaneous translation, showcasing the immense speed advantage of the on-device model over cloud alternatives.
What we learned
- On-Device Constraints: We learned that while on-device AI is fast and private, it imposes strict constraints (token limits, hardware requirements) that necessitate creative algorithmic solutions like Map-Reduce.
- API Nuances: Mastering the Chrome Service Worker lifecycle is critical for long asynchronous tasks. We had to build custom solutions to manage object state and prevent worker termination.
- Performance Trade-offs: Our custom Map-Reduce Summarizer is slower than Chrome's built-in version due to the overhead, but our Translator is exceptionally fast. This highlighted the differences in model optimization within the on-device ecosystem.
- Value Proposition: Even as Chrome adopts similar native features, QuickMind's value remains in providing a customizable, prompt-free, and privacy-guaranteed user experience.
What's next for QuickMind
- 🔍 Add more features: Implement more features like proofreading, writing assistance, etc.
- 🗂️ Local History: Introduce a feature to save a local history of processed results for easy reference.
- 🌈 UI Refinements: Continuous improvements to the user interface for even smoother and more intuitive interaction.
- 💬 Expanded Support: Add more language options and customizable tone settings for output.
Built With
- chrome
- css
- google-built-in-ai-apis
- google-gemina-nano
- html
- javascript
Log in or sign up for Devpost to join the conversation.