Your Remote Coworker, One Email Away. Forward boring emails, get smart responses
AskEmail is an open-source AI email assistant that processes emails and provides intelligent responses using Google's Gemini model. Deploy it on your own Cloudflare infrastructure or use our hosted service.
- 🌐 Website: askemail.com
- ✉️ Demo: anything@askemail.com
- 💻 Source Code: github.com/G4brym/askemail
AskEmail is a serverless AI assistant that processes emails and provides intelligent responses. It leverages Cloudflare Workers, Google's Gemini model, and vector databases to provide a powerful, privacy-focused email assistant that you can self-host.
-
📧 Email Processing
- Process and analyze email content and attachments
- Summarize long email threads
- File analysis (up to 0.5MB)
- Smart context-aware responses
-
🧠 Memory Management
- Optional conversation memory using vector database
- Context-aware responses based on previous interactions
- Explicit memory management (store/forget)
-
🛡️ Security & Privacy
- Whitelist-based email authorization
- No data storage unless explicitly requested
- Optional AWS SES integration for broader email support
- No registration or login required
- Fully self-hostable
graph TD
A[Email Received] --> B[Email Worker]
B --> C[Gemini 1.5 Flash]
C --> D{Memory Operation?}
D -->|Store| E[Insert into Cloudflare Vectorize]
D -->|Read| F[Query Cloudflare Vectorize]
E --> G[Store in D1]
F --> H[Retrieve from D1]
H --> C
C --> I[Parse Response]
I --> J[Send Email]
J -->|Option 1| K[Email Workers]
J -->|Option 2| L[AWS SES]
- Node.js and npm installed
- Cloudflare account
- Google AI Studio API key
- Domain with Cloudflare email routing
# Install dependencies
npm install
# Login to Cloudflare
npx wrangler login
# Create vector database
npx wrangler vectorize create askemail-index --dimensions=1024 --metric=cosine
# Create D1 database
npx wrangler d1 create askemail-db
# Apply database migrations
npx wrangler d1 migrations apply DB --remote
- Update
wrangler.toml
:- Set
allowed_destination_addresses
- Configure database ID from D1 creation
- Set
- Update
FROM_ADDRESS
insrc/configs.ts
# Deploy the worker
npx wrangler deploy
# Set Google AI API key
npx wrangler secret put GOOGLE_AI_KEY
Configure your domain's email routing in Cloudflare Dashboard:
- Navigate to Email > Email Routing
- Create a new routing rule pointing to your worker
- Test the setup by sending an email from your allowed list
The service supports two deployment models:
-
Hosted Service (Free Tier)
- Send emails to anything@askemail.com
- Limited to 10 emails per day
- All features included
-
Self-Hosted (Cloudflare Workers Free Plan)
- Deploy on your own infrastructure
- Configure custom email addresses
- Set custom rate limits
- Full control over data and privacy
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.