MailPilot - Your AI Copilot for Intelligent Email Management

Inspiration 💡

We've all been there - drowning in an overflowing inbox, spending hours sorting through emails, missing important messages, and feeling overwhelmed by the sheer volume of communication. Email was supposed to make our lives easier, but instead it's become one of the biggest productivity drains in modern work life.

We envisioned a future where AI doesn't just help you write emails, but acts as your intelligent copilot - understanding context, prioritizing what matters, and helping you navigate your inbox with the same precision a pilot navigates the skies. That's how MailPilot was born.

What It Does ✨

MailPilot is an AI-powered email client that transforms how you interact with your inbox:

  • Intelligent Email Analysis: AI agents analyze email content, sentiment, and priority
  • Smart Organization: Automatically categorize and prioritize messages
  • Conversational Interface: Chat with your inbox using natural language
  • Context-Aware Actions: AI understands your workflow and suggests relevant actions
  • Real-Time Insights: Get summaries, action items, and key information extracted instantly

How We Built It 🛠️

MailPilot features a sophisticated dual-architecture:

Frontend Stack

  • Next.js 15 with React 19 for a blazing-fast, modern web experience
  • CopilotKit for seamless AI chat integration and generative UI components
  • shadcn/ui for beautiful, accessible UI components
  • TypeScript for type-safe development

Backend Stack

  • FastAPI for high-performance API endpoints
  • Google ADK (Agent Development Kit) powering our AI agent system
  • SQLAlchemy + SQLite for efficient data management
  • Python 3.12+ with strict type checking via mypy

Key Technical Achievements

  1. Bridged CopilotKit with Google ADK - Created a seamless connection between the frontend chat interface and our backend AI agent
  2. Dual Package Management - Orchestrated pnpm (Node.js) and uv (Python) in a unified development workflow
  3. Real-Time State Synchronization - Maintained consistent state between frontend and backend agents
  4. Tool-Based Architecture - Built modular, reusable AI tools that the agent can invoke dynamically

Challenges We Faced 🎯

1. Integration Complexity

Connecting CopilotKit's runtime with Google ADK was uncharted territory. The two frameworks had different paradigms - we had to create custom middleware and adapters to make them work together seamlessly.

Solution: Built an HttpAgent bridge in the Next.js API route that forwards requests to our FastAPI backend, wrapped our ADK agent in custom middleware, and ensured proper state synchronization.

2. Dual Package Manager Coordination

Managing Node.js dependencies with pnpm and Python dependencies with uv in a single project was tricky, especially for team collaboration.

Solution: Created automated postinstall scripts that set up the Python environment automatically when running pnpm install, and documented clear patterns in our project guidelines.

3. Type Safety Across the Stack

Maintaining type safety from TypeScript frontend through Python backend while dealing with AI agent responses (which are inherently dynamic) was challenging.

Solution: Implemented strict TypeScript and mypy configurations, defined clear interface contracts, and used Pydantic models for data validation at API boundaries.

4. Real-Time Agent Communication

Keeping the UI responsive while AI agents process requests, especially for longer-running operations, required careful state management.

Solution: Leveraged CopilotKit's streaming capabilities and implemented proper loading states with React 19's concurrent features.

5. Database Schema Evolution

As we iterated rapidly during the hackathon, our data models changed frequently, requiring careful migration strategies.

Solution: Built database reset/seeding utilities using JSON seed files for quick iteration while maintaining data integrity.

What We Learned 📚

  • AI Framework Integration: Deep understanding of how to bridge different AI frameworks and create cohesive agent experiences
  • Modern Full-Stack Architecture: Hands-on experience with cutting-edge tools like Next.js 15, React 19, and Google ADK
  • Python Best Practices: Implementing production-grade Python with strict type checking, proper dependency injection, and clean architecture
  • Real-Time Systems: Building responsive UIs that gracefully handle asynchronous AI operations
  • Developer Experience: The importance of automation, good documentation, and unified development workflows

What's Next for MailPilot 🚀

  • Multi-Provider Support: Integrate with Gmail, Outlook, and other email providers
  • Advanced AI Features: Smart reply suggestions, email summarization, and automatic follow-up reminders
  • Team Collaboration: Shared inbox management with AI-powered delegation
  • Mobile Apps: Native iOS and Android experiences
  • Privacy-First Architecture: End-to-end encryption and local-first AI processing options
  • Plugin Ecosystem: Allow developers to extend MailPilot with custom AI tools and integrations

Built With

  • adk
  • agent
  • and
  • copilotkit
  • fastapi
  • google
  • next.js
Share this project:

Updates