A Chromium-based browser built with Electron and React that integrates with an AI Proxy server to provide in-browser AI assistance. Features include text selection summarization, page summarization, multi-provider AI support (OpenAI, Anthropic, Mistral), local SQLite caching, and a usage dashboard.
- π Chromium Browser: Full-featured web browser with navigation controls
- π€ AI Integration: Connect to your AI Proxy server for chat and summarization
- π Text Summarization: Right-click on selected text to summarize via context menu
- π Page Summarization: One-click button to summarize the current page
- π Multi-Provider Support: Switch between OpenAI, Anthropic, and Mistral providers
- πΎ Local Caching: SQLite database caches the last 10 requests with cost and latency tracking
- π Usage Dashboard: View total cost, request count, and average latency
- π¨ Theme Toggle: Switch between light and dark themes
- π¬ Chat Interface: Sidebar chat panel for AI conversations
- Node.js 20.x or higher
- pnpm (package manager)
- AI Proxy Server running on
http://localhost:8080(or configurable)- Use Proxy Server [https://github.com/natiassefa/AI-Proxy]
git clone https://github.com/natiassefa/AICore-Browser.git
cd AICore-Browserpnpm installThis will automatically rebuild native modules for Electron via the postinstall script.
pnpm devThis command:
- Starts the Vite dev server on
http://localhost:5173 - Waits for the server to be ready
- Launches Electron with hot-reload
# Build both Electron and React code
pnpm build
# Build and package the application
pnpm build:packPackaged applications will be available in dist-package/:
- macOS: DMG file (supports both x64 and arm64)
- Windows: NSIS installer
- Linux: AppImage
AICore-Browser/
βββ electron/ # Electron main process
β βββ main.ts # Main process entry point
β βββ preload.ts # Preload script (IPC bridge)
β βββ database/ # SQLite database service
β β βββ db.ts
β βββ tsconfig.json # TypeScript config for main process
βββ src/ # React renderer process
βββ components/ # React components
β βββ BrowserView.tsx
β βββ ChatBox.tsx
β βββ NavigationBar.tsx
β βββ ProviderSelector.tsx
β βββ Sidebar.tsx
β βββ SummarizePageButton.tsx
β βββ ThemeToggle.tsx
β βββ UsageDashboard.tsx
βββ contexts/ # React contexts
β βββ ProviderContext.tsx
β βββ ThemeContext.tsx
βββ hooks/ # Custom React hooks
β βββ useSummarize.ts
βββ services/ # API clients
β βββ aiProxyClient.ts
βββ config/ # Configuration
β βββ providers.ts
βββ database/ # Database schema
β βββ schema.ts
βββ types/ # TypeScript type definitions
β βββ electron.d.ts
βββ utils/ # Utility functions
βββ domExtractor.ts
The application connects to an AI Proxy server at http://localhost:8080 by default. To change this, modify the API_BASE_URL in src/services/aiProxyClient.ts.
Default providers and models are configured in src/config/providers.ts:
- OpenAI:
gpt-4,gpt-3.5-turbo - Anthropic:
claude-3-5-sonnet-20241022,claude-3-opus-20240229 - Mistral:
mistral-large-latest,mistral-medium-latest
- Ensure your AI Proxy server is running on
http://localhost:8080 - Run
pnpm devor launch the packaged application - The browser window will open with a sidebar on the left
- Type a message in the chat input at the bottom of the sidebar
- Select your AI provider and model from the dropdowns
- Press Enter or click Send
- Select text on any webpage
- Right-click to open the context menu
- Click "Summarize Selection"
- The summary will appear in the chat sidebar
- Navigate to any webpage
- Click the "Summarize Page" button in the sidebar
- The page content will be extracted and summarized
- The summary will appear in the chat sidebar
The dashboard at the top of the sidebar shows:
- Total Cost: Cumulative cost of all AI requests
- Request Count: Total number of requests made
- Average Latency: Average response time in milliseconds
Click the moon/sun icon in the sidebar header to toggle between light and dark themes. Your preference is saved locally.
The application uses SQLite to cache the last 10 AI requests. The database file is stored in:
- macOS:
~/Library/Application Support/ai-core-browser/ai-core-browser.db - Windows:
%APPDATA%/ai-core-browser/ai-core-browser.db - Linux:
~/.config/ai-core-browser/ai-core-browser.db
Cached requests are automatically used when the same prompt is sent with the same provider and model.
- Electron ^28.0.0 - Desktop application framework
- React ^18.2.0 - UI library
- TypeScript ^5.0.0 - Type safety
- Vite ^5.0.0 - Build tool and dev server
- Tailwind CSS ^3.4.0 - Styling
- better-sqlite3 ^9.0.0 - SQLite database
- electron-builder ^24.0.0 - Application packaging
pnpm dev- Start development server (Vite + Electron)pnpm build- Build for productionpnpm build:pack- Build and package the applicationpnpm build:pack:dev- Build and package without code signing (development)
If you encounter "Cannot find module" errors related to better-sqlite3, bindings, or file-uri-to-path:
- Ensure these modules are listed in
asarUnpackinpackage.json - Run
pnpm installto rebuild native modules - For packaged apps, ensure native modules are properly unpacked
If you see "Unable to load preload script" errors:
- Verify
dist-electron/preload.jsexists after building - Check that the preload path in
electron/main.tsis correct - Ensure the preload script is compiled as CommonJS (see
electron/tsconfig.preload.json)
If the application window is blank:
- Check the browser console (DevTools) for errors
- Verify
dist/index.htmlexists after building - Ensure Vite dev server is running on port 5173
- Check that the React app is mounting correctly
pnpm build:packCreates a DMG file supporting both Intel (x64) and Apple Silicon (arm64).
pnpm build:packCreates an NSIS installer. Ensure you're on a Windows machine or use a CI/CD pipeline.
pnpm build:packCreates an AppImage. Ensure you're on a Linux machine or use a CI/CD pipeline.
[Add your license here]
[Add contribution guidelines here]
Note: This is an MVP (Minimum Viable Product) focused on core functionality. The codebase prioritizes working features over polish.