A web-based personal email assistant that reads emails from Gmail and Outlook via OAuth2, displays them in a unified inbox, and uses Claude AI to draft replies for user review before sending.
- Unified Inbox - View emails from Gmail and Outlook in one place
- AI-Powered Replies - Claude drafts context-aware replies matching the email's tone
- Tone Control - Choose from professional, friendly, brief, or formal tones
- Custom Instructions - Guide the AI with specific instructions (e.g., "decline politely")
- Review Before Sending - Edit AI-generated drafts before sending
- OAuth2 Authentication - Secure Google and Microsoft OAuth2 integration
- Encrypted Token Storage - OAuth tokens encrypted at rest with Fernet
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (App Router, TypeScript, Tailwind CSS) |
| Backend | Python FastAPI |
| Database | SQLite (SQLAlchemy, swappable to PostgreSQL) |
| AI | Anthropic Claude API (Sonnet) |
| Auth | OAuth2 (Google, Microsoft), JWT session cookies |
kathy/
├── frontend/ # Next.js
│ ├── src/app/ # Pages (inbox, email detail, settings)
│ ├── src/components/ # EmailList, EmailView, AIDraftPanel, etc.
│ ├── src/hooks/ # useAuth, useEmails
│ └── src/lib/ # API client, types
│
└── backend/ # FastAPI
└── app/
├── main.py # App entry, CORS, routers
├── config.py # Pydantic Settings
├── models.py # User, EmailAccount tables
├── auth/ # JWT, Google OAuth, Microsoft OAuth
├── routers/ # auth, emails, accounts, ai endpoints
├── services/ # Gmail, Outlook, Claude AI services
└── utils/ # Encryption, email parsing
- Python 3.11+
- Node.js 18+
- Google Cloud Console project with Gmail API enabled
- Anthropic API key
-
Clone the repo
git clone https://github.com/quake0day/Kathy.git cd Kathy -
Configure environment
cp .env.example backend/.env # Edit backend/.env with your credentials -
Start the backend
cd backend pip install -r requirements.txt uvicorn app.main:app --reload --port 8000 -
Start the frontend
cd frontend npm install npm run dev -
Open http://localhost:3000 and connect your email account.
- Go to Google Cloud Console
- Create a project and enable the Gmail API
- Configure OAuth consent screen (External, add test users)
- Create OAuth credentials (Web application)
- Add redirect URI:
http://localhost:8000/api/auth/google/callback
- Go to Azure Portal → App registrations
- Register a new application
- Add redirect URI:
http://localhost:8000/api/auth/microsoft/callback - Create a client secret
| Method | Path | Purpose |
|---|---|---|
| GET | /api/auth/google/login |
Start Google OAuth |
| GET | /api/auth/microsoft/login |
Start Microsoft OAuth |
| GET | /api/auth/me |
Current user info |
| GET | /api/emails |
Unified inbox (paginated) |
| GET | /api/emails/{account_id}/{message_id} |
Email detail |
| POST | /api/emails/{account_id}/{message_id}/reply |
Send reply |
| POST | /api/ai/draft-reply |
Generate AI draft reply |
MIT