A Chrome extension that builds an intelligent knowledge graph from your browsing history using AI-powered semantic analysis
- About
- Features
- How It Works
- Installation
- Configuration
- Development
- Project Structure
- Troubleshooting
- Reference
Context is an intelligent Chrome extension that automatically builds a semantic knowledge graph from your browsing history. Using AI-powered content analysis, it creates meaningful connections between the pages you visit, helping you discover patterns and relationships in your research and work.
- Automatic Content Analysis: Extracts semantic meaning from web pages using AI
- Knowledge Graph Generation: Creates nodes for pages and concepts, with edges representing relationships
- Smart Filtering: Filters out irrelevant pages (auth pages, redirects) to focus on meaningful content
- Visual Graph View: Interactive visualization of your browsing knowledge graph
- Session Management: Track browsing sessions and their associated context
- Semantic Context Types: Categorizes content (technology, problem, solution, concept, tool, framework, method)
- React - Modern UI framework
- TypeScript - Type-safe development
- Tailwindcss - Utility-first CSS framework
- Vite with Rollup - Fast build tooling
- Turborepo - Monorepo management
- Chrome Extensions Manifest Version 3 - Latest extension APIs
- AI-Powered Semantic Analysis: Uses Azure OpenAI to understand page content and extract meaningful concepts
- Intelligent Knowledge Graph: Automatically builds connections between related pages and concepts
- Real-time Processing: Analyzes pages as you browse with minimal performance impact
- Interactive Graph Visualization: Explore your browsing patterns through an interactive D3.js-powered graph
- Session Tracking: Organize your browsing into focused sessions
- Smart Content Filtering: Automatically excludes auth pages, redirects, and noise
- Multiple Edge Types: Distinguishes between sequential navigation and conceptual relationships
- Custom i18n package - Internationalization support
- Custom HMR (Hot Module Rebuild) plugin - Fast development reloads
- Prettier & ESLint - Code formatting and linting
- End-to-end testing with WebdriverIO - Comprehensive testing
- Content Extraction: When you visit a page, the extension extracts the page title, metadata, and text content
- AI Analysis: Content is sent to Azure OpenAI for semantic analysis, identifying key concepts and context types
- Graph Building: Creates nodes for pages and concepts, with weighted edges representing relationships
- Relationship Detection: Tracks both sequential navigation patterns and conceptual similarities
- Visualization: Provides an interactive graph view to explore your knowledge network
- Clone this repository:
git clone <repository-url> - Ensure your node version is >= than in
.nvmrcfile, recommend to use nvm - Install pnpm globally:
npm install -g pnpm - Run
pnpm install - Configure your development environment:
- VS Code (Recommended):
- Install ESLint extension
- Install Prettier extension
- Enable
Typescript Workbench versionin settings:- CTRL + SHIFT + P → Search:
Typescript: Select Typescript version...→Use Workbench version
- CTRL + SHIFT + P → Search:
- For WSL users: Install Remote - WSL extension
- WebStorm:
- VS Code (Recommended):
- Build the extension:
pnpm build
Important
On Windows, make sure you have WSL enabled and Linux distribution (e.g. Ubuntu) installed on WSL.
Then, depending on the target browser:
- Run:
- Dev:
pnpm dev(on Windows, run as administrator) - Prod:
pnpm build
- Dev:
- Open Chrome and navigate to
chrome://extensions - Enable Developer mode (toggle in top-right corner)
- Click Load unpacked
- Select the
distdirectory from the project
- Run:
- Dev:
pnpm dev:firefox - Prod:
pnpm build:firefox
- Dev:
- Open Firefox and navigate to
about:debugging#/runtime/this-firefox - Click Load Temporary Add-on...
- Select the
./dist/manifest.jsonfile from the project
Note
In Firefox, extensions load in temporary mode and disappear after browser close. You'll need to reload the extension on every browser launch.
Context requires Azure OpenAI configuration for semantic analysis:
- Open the extension options page
- Configure your Azure OpenAI settings:
- API Key: Your Azure OpenAI API key
- Endpoint: Your Azure OpenAI endpoint URL
- Model: The model to use (e.g.,
gpt-4,gpt-3.5-turbo)
- Start Session: Begin tracking a new browsing session
- Stop Session: End the current session
- View Graph: Open the interactive graph visualization
For root package:
pnpm i <package> -wFor specific module:
pnpm i <package> -F <module-name>Where module-name corresponds to the name field in each package.json (e.g., @extension/content-script can be referenced as just content-script).
Read the complete documentation: Environment Variables Guide
pnpm dev- Start development serverpnpm build- Build for productionpnpm lint- Run ESLintpnpm type-check- Run TypeScript type checkingpnpm test- Run testspnpm zip- Package extension into ZIP file
The main extension code lives in the chrome-extension directory:
manifest.ts- Generates themanifest.jsonfilesrc/background- Background service worker that handles:- Page visit tracking and content extraction
- AI-powered semantic analysis
- Knowledge graph generation and storage
- Session management
src/ai- Azure OpenAI integration for semantic analysispublic- Extension icons and static assets
UI components and pages for the extension:
popup- Main extension popup interfaceoptions- Extension settings and AI configurationgraph-view- Interactive knowledge graph visualizationside-panel- Chrome side panel integrationcontent-ui- UI components injected into web pagescontent-runtime- Content scripts for page interactiondevtools- Browser DevTools integrationnew-tab- Custom new tab page
Shared packages and utilities:
Core Infrastructure:
shared- Common types, constants, and utilitiesstorage- Chrome storage API helpers and state managementui- Shared React components and Tailwind utilitiesenv- Environment variable management
Development Tools:
vite-config- Shared Vite configurationtsconfig- TypeScript configurationsdev-utils- Development utilities and Chrome extension helpershmr- Hot module reload for developmentzipper- Extension packaging tools
Features:
i18n- Internationalization with type safetymodule-manager- Enable/disable extension modulese2e- End-to-end testing setup
If changes aren't reflected during development:
- Restart the development server:
Ctrl+Cthenpnpm dev - If you encounter
grpcerrors, kill theturboprocess and restart - Reload the extension in Chrome extensions page
If using WSL and imports aren't resolving correctly, ensure you've connected VS Code to WSL remotely using the Remote - WSL extension.
If semantic analysis isn't working:
- Verify your Azure OpenAI credentials in the options page
- Check the background script console for API errors
- Ensure your API key has appropriate permissions
Created by Oscar Wang | Built on the foundation of the Chrome Extension Boilerplate by Jonghakseo