A browser extension that integrates Gemini AI to enhance your browsing experience
    
    
    View on GitHub
    ·
    Report Bug
    ·
    Request Feature
  
Table of Contents
Context AI is a powerful browser extension that brings the capabilities of Google's Gemini AI directly into your web browser. It provides a chat interface that contextually enhances your browsing experience by allowing you to interact with web content through AI assistance.
- Contextual Web Page Chat: Chat with an AI assistant about the content of any webpage you're browsing
 - Multi-Chat Support: Create and manage multiple conversations with a convenient chat history interface
 - Page Content Integration: Toggle the ability to include current page content in your conversations for more contextual responses
 - Search Tool Integration: Enable Gemini's search grounding capability to provide more accurate and up-to-date information
 - Theme Customization: Switch between light and dark mode themes based on your preference
 - Model Selection: Choose between different Gemini AI models:
- Gemini 2.0 Flash (default) - Faster response times
 - Gemini 2.5 Pro - More advanced capabilities
 
 - Resizable Interface: Easily resize the chat window to suit your needs
 - API Key Management: Securely store and manage your Gemini API key
 - Cross-Browser Compatibility: Works with Chrome, Firefox, and other Chromium-based browsers
 
- WXT Framework - Modern web extension framework
 - React - UI framework
 - TypeScript - Type-safe JavaScript
 - Tailwind CSS - Utility-first CSS framework
 - Gemini API - Google's generative AI models
 - AI SDK - AI framework for streaming responses
 - Lucide Icons - Beautiful & consistent icon set
 
To get a local copy up and running, follow these simple steps.
- Node.js (v16 or higher)
 - npm or yarn
 - A Gemini API key (Get one here)
 
- 
Clone the repository
git clone https://github.com/debsouryadatta/context-ai.git cd context-ai - 
Install dependencies
npm install # or yarn install - 
Build the extension
npm run build # or yarn build - 
Load the extension in your browser:
- Chrome: Go to 
chrome://extensions/, enable Developer mode, and click "Load unpacked" to select thedistfolder - Firefox: Go to 
about:debugging#/runtime/this-firefox, click "Load Temporary Add-on", and select any file in thedistfolder 
 - Chrome: Go to 
 
After installing the extension:
- Click on the Context AI extension icon in your browser's toolbar
 - Enter your Gemini API key in the provided field
 - Click the toggle switch to enable the extension
 - Configure any additional preferences as needed
 
Your settings will be automatically saved to the browser's storage and synced across your devices if you're signed into your browser.
- 
Starting a Conversation:
- Navigate to any webpage
 - Click the "Ask AI" button in the bottom-right corner of the page
 - Type your question or request in the chat input
 
 - 
Including Page Content:
- Toggle the "Include page content" switch to let the AI consider the content of the current page in its responses
 
 - 
Using Search Tool:
- Toggle the "Enable search tool" switch to allow the AI to search for up-to-date information when answering your questions
 - This feature is particularly useful for factual queries or when you need the most current information
 
 - 
Managing Chats:
- Click the chat history icon to view, switch between, or delete previous conversations
 - Create a new chat by clicking the "+" button in the chat list
 
 - 
Changing Models:
- Select between Gemini models using the dropdown in the chat interface header:
- Gemini 2.0 Flash (default): For faster responses
 - Gemini 2.5 Pro: For more advanced capabilities
 
 
 - Select between Gemini models using the dropdown in the chat interface header:
 - 
Customizing the Interface:
- Toggle between light and dark themes
 - Resize the chat window by dragging from the top-left corner
 
 
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
 - Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
 
Project Link: https://github.com/debsouryadatta/context-ai
The extension uses the following storage schema to maintain chat history and settings:
{
    "config": {
        "geminiApiKey": "your-api-key",
        "extensionEnabled": true,
        "geminiModel": "gemini-2.0-flash-exp",
        "theme": "light",
        "chatDimensions": {
            "width": 384,
            "height": 600
        },
        "current_chat_id": "uuid-of-current-chat",
        "chat_history": [
            {
                "id": "chat-uuid-1",
                "title": "Chat Title",
                "messages": [
                    {"role": "user", "content": "User message"},
                    {"role": "assistant", "content": "Assistant response"}
                ],
                "page_content_included": true,
                "search_tool_enabled": true,
                "created_at": "ISO-date-string",
                "updated_at": "ISO-date-string"
            }
        ]
    }
}