Unified Box is a full-stack intelligent email management platform that integrates multiple email accounts into one interface, powered by AI summarization, semantic search, and memory recall (Mira).
It enables users to connect Gmail/Outlook accounts, view emails, send replies, and leverage AI to summarize and understand email conversations — all from a single dashboard.
- Connect multiple accounts (Gmail / Outlook) securely
- OAuth login --> and that user can add multiple Accounts
- Fetch and store emails automatically using IMAP and background sync jobs
- Parse and index emails for fast retrieval and search in Elasticsearch
- Automatically generates short summaries for every new incoming email
- Categorizes emails into the following labels:
- Interested
- Meeting Booked
- Not Interested
- Spam
- Out of Office
- Uses Google Gemini model for concise, context-aware summaries
- Maintains a memory of all email interactions grouped by contact
- Each contact stores summarized email history and replies for quick recall
- Acts like a "personal assistant" that remembers all your email conversations for all emails
- Full-text + semantic search across email subject, body, sender, and receiver fields
- Supports fuzzy matching and relevance ranking using multi_match query
- Fetches context-highlighted search results (like Gmail search)
- Suggests reply drafts using contextual AI generation
- Allows users to choose tone (friendly, formal, etc.) and edit before sending
- Integrates with nodemailer for sending replies directly
- Sleek, responsive email dashboard built with Next.js + Tailwind CSS
- Sidebar for accounts, categories, and "Mira memory" section
- Interactive EmailList and EmailDetail components with live search, filter, and AI features
| Technology | Purpose |
|---|---|
| Next.js 14 | Frontend framework for UI and SSR |
| TypeScript | Strict type safety |
| Tailwind CSS | Modern responsive design |
| Lucide React | Icons - Elegant iconography |
| Axios | API communication |
| Next-Auth | Authentication layer |
| Deployed on | Vercel [all free-tiers so it may be slow] |
| Technology | Purpose |
|---|---|
| Node.js + Express.js | REST API server |
| TypeScript | Strong typing and modular services |
| Prisma ORM + PostgreSQL | (Neon DB | local docker) Primary data persistence |
| @elastic/elasticsearch | Search and semantic indexing |
| pinecone vector database | for storing Rag Content |
| Google Gemini API | AI summarization and smart reply generation |
| IMAP + Nodemailer | Email retrieval and sending |
| JWT Authentication | Secure user access and token validation |
| Docker + Docker Compose | Containerized backend stack |
| Deployed on | Render [all free-tiers so it may be slow] |
An AI-powered email intelligence platform integrating IMAP, Elasticsearch, Gemini AI, and "Mira" — your AI memory.
git clone https://github.com/002sathwik/UnifiedBox-outbox-labs-assigment-.git
cd UnifiedBox-outbox-labs-assigment-Your structure should look like:
UnifiedBox-outbox-labs-assigment-/
├── backend/
│ ├── docker-compose.yml
│ ├── src/
│ ├── prisma/
│ └── package.json
├── frontend/
│ ├── package.json
│ ├── next.config.js
│ └── ...
└── README.md
cd backendAdd the following (update your own keys 👇):
# Server
PORT=<port>
NODE_ENV=development
# If using docker, don't use ELASTIC_SEARCH_API_KEY
ELASTICSEARCH_NODE="https://<elasticsearchnode>:443"
ELASTIC_SEARCH_API_KEY="<elasticsearchapikey>"
JWT_SECRET_KEY=""
FRONTEND_URL=""
GEMINI_API_KEY=""
SLACK_WEBHOOK_URL=""
EXTERNAL_WEBHOOK_URL=""
PINECONE_API_KEY=
PINECONE_ENVIRONMENT=
PINECONE_INDEX_NAME=
DATABASE_URL=""bun install(You can use npm install or yarn if not using Bun.)
npx prisma db push(Optional: view tables)
npx prisma studiobun devServer starts on:
If you prefer full containerized setup:
1️⃣ Build and start containers:
docker-compose up --build2️⃣ Run in background (detached):
docker-compose up -d3️⃣ Stop containers:
docker compose down👉 This will build your backend container and automatically start services defined in docker-compose.yml
bun run build
bun startcd ../frontend# next-auth environment variables
NEXTAUTH_URL=<usernextauthurl>
NEXTAUTH_SECRET=<secretvalue>
# OAuth Credentials for Google
GOOGLE_CLIENT_ID=<googleclientid>
GOOGLE_CLIENT_SECRET=<usergoogleclientsecret>
# Backend URL
NEXT_PUBLIC_BACKEND_URL=<userbackendurl>bun installbun run devFrontend runs on:
bun run build
bun startUser logs in using any Gmail account First-time users are redirected to the account connection page
Add IMAP credentials for your email accounts Background Processing Begins:
Retrieves emails from connected accounts Generates AI summaries using Gemini API Stores emails in PostgreSQL database Indexes emails in Elasticsearch for fast search Creates Mira Memory summaries for each contact
Redirected to the main dashboard after setup Available Features:
Search: Retrieve all emails using semantic search Filter: Filter emails by account, folder, and AI categories RAG Training: Add custom training data for personalized replies AI Reply Suggestions: Get context-aware reply suggestions using RAG + Gemini API Send Replies: Send emails directly from the dashboard
View all past conversations grouped by contact Access summarized email history for quick context recall Acts as your personal email assistant with complete conversation memory
Performance Note All free-tier services: application as it handles requests within free-tier constraints.
Acknowledgment This is a proof-of-concept built rapidly to demonstrate core functionality. While it successfully implements all required features,
