This project provides an AI-powered email agent that can automatically read, understand, and reply to emails using advanced natural language processing. Vist us at www.poweredby.agency for assistance on how to implement this for your use case.
- Gmail Integration: Connect to Gmail accounts and monitor incoming emails
- AI-Powered Replies: Generate context-aware responses to emails
- Knowledge Base: Upload documents to provide reference information to the AI
- Approval Workflow: Review AI-generated replies before sending
- Analytics: Track email agent performance and collect user feedback
poweredbyapp/
├── functions/ # Netlify serverless functions
│ ├── auth/
│ │ └── gmail-callback.js # OAuth handler
│ ├── poll-inbox.js # Gmail polling
│ ├── generate-reply.js # OpenAI reply logic
│ ├── send-reply.js # Send email replies
│ ├── process-kb-upload.js # KB file embedding
├── supabase/
│ ├── schema.sql # Database schema
├── netlify.toml # Netlify configuration
├── .env.example # Example environment variables
- Supabase account and project
- OpenAI API key
- Gmail API credentials
- Netlify account
Copy .env.example
to .env
and fill in the required values:
# Copy example env file
cp .env.example .env
# Edit with your values
nano .env
- Create a new Supabase project
- Run the schema from
supabase/schema.sql
- Enable vector extension if not already enabled:
CREATE EXTENSION IF NOT EXISTS vector;
- Create a project in Google Cloud Console
- Enable Gmail API
- Create OAuth credentials (web application type)
- Add authorized redirect URI:
https://your-netlify-site.netlify.app/.netlify/functions/gmail-callback
- Connect your GitHub repository to Netlify
- Configure build settings as per
netlify.toml
- Add all environment variables from
.env
to Netlify environment variables
The project requires the following npm packages:
npm install @supabase/supabase-js openai googleapis pdf-parse mammoth node-fetch
For local development, install the Netlify CLI:
npm install -g netlify-cli
netlify login
netlify link
netlify dev
This project is licensed under the MIT License.