Sendora is a fully autonomous, AI-driven background agent built on the Gmail API and Google's Gemini models. Unlike traditional AI writing assistants that require you to learn a new email client, Sendora operates invisibly. It reads, categorizes, and answers incoming emails using a custom Retrieval-Augmented Generation (RAG) pipeline—pulling exact facts from your uploaded business PDFs to generate highly accurate replies while you sleep.
- Invisible Autonomy: Once connected via Google OAuth, Sendora uses backend cron jobs to monitor your inbox. You never have to abandon your native Gmail app.
- Custom Knowledge Base (RAG): Upload your pricing, policies, and FAQs as PDFs. Sendora embeds these into a MongoDB Vector Database and searches them before replying, eliminating AI hallucinations.
- Dynamic Intent Routing: Define custom labels (e.g., "Support", "Urgent"). Sendora categorizes the emotional intent of the sender and acts accordingly.
- Draft vs. Auto-Reply: Tell the AI to either silently save perfect responses into your Drafts folder for human review or send them instantly for zero-touch automation.
- Persona Cloning: Define your brand's voice (Friendly, Professional, Witty). Sendora guarantees the AI writes exactly how you would.
- Analytics Dashboard: A beautiful React UI tracking total emails processed, hours of typing saved, and detailed historical logs of every AI action.
Sendora operates through asynchronous background polling.
flowchart TD
Fetch[node-cron Fetches UNREAD emails] --> Extract[Extract Sender & Body]
Extract --> Embed[Convert email to Vector]
Embed --> VectorSearch[(Atlas Vector DB)]
VectorSearch -->|Retrieved PDF Facts| Prompt[Assemble AI Prompt]
Prompt --> Gemini{Gemini 2.5 Flash}
Gemini -->|Outputs JSON| Parse[Parse Label & Action]
Parse --> Draft[Save to Gmail Drafts]
- Node.js (v20+ recommended)
- MongoDB Atlas account (required for Vector Search)
- Google Cloud Console account (for OAuth and Gmail API credentials)
- Google AI Studio API Key (for Gemini 2.5 Flash and embeddings)
git clone https://github.com/s4hil-dev/sendora-email-agent.git
cd sendora-email-agentCreate a .env file in the /server directory and configure the following:
MONGODB_URI=......
GOOGLE_CLIENT_ID=......
GOOGLE_CLIENT_SECRET=......
GOOGLE_CALLBACK_URL=http://localhost:5000/auth/google/callback
GEMINI_API_KEY=......You must create a Vector Search Index in your MongoDB Atlas Dashboard for the RAG feature to work.
- Go to your Atlas Dashboard ->
knowledgescollection -> Atlas Search. - Create a new Vector Index named
vector_index. - Use the following JSON configuration:
{
"fields": [
{ "type": "vector", "path": "embedding", "numDimensions": 3072, "similarity": "cosine" },
{ "type": "filter", "path": "userId" }
]
}# Install backend dependencies
cd server
npm install
# Install frontend dependencies
cd ../frontend
npm installYou need two terminal windows open:
# Terminal 1: Start Backend (Runs on port 5000)
cd server
npm run dev
# Terminal 2: Start Frontend (Runs on port 5173)
cd frontend
npm run devSendora requires "Restricted Scopes" (https://www.googleapis.com/auth/gmail.modify) to read and draft emails.
- Data Retention: Sendora does not store the body text of your incoming emails permanently. It only stores metadata IDs for analytics to protect client privacy.
- OAuth: User
refreshTokensshould be encrypted at rest in a production environment.
- Migration from
node-cronpolling to Google Cloud Pub/Sub Push Notifications for instantaneous processing. - Implementation of BullMQ for robust background job queuing and API retry logic.
- "Human-in-the-Loop" Tinder-style swipe dashboard for rapid draft approvals.
- Microsoft Outlook / Office 365 integration.
This project is licensed under the MIT License.