A unified, AI-powered email dashboard built to tame inbox chaos
Born from the frustration of juggling multiple email accounts, missing important follow-ups, and typing the same replies over and over โ Onebox is a real-time, multi-account email management system that intelligently categorizes, searches, and helps you respond to emails faster.
What makes it different? Real-time IMAP sync (no polling!), AI-powered classification, semantic search for replies, and instant notifications for what matters โ all wrapped in a clean, focused interface.
Built on persistent IMAP connections using ImapFlow with live IDLE monitoring โ your emails appear the moment they arrive.
- Multi-account support โ manage all your inboxes in one place
- 30-day historical backfill on first sync
- Zero polling overhead โ event-driven updates only
- Efficient parsing with
mailparser
Every email is indexed instantly for sub-second search and filtering.
- Full-text search across subject, body, sender, and recipient
- Advanced filtering by account, folder (inbox/sent/spam), and AI category
- Pagination support (100 emails per page)
- Date-sorted results (newest first)
Let AI do the triage work using Google Gemini (gemini-2.5-flash-lite).
Categories:
- โ Interested โ warm leads and positive responses
- ๐ Meeting Booked โ confirmed appointments
- โ Not Interested โ polite declines
- ๐ซ Spam โ promotional noise
- ๐ Out of Office โ automated replies
Every email (new and historical) is automatically classified before indexing โ helping you focus on what needs your attention.
Stay informed about important emails without constant checking.
Notification triggers:
- Interested emails โ Instant Slack DM
- Meeting Booked โ Custom webhook automation (optional)
Gracefully handles missing webhooks without crashing โ just logs a friendly warning.
Context-aware reply suggestions powered by semantic search and LLMs.
How it works:
- Query arrives with email subject + body
- Pinecone retrieves top 3 semantically similar knowledge snippets
- Gemini generates 3 contextual reply options
- Choose, customize, and send
Knowledge base includes:
- Product information and features
- Common objection handling
- Meeting scheduling templates
- Professional response patterns
A clean, responsive interface designed for productivity.
Features:
- Email list with smart pagination
- Multi-filter support (account, folder, category)
- Real-time full-text search
- Category statistics and chips
- AI reply modal with one-click insertion
- Mobile-responsive design
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ IMAP Servers โ
โ (Gmail, Outlook, Custom IMAP) โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ IMAP Sync Service โ
โ (ImapFlow + IDLE) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Email Parser โ
โ (mailparser) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ AI Categorization โ
โ (Gemini 2.5 Flash) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโดโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Elasticsearch โ โ Notifications โ
โ (Indexing) โ โ (Slack/Webhook) โ
โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ REST API (Express) โ
โ /get-all-email /search /suggest-repliesโ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Frontend (Next.js 15) โ
โ Email Dashboard + Reply Assistant โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ (RAG Flow)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Pinecone Vector DB โ Gemini โ Replies โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Runtime: Node.js + TypeScript
- Framework: Express
- Email Sync: ImapFlow (IMAP IDLE)
- Search & Storage: Elasticsearch 8.x
- AI: Google Gemini API
- Vector DB: Pinecone
- Parsing: mailparser
- Framework: Next.js 15 (App Router)
- UI: React 19
- Styling: Tailwind CSS
- Icons: Lucide React
- State: React Hooks
Fetch all emails with pagination.
Query Parameters:
page(number, optional) โ Default: 1
Response: Array of email objects (100 per page)
Filter emails by specific criteria.
Query Parameters:
accountId(string, optional) โ Filter by email accountfolder(string, optional) โinbox,sent,spam, orallcategory(string, optional) โ AI-assigned categorypage(number, optional) โ Default: 1
Response: Filtered array of email objects
Full-text search across all indexed emails.
Query Parameters:
q(string, required) โ Search query
Response: Matching email objects sorted by relevance
Generate contextual reply suggestions using RAG.
Query Parameters:
subject(string, required) โ Email subject linebody_text(string, required) โ Email body content
Response:
{
"replies": [
"Thanks for reaching out! I'd be happy to schedule a call...",
"I appreciate your interest. Here's some information...",
"Let me check my calendar and get back to you..."
]
}- Node.js 18+ and npm
- Docker & Docker Compose (for Elasticsearch)
- Gmail/Outlook accounts with app-specific passwords
- API keys: Google Gemini, Pinecone (optional: Slack webhook)
-
Clone and install dependencies
cd backend npm install -
Start Elasticsearch
cd elastic-search docker compose up -d -
Configure environment variables
Create
backend/.env:PORT=4000 # Elasticsearch ES_PORT=http://localhost:9200 ES_INDEX=reachinbox_emails # Email Accounts (add more as needed) USER_EMAIL_1=your-email@gmail.com USER_PASSWORD_1=your-app-specific-password USER_EMAIL_2=another-email@gmail.com USER_PASSWORD_2=another-app-password # AI Services GEMINI_API_KEY=your_gemini_api_key PINECONE_API_KEY=your_pinecone_key PINECONE_INDEX_NAME=reach-inbox-kb PINECONE_HOST=your-pinecone-host.io # Notifications (optional) SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL AUTOMATION_WEBHOOK_URL=https://your-automation-endpoint.com
-
(Optional) Populate Pinecone knowledge base
In
server.ts, uncomment:await run(); // Populate Pinecone with knowledge base
Run once, then re-comment to avoid duplicates.
-
Start the backend
npm run dev
Backend runs on
http://localhost:4000
-
Install dependencies
cd frontend npm install -
Configure environment
Create
frontend/.env.local:NEXT_PUBLIC_API_URL=http://localhost:4000
-
Start the development server
npm run dev
Open
http://localhost:3000in your browser
interface Email {
messageId: string;
subject: string;
from: { address: string; name?: string };
to: Array<{ address: string; name?: string }>;
cc?: Array<{ address: string; name?: string }>;
date: string; // ISO 8601
body_text: string;
body_html?: string;
folder: 'inbox' | 'sent' | 'spam';
accountId: string;
category?: 'Interested' | 'Meeting Booked' | 'Not Interested' | 'Spam' | 'Out of Office';
hasAttachments?: boolean;
importance?: 'low' | 'normal' | 'high';
}- Real-time updates โ emails appear instantly
- Resource efficient โ no wasteful periodic checks
- Scalable โ works with any IMAP-compliant provider
- Sub-second search across thousands of emails
- Flexible querying โ full-text, filters, pagination
- Production-ready โ battle-tested at scale
- Cost-effective โ Flash Lite model is fast and cheap
- JSON mode โ structured output for reliable categorization
- Generous rate limits for personal projects
- Managed service โ no infrastructure overhead
- Fast semantic search โ <100ms query latency
- Simple API โ easy to integrate and maintain
- App passwords instead of OAuth2 (faster initial setup)
- Single INBOX folder per account (expandable to all folders)
- Basic error handling โ no retry queues or dead-letter mechanisms yet
- No threading โ emails treated independently
- OAuth2 integration for Gmail/Outlook
- Token refresh and rotation
- Rate limiting and request throttling
- Email encryption for sensitive content
- Bulk indexing optimization (batch writes)
- Redis caching layer for frequently accessed emails
- Background job queue (Bull/BullMQ)
- Horizontal scaling with load balancing
- Email threading โ group conversations intelligently
- Send email โ compose and send directly from UI
- Attachment handling โ preview, download, search
- Email templates โ save and reuse common replies
- Read/unread status โ sync with mail server
- Multi-folder support โ beyond inbox (drafts, archives)
- Smart filters โ auto-apply rules to incoming emails
- Analytics dashboard โ response times, category distribution
- WebSocket push updates for live UI sync
- Team inbox mode (shared accounts)
- Collaborative tagging and notes
- Slack bot integration for quick actions
- Sentiment analysis for customer emails
- Auto-reply for common queries
- Priority scoring based on sender history
- Smart scheduling assistant (calendar integration)
- Custom AI categorization rules (user-defined)
This is a personal learning project, but suggestions and feedback are welcome!
If you'd like to contribute:
- 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
This project is open source and available under the MIT License.
Built with:
- ImapFlow โ Modern IMAP client
- Elasticsearch โ Search and analytics engine
- Google Gemini โ AI categorization and reply generation
- Pinecone โ Vector database for semantic search
- Next.js โ React framework
- Tailwind CSS โ Utility-first CSS
Email shouldn't feel like a chore. After years of switching between tabs, missing important messages, and rewriting the same responses, I wanted something better โ a single dashboard that's smart enough to know what matters and helpful enough to draft replies for me.
Onebox started as a weekend experiment and evolved into my daily email driver. It's not perfect, but it's mine โ and it makes managing multiple inboxes actually enjoyable.
If you're drowning in email or just curious about building real-time data pipelines with AI, I hope this project inspires you to build something cool too.
Questions or feedback? Open an issue or reach out โ I'd love to hear from you! ๐ง