🧠 Context Companion – The Perfect Hybrid AI for Chrome

💡 Inspiration

Google is revolutionizing the browsing experience by integrating powerful AI directly into the Chrome browser. This creates a massive opportunity, but it also highlights three critical problems for the modern user:

  1. Information Overload: The average user struggles to assess the credibility of news and filter out the noise of biased or sensational content.
  2. AI Accessibility: Powerful AI tools are locked behind paywalls or complex interfaces, limiting access to most users.
  3. Media Literacy Gap: Most people lack the tools to critically analyze the content they consume daily, leaving them vulnerable to misinformation.

The Chrome AI Challenge inspired us to build exactly what this new ecosystem needs: an extension that democratizes AI, makes it universally accessible, and solves the problem of media literacy—all from the browser’s Side Panel.


⚙️ What It Does

Context Companion is a hybrid AI assistant that analyzes any webpage in a single click.

🏆 A Full Showcase of Chrome’s Built-In AI Capabilities

This extension serves as a technical showcase of the entire Chrome Built-In AI suite, demonstrating the power of a hybrid model:

  • Summarizer API: Summarizes the article with clear bullet points.
  • Translator API: Translate the content to any language with just one click.
  • Rewriter API: Rewrites text neutrally to eliminate bias or exaggeration.
  • Proofreader API: Checks for grammar, style, and readability.
  • Writer API: Generate content such as Headline, Summary, and Tweet.
  • Prompt API: Our custom "Bias Analysis" that uses complex prompts to assess political bias.

✨ Key Features for Users

  • 🎯 Bias Detection: Quantifies political bias (left, right, neutral) and highlights evidence on the page. Our algorithm uses a multi-layered approach involving both language and contextual analysis.
  • 🛡️ Credibility Assessment: Multi-factor evaluation based on tone, sources, and consistency. It helps users judge whether the article is trustworthy.
  • 🔍 Interactive Evidence: Click a button to see the exact phrases the AI used for its bias analysis—highlighted directly on the page you’re reading. This feature promotes transparency and trust.
  • ✍️ Full Writing Toolkit: A comprehensive suite of writing tools—Neutral Rewriter, Translation, Proofreading, and Content Generation—that empowers users to enhance any piece of content.

🧩 How We Built It: The "Best Hybrid" Architecture

We designed a seamless, three-layer system that makes everything “just work”:

Frontend (Chrome Side Panel) → AI Shim Layer (The "Hybrid" Brain) → Backend (Cloudflare Worker + Gemini).

🧠 Technical Stack

  • Frontend Layer: A Chrome Extension (Manifest V3) using the Side Panel API for a smooth UX.
  • AI Integration Layer (The "Hybrid" Core): A JavaScript class acting as the "brain" for routing tasks.

    class ChromeAIShim {
      constructor() {
        // Auto-detects on-device AI (Nano) vs. Cloud
        this.mode = this.detectAICapabilities();
        this.apis = this.createUnifiedAPIInterface();
      }
    
      detectAICapabilities() {
        return (window.ai && window.ai.canCreateTextSession) ? 'local' : 'cloud';
      }
    }
    
  • Backend Services: Stateless Cloudflare Worker for edge-computing ensuring low-latency responses (avg. < 200ms).

  • AI Model: Powered by Google Gemini (gemini-2.5-flash-lite), called via RESTful API with JSON schema validation.

🔑 Key Technical Decisions

  • Hybrid AI Architecture: On-Device for fast, privacy-first tasks like translation and proofreading. Cloud for complex tasks such as bias analysis and content generation.
  • Resilience: If on-device AI isn’t available, the extension routes all tasks to the cloud—ensuring a seamless experience for everyone.
  • Real-time Processing: Parallel processing for summary and bias analysis delivers results in under 3 seconds.
  • Content Extraction: Programmatic DOM parsing to remove ads and navigation, isolating the article’s core text ($O(n \log n)$ complexity).

⚠️ Challenges We Faced

  • Building for the Future: The Chrome AI APIs are still in early development. We built our ChromeAIShim layer to simulate the proposed APIs, allowing us to future-proof while maintaining a fully-functional product today.
  • Robust Content Extraction: Extracting text reliably from diverse websites and blogs presented a unique challenge. We overcame this with adaptive techniques.
  • AI Integration: Managing the consistency of output from various APIs and error handling was essential for a seamless user experience.

🏆 Accomplishments We’re Proud Of

  • 🛰️ Seamless Hybrid AI: The extension automatically detects the user’s environment, offering a smooth transition between on-device and cloud-based AI tasks.
  • ⚡ Real-time Performance: Complex analysis is completed in under 3 seconds, even with large, complex articles.
  • 💡 Interactive Evidence Highlighting: Our standout feature that shows the AI’s reasoning by highlighting specific evidence in the source text.
  • 🛡️ Trust & Transparency: By showing confidence scores and evidence, we build user trust in AI analysis.

🧠 What We Learned

  • Manifest V3: Building with Chrome’s latest APIs while respecting security constraints was a learning curve, but we succeeded.
  • AI Shim Layer: The perfect pattern to manage multiple AI backends in a hybrid architecture.
  • Trust is the Key: For AI analysis, showing the why behind the result (i.e., evidence) is just as important as the analysis itself.

🚀 What’s Next

  • Short-term (Next 3 Months):
    • 🚢 Chrome Web Store Launch: Public availability.
    • 🔁 Enhanced AI Accuracy: Fine-tuning prompts for better accuracy.
    • ⚙️ User Customization: Introducing customizable bias sensitivity settings.
  • Medium-term (6–12 Months):
    • 🌐 Firefox and Edge Versions.
    • 🎓 Educational Mode to teach media literacy concepts actively.
  • Technical Evolution:
    • Native Chrome AI Integration: Moving to on-device APIs as they stabilize.
    • Advanced NLP Features: Adding sentiment analysis and fact-checking.
    • Privacy Enhancements: Continuing to move more processing to local-first.

✨ Conclusion

Context Companion is the perfect response to the Chrome AI Challenge. It not only tackles the challenge of media literacy but does so in a user-friendly, privacy-conscious, and powerful way.

We empower users to analyze the truth behind online content with transparency, speed, and confidence.

Built With

Share this project:

Updates