Local-first Gmail inbox management with AI-powered insights
Transform your chaotic Gmail inbox into an organized, actionable dashboard. TuskerBrain is an intelligent email assistant that automatically classifies, extracts, and summarizes your emailsβgiving you back control over your digital life.
TuskerBrain connects to your Gmail account and acts as an intelligent layer on top of your inboxβautomatically organizing, summarizing, and extracting what matters while keeping everything private on your machine.
- Sync & Fetch - Securely connects to your Gmail via OAuth, fetching emails from a configurable lookback period (7 to 90 days)
- AI Processing & Organization - Uses advanced AI models to classify emails, extract deals, identify action items, and organize by topics
- View & Interact - Presents everything in a beautiful dashboard with Timeline, Topics, Deals, and Senders views
- 100% Local Storage - All your data stays on your machine in a local SQLite database
- Your Own API Keys - Use your own LLM API keys (OpenAI, Anthropic, or Google)βno shared infrastructure
- No Cloud Sync - Nothing is uploaded to TuskerBrain servers (because there aren't any!)
- Transparent Audit Log - Track every AI operation and token usage with complete traceability
TuskerBrain analyzes each email and categorizes it into one of four types:
- Regular - Personal and work emails that need attention
- Updates - Transactional emails, statements, notifications
- Social - Social media notifications and networking updates
- Promotional - Marketing emails, deals, and offers
Based on email type and age, TuskerBrain automatically applies cleanup rules:
| Email Type | < 1 Month | 1-6 Months | > 6 Months | > 2 Years |
|---|---|---|---|---|
| Regular | Process with AI | Process with AI | Archive | Archive |
| Updates | Process with AI | Archive | Archive | Archive |
| Social | Process with AI | Delete | Delete | Archive |
| Promotional | Extract Deals | Delete | Delete | Archive |
This keeps your inbox clean without manual intervention while ensuring important emails get processed with AI.
After the initial sync, TuskerBrain runs periodic incremental syncs (configurable: 15 min, 30 min, 1 hr, 2 hr, or daily) to fetch only new or changed emails since the last syncβminimizing API usage and processing time.
A chronological feed of processed emails transformed into actionable updates:
- Priority Levels - High, medium, and low priority indicators help you focus on what matters
- Action Items - Automatically detected tasks with due dates extracted from email content
- Financial Impact - Payment amounts, invoice totals, and financial deadlines highlighted
- Sentiment Analysis - Understand the tone of each email (positive, negative, neutral)
- Urgency Detection - Time-sensitive emails flagged for immediate attention
- Follow-up Dates - Deadlines and meeting dates automatically extracted and displayed
- Key Entities - Important dates, amounts, and names identified and highlighted
Filtering Options:
- Filter by email type (Regular, Updates, Social, Deals)
- Filter by topic (e.g., Banking/Chase, Shopping/Amazon)
- Filter by sender domain
- Filter by priority level
- Filter by date range
- Combine multiple filters with AND logic
Emails are automatically organized into a hierarchical topic system:
Banking
βββ Chase
βββ HSBC
βββ Credit Cards
Shopping
βββ Amazon
βββ eBay
βββ Online Orders
Projects
βββ Client-ABC
βββ Personal-Website
Travel
βββ Airlines
βββ Hotels
TuskerBrain recognizes common email categories out of the box:
- Banking - Banks, credit cards, financial institutions
- Education - Online courses, certifications, universities
- Projects - Client work, personal projects
- Shopping - E-commerce, online orders, retail
- Travel - Flights, hotels, bookings
- Health - Medical, insurance, fitness
- Personal - Family, friends, personal matters
- Business - Work, clients, professional
- Technology - Development tools, subscriptions
- Entertainment - Streaming, gaming, events
Each topic has a rolling summary that evolves with new emails:
- 3-4 paragraphs, max 500 words
- First paragraph provides high-level context
- Older information gradually receives less focus
- Updated automatically with each new email in the topic
- Tracks update count and last modified date
Get a concise summary for each unique sender domain:
- What type of emails you typically receive from them
- Common topics and themes
- Email frequency and recency
- Running summary that updates with new emails
Senders are automatically categorized based on their content:
- Financial institutions
- E-commerce platforms
- Social networks
- Service providers
- Personal contacts
From promotional emails, TuskerBrain extracts:
- Deal Title & Description - Clear summary of the offer
- Brand Name - Automatically identified from sender or content
- Promo Codes - Discount codes extracted and highlighted
- Deal Value - Percentage or fixed amount discounts
- Expiry Dates - Time-limited offers clearly marked
- Minimum Purchase - Spending requirements noted
- Deal Links - Direct links to the offer
- Category - Electronics, clothing, travel, etc.
- Active/Expired Status - Clear visual indicators
- Mark as Used - Track which deals you've redeemed
- Dismiss Deals - Hide irrelevant offers
- Expiry Notifications - See which deals are expiring soon
TuskerBrain creates and manages Gmail labels to keep your inbox organized:
TuskerBrain/
βββ Processed # Marks email as processed
βββ Topic/
β βββ Banking/
β β βββ Chase
β β βββ HSBC
β βββ Shopping/
β βββ Amazon
βββ Sender/
βββ chase.com
Benefits:
- Filter emails by topic directly in Gmail
- See which emails have been processed
- Group emails by sender domain
- Labels sync bidirectionally between TuskerBrain and Gmail
Phase 1: Clean First (No AI)
- Applies archival/deletion rules to all emails immediately
- Fast operation with no API costs
- Inbox cleaned up quickly
Phase 2: AI Processing (Gradual Backfill)
- Configurable lookback period (7, 14, 30, 60, or 90 days)
- Processes one day at a time
- Real-time progress: "Processing day 15 of 30..."
- Can be paused and resumed
- Pause/Resume - Temporarily halt processing
- Job Queue - See pending, running, and completed jobs
- Retry Logic - Failed jobs automatically retry with exponential backoff
- Progress Tracking - Real-time status updates
- Lookback Period - Choose how far back to sync (7-90 days)
- Sync Interval - Set incremental sync frequency (15 min to daily)
- Multiple Providers - Support for OpenAI, Anthropic, and Google AI
- Provider Switching - Change providers at any time
- API Key Validation - Keys tested before saving
- Encrypted Storage - Keys stored using Electron's safeStorage API
- Default email handling rules
- Topic naming conventions
- Label management options
Once processed, your emails are presented in four organized views (detailed feature descriptions above):
| View | Purpose | Key Information |
|---|---|---|
| Timeline | Chronological feed of important updates | Priorities, action items, financial impacts, deadlines |
| Topics | Hierarchical email categories | Topic summaries, email counts, sender breakdowns |
| Deals | Extracted promotional offers | Promo codes, expiry dates, brand names, deal values |
| Senders | Per-sender insights | Sender summaries, email frequency, content themes |
TuskerBrain is built as an Electron desktop application with a modern, modular architecture:
- UI Components - Reusable React components for Timeline, Topics, Deals, and Senders views
- React Hooks - Custom hooks (
useGmailOAuth,useSync,useLLM) for IPC communication - State Management - Zustand stores for local state
- Routing - Hash-based navigation between views
- IPC Layer - Secure contextBridge for renderer-to-main communication
- Core Services:
GmailSyncManager- Handles Gmail API sync operationsGmailOAuthService- Manages OAuth 2.0 authentication flowLLMProviderManager- Multi-provider LLM abstractionSettingsManager- Application configuration
- JobQueue - In-memory queue with deduplication and retry logic
- JobRunner - Polling executor with configurable concurrency
- AuditLogger - Tracks token usage and job execution history
- Orchestrator - Coordinates the full email processing workflow
- LangGraph Workflow - State-machine based AI pipeline:
- Classify - Determine email type (regular/updates/social/promotional)
- Decide - Choose action (process/archive/delete/extract)
- Extract - Pull out deals, updates, or action items
- Label - Assign topic labels
- Summarize - Generate concise summaries
Repository pattern for all entities:
EmailRepository- Email CRUD operationsTimelineRepository- Timeline updatesDealsRepository- Deal extraction and managementTopicsRepository- Topic hierarchy and email linkingSummariesRepository- Topic and sender summariesLabelsRepository- Gmail label management
- SQLite Database - Local persistent storage via
@libsql/client - Drizzle ORM - Type-safe database queries
- Tables: emails, jobs, deals, topics, timeline_updates, summaries, labels, settings, oauth_tokens, audit_log
- Gmail API - OAuth, read, and modify operations
- LLM Providers - OpenAI, Anthropic, and Google AI
- Node.js v20+ (use
nvm useif you have nvm installed) - pnpm package manager (
npm install -g pnpm) - LLM API Key - OpenAI, Anthropic, or Google AI
# Clone the repository
git clone https://github.com/hashanw/tuskerbrain.git
cd tuskerbrain
# Install dependencies
pnpm install# Start the development server with Electron
pnpm run electron:devThis will:
- Start Vite dev server on port 5173
- Launch Electron with hot-reload enabled
- Open DevTools for debugging
# Build for production
pnpm run electron:build
# Output will be in the 'release' directory# Generate database migrations
pnpm run db:generate
# Apply migrations to database
pnpm run db:push
# (Optional) Seed with sample data
pnpm run db:seedCopy the example environment files and fill in your values:
cp .env.example .env
cp .env.llm.example .env.llm| Variable | Description |
|---|---|
GMAIL_CLIENT_ID |
Gmail OAuth client ID |
GMAIL_CLIENT_SECRET |
Gmail OAuth client secret |
GMAIL_REDIRECT_URI |
OAuth redirect URI (usually http://localhost:3000) |
OPENAI_API_KEY |
Your OpenAI API key |
ANTHROPIC_API_KEY |
Your Anthropic API key |
GOOGLE_API_KEY |
Your Google AI API key |
During onboarding, you'll be prompted to:
- Connect Gmail - OAuth flow to authorize TuskerBrain
- Set Preferences - Choose lookback period (default: 30 days)
- Configure LLM - Select provider and enter API key
- Start Processing - Begin the initial sync and AI processing
| Category | Technology |
|---|---|
| Framework | Electron 40, React 19, Vite 7 |
| Language | TypeScript 5 |
| State | Zustand, TanStack Query |
| Database | SQLite (@libsql/client), Drizzle ORM |
| AI/LLM | LangGraph, Vercel AI SDK, @ai-sdk/* |
| Styling | Tailwind CSS 4, Radix UI |
| Testing | Vitest, Playwright |
| Build | electron-builder |
# Development
pnpm run dev # Start Vite dev server (renderer only)
pnpm run electron:dev # Start full Electron app with hot-reload
# Build
pnpm run build # Build renderer
pnpm run electron:build # Build production Electron app
# Database
pnpm run db:generate # Generate Drizzle migrations
pnpm run db:push # Apply migrations
pnpm run db:seed # Seed database with sample data
# Code Quality
pnpm run lint # ESLint
pnpm run format # Prettier
pnpm run test # Vitest unit tests
pnpm run test:e2e # Playwright E2E teststuskerbrain/
βββ src/ # React frontend
β βββ components/ # UI components and screens
β βββ hooks/ # React hooks (IPC wrappers)
β βββ stores/ # Zustand state stores
β βββ config/ # Frontend configuration
β βββ types/ # TypeScript types
βββ core/ # Core business logic
β βββ auth/ # Authentication utilities
β βββ gmail/ # Gmail API client and sync
β βββ jobs/ # Job queue and runner
β βββ labeling/ # Topic labeling logic
β βββ llm/ # LLM provider management
β βββ processing/ # Email processing utilities
β βββ repositories/ # Data access layer
β βββ security/ # Security utilities
β βββ summaries/ # Summary generation
β βββ timeline/ # Timeline extraction
β βββ workflows/ # LangGraph workflows
β βββ orchestrator.ts # Processing coordinator
βββ electron/ # Electron main process
β βββ ipc/ # IPC handlers
β βββ utility/ # Utility modules
β βββ main.ts # Entry point
β βββ oauth-service.ts # OAuth service
βββ database/ # Database layer
β βββ schema.ts # Drizzle schema definitions
β βββ migrations/ # Database migrations
β βββ seed.ts # Seed data
βββ docs/ # Documentation
βββ images/ # Diagrams and screenshots
βββ plans/ # Development plans
- OAuth 2.0 - Secure Gmail authentication with token refresh
- Encrypted Storage - Sensitive tokens stored securely
- Context Isolation - Electron contextBridge for secure IPC
- No Remote Code - All processing happens locally
- Audit Logging - Complete traceability of AI operations
# Run unit tests
pnpm run test
# Run E2E tests
pnpm run test:e2e
# Run tests with coverage
pnpm run test --coverageContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- TypeScript - All code must be typed
- Testing - Add tests for new features
- Linting - Ensure
pnpm run lintpasses - Formatting - Code is auto-formatted with Prettier
Source Available - Personal Use Only
TuskerBrain is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
- β Personal Use: You are free to use, download, and modify TuskerBrain for personal, non-commercial purposes.
- β No Commercial Use: You may not use TuskerBrain for any commercial purpose, including but not limited to selling, licensing, or incorporating into a commercial product.
- β No Redistribution: You may not redistribute TuskerBrain, with or without modifications, in any form (source or binary).
- β Share Alike: If you build upon or adapt TuskerBrain for personal use, your modifications must also be licensed under the same CC BY-NC-ND 4.0 license.
See the LICENSE file for the full license text. For commercial licensing inquiries, please contact the author.
- LangGraph - For the excellent workflow orchestration library
- Vercel AI SDK - Unified interface for multiple LLM providers
- Drizzle ORM - Type-safe database operations
- Electron - Cross-platform desktop app framework
For issues, questions, or feature requests, please open an issue on the GitHub repository.
Built with β€οΈ by hashangit
Last updated: March 2026

