Skip to content

An AI Email Intelligence Platform Real-time email intelligence with multi-provider AI fallback, semantic search, OAuth integration. Handles incremental sync and streaming with 70% cold start reduction.

License

Notifications You must be signed in to change notification settings

parbhatkapila4/Vector-Mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VectorMail

An AI-Native Email Client for Modern Productivity

License PRs Welcome

VectorMail is an enterprise-grade, AI-powered email client that leverages advanced semantic search, intelligent summarization, and automated email management to optimize inbox workflows and enhance productivity.


Table of Contents


Overview

VectorMail represents a paradigm shift in email management by integrating artificial intelligence at every layer of the application. Built on modern web technologies and powered by state-of-the-art language models, VectorMail transforms traditional email workflows into intelligent, context-aware interactions.

Key Features

AI-Powered Email Management

Leverages machine learning for intelligent email categorization, priority detection, and context-aware automated responses.

Semantic Search

Implements vector-based search using pgvector, enabling users to find emails by meaning and context rather than exact keyword matching.

Multi-Account Support

Unified dashboard for managing multiple email accounts across different providers with seamless account switching.

Smart Composition

AI-assisted email writing with real-time suggestions, tone adjustment, and context-aware content generation.

Email Analytics

Comprehensive insights into communication patterns, response times, and productivity metrics with visual dashboards.

Modern User Interface

Responsive, accessible interface built with Next.js 15 and Tailwind CSS, optimized for desktop and mobile experiences.

Secure Authentication

Enterprise-grade authentication powered by Clerk with support for OAuth, multi-factor authentication, and session management.

Real-time Synchronization

Instant email synchronization across devices with optimistic updates and conflict resolution.


Technology Stack

Frontend Layer

  • Framework: Next.js 15 with React 19
  • Styling: Tailwind CSS with Radix UI primitives
  • Animations: Framer Motion
  • State Management: tRPC with React Query
  • Authentication: Clerk

Backend Layer

  • API: tRPC for end-to-end type safety
  • Database: PostgreSQL 16+ with Prisma ORM
  • Vector Database: pgvector extension for semantic search
  • Caching: Redis for session and query caching
  • AI Integration: OpenAI GPT-4, Google Gemini

DevOps & Tooling

  • Containerization: Docker with multi-stage builds
  • CI/CD: GitHub Actions workflows
  • Testing: Jest, React Testing Library, Playwright
  • Code Quality: ESLint, Prettier, TypeScript strict mode

Getting Started

Prerequisites

Ensure the following dependencies are installed on your system:

  • Node.js: Version 20 or higher
  • PostgreSQL: Version 16 or higher with pgvector extension enabled
  • Redis: Optional but recommended for caching
  • Package Manager: npm or bun

Installation

1. Clone the Repository

git clone https://github.com/parbhatkapila4/Vector-Mail.git
cd Vector-Mail

2. Install Dependencies

npm install

3. Configure Environment Variables

Copy the example environment file and configure with your credentials:

cp .env.example .env.local

Refer to the Configuration section for detailed environment variable documentation.

4. Initialize Database

Execute the following commands to set up the database schema:

npm run db:push
npm run db:generate

5. Start Development Server

npm run dev

The application will be available at http://localhost:3000

Docker Deployment

For a containerized deployment with all dependencies configured:

docker-compose up -d

This command initializes:

  • PostgreSQL database with pgvector extension
  • Redis cache server
  • VectorMail application server

Architecture

The VectorMail architecture follows a layered approach with clear separation of concerns:

┌─────────────────────────────────────────────────────────────┐
│                   Presentation Layer                        │
│                      (Next.js Client)                       │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐   │
│  │  React   │  │ tRPC API │  │  Clerk   │  │ Tailwind │   │
│  │Components│  │  Client  │  │   Auth   │  │   CSS    │   │
│  └──────────┘  └──────────┘  └──────────┘  └──────────┘   │
└─────────────────────────────────────────────────────────────┘
                           ▼
┌─────────────────────────────────────────────────────────────┐
│                    API Layer (tRPC)                         │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐     │
│  │   Account    │  │    Email     │  │   Search     │     │
│  │   Router     │  │   Router     │  │   Router     │     │
│  └──────────────┘  └──────────────┘  └──────────────┘     │
└─────────────────────────────────────────────────────────────┘
                           ▼
┌─────────────────────────────────────────────────────────────┐
│                   Business Logic Layer                      │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐     │
│  │   Aurinko    │  │   OpenAI     │  │  Embedding   │     │
│  │  Email API   │  │   Gemini     │  │   Service    │     │
│  └──────────────┘  └──────────────┘  └──────────────┘     │
└─────────────────────────────────────────────────────────────┘
                           ▼
┌─────────────────────────────────────────────────────────────┐
│                   Data Persistence Layer                    │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐     │
│  │  PostgreSQL  │  │    Redis     │  │   Prisma     │     │
│  │  + pgvector  │  │    Cache     │  │     ORM      │     │
│  └──────────────┘  └──────────────┘  └──────────────┘     │
└─────────────────────────────────────────────────────────────┘

Configuration

Create a .env.local file in the project root with the following environment variables:

# Database Configuration
DATABASE_URL="postgresql://user:password@localhost:5432/vectormail"

# Authentication (Clerk)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_..."
CLERK_SECRET_KEY="sk_test_..."

# Email Service (Aurinko)
AURINKO_CLIENT_ID="..."
AURINKO_CLIENT_SECRET="..."

# AI Services
OPENAI_API_KEY="sk-..."
GEMINI_API_KEY="..."

# Cache (Optional)
REDIS_URL="redis://localhost:6379"

For a complete list of configuration options, refer to .env.example in the project repository.


Development

Available Scripts

Command Description
npm run dev Start development server with hot reload
npm run build Build production-optimized bundle
npm run start Start production server
npm run lint Execute ESLint for code quality checks
npm run typecheck Run TypeScript type checking
npm run format:write Format codebase with Prettier
npm run db:push Synchronize Prisma schema with database
npm run db:studio Launch Prisma Studio for database management

Testing

VectorMail includes comprehensive test coverage across unit, integration, and end-to-end tests.

# Unit Tests (Watch Mode)
npm run test

# Unit Tests with Coverage Report
npm run test:ci

# End-to-End Tests (Headless)
npm run test:e2e

# End-to-End Tests (Interactive UI)
npm run test:e2e:ui

Documentation

Detailed documentation is available in the following resources:


Contributing

Contributions to VectorMail are welcomed and appreciated. To contribute:

  1. Fork the Repository

    git clone https://github.com/YOUR_USERNAME/Vector-Mail.git
  2. Create a Feature Branch

    git checkout -b feature/your-feature-name
  3. Implement Changes

    • Follow the existing code style and conventions
    • Add tests for new functionality
    • Update documentation as needed
  4. Commit Changes

    git commit -m "feat: add your feature description"

    Follow Conventional Commits specification.

  5. Push to Your Fork

    git push origin feature/your-feature-name
  6. Submit a Pull Request

    • Provide a clear description of the changes
    • Reference any related issues
    • Ensure all CI checks pass

For detailed guidelines, please refer to the Contributing Guide.


License

This project is licensed under the MIT License. See the LICENSE file for complete terms and conditions.


Acknowledgments

VectorMail is built upon the shoulders of exceptional open-source projects and services:

  • T3 Stack: Modern full-stack TypeScript development framework
  • shadcn/ui: High-quality, accessible UI component library
  • Aurinko: Unified email API service
  • OpenAI: Advanced language model capabilities
  • Google Gemini: Multimodal AI intelligence

Support

For technical support, bug reports, or feature requests:


Project Links


VectorMail - Redefining Email Productivity with Artificial Intelligence

Developed and maintained by Parbhat Kapila

⬆ Back to Top

About

An AI Email Intelligence Platform Real-time email intelligence with multi-provider AI fallback, semantic search, OAuth integration. Handles incremental sync and streaming with 70% cold start reduction.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks