Skip to content

SamridhiiiGupta/MailForge--AI_Powered_Cold_Email_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βœ‰οΈ MailForge

AI-Powered Cold Email Generator

Python FastAPI LangChain Groq Vercel Render License

Paste a job listing URL. Get a personalised cold email in seconds.

πŸš€ Live Demo β€’ βš™οΈ Setup β€’ 🌍 Deploy β€’ πŸ“– Docs


🎯 What Is This?

MailForge is a full-stack AI application that automates B2B cold email outreach.

When a company posts a job listing, it signals a need β€” they're hiring because they have a gap. MailForge reads that signal, extracts what they need, and writes a targeted cold email offering your services. No copy-pasting. No manual research. Just a URL and a send-ready email.

Business Use Case: A software consulting firm wants to pitch to Nike, who just posted a job for a Machine Learning Engineer. Instead of writing from scratch, a sales executive pastes the URL into MailForge β€” and gets a personalised outreach email with matched portfolio links in seconds.


✨ Features

Feature Description
πŸ”— URL-to-Email Pipeline Paste any job listing URL β€” get a send-ready cold email
πŸ€– AI Extraction LLaMA 3.1 extracts role, skills, experience, and description as structured JSON
πŸ“ Portfolio Matching Automatically matches your portfolio projects to the job's required skills
🌐 3-Strategy Scraping Requests β†’ Selenium β†’ WebBaseLoader fallback chain for maximum compatibility
βš™οΈ Company Settings Fully customisable sender name, company, and description β€” persisted in session
🎨 Premium Dark UI Multi-page SaaS-level interface with smooth page transitions and micro-interactions
πŸ”’ Secure by Design API keys backend-only, CORS restricted, input validation via Pydantic
πŸ“Š Live API Status Real-time backend health indicator in the sidebar
πŸ“‹ Copy & Download One-click copy or download of every generated email

🧠 How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        USER BROWSER                          β”‚
β”‚                  (Vercel Β· Static Frontend)                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚  HTTPS  POST /api/generate
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     FASTAPI BACKEND                          β”‚
β”‚                   (Render Β· Python API)                      β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   Scraper   │──▢│   LLM Service    │──▢│  Portfolio  β”‚  β”‚
β”‚  β”‚             β”‚   β”‚                  β”‚   β”‚  Service    β”‚  β”‚
β”‚  β”‚ 1. requests β”‚   β”‚ 1. Extract jobs  β”‚   β”‚             β”‚  β”‚
β”‚  β”‚ 2. Selenium β”‚   β”‚    (JSON output) β”‚   β”‚ Keyword     β”‚  β”‚
β”‚  β”‚ 3. Loader   β”‚   β”‚ 2. Write email   β”‚   β”‚ matching vs β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚ portfolio   β”‚  β”‚
β”‚                             β”‚             β”‚ CSV         β”‚  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”‚β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”€β”€β”˜
                              β”‚  LLM API call
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        GROQ API                             β”‚
β”‚                   LLaMA 3.1 8B Instant                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Step-by-step flow:

  1. User pastes a job listing URL and clicks Generate Email
  2. Frontend sends POST /api/generate to the FastAPI backend
  3. Backend scrapes the page (tries 3 strategies for maximum reliability)
  4. Raw HTML is cleaned and truncated to fit the LLM context window
  5. LLaMA 3.1 extracts structured job data (role, skills, experience, description)
  6. Job skills are matched against data/portfolio.csv to find the most relevant projects
  7. LLaMA 3.1 writes a personalised cold email referencing the job and matched portfolio
  8. The email, job details, and portfolio links are returned to the frontend
  9. User copies or downloads the result

πŸ“Έ Screenshots

🏠 Generate Page β€” Main Email Generator

The core workspace. Paste a URL, hit Generate, and watch the AI pipeline run in real time. Results show extracted job details on the left and the generated email on the right.

Generate Page


βš™οΈ Settings Page β€” Company Configuration

Configure your company name, your name, description, and optional portfolio link overrides. Settings persist in session storage β€” set once, use everywhere.

Settings Page


❓ Help Page β€” Setup & Troubleshooting

Step-by-step how-it-works guide, prerequisites checklist, and a troubleshooting reference table.

Help Page


πŸ› οΈ Tech Stack

Frontend

Tech Purpose
Vanilla JS (ES2022) Client-side logic, routing, API calls
HTML5 / CSS3 Markup and premium dark UI styling
Syne + Instrument Serif Typography (Google Fonts)
Font Awesome 6 Icons

Backend

Tech Purpose
FastAPI REST API framework with automatic docs
Pydantic v2 Request/response validation
Uvicorn ASGI server
LangChain 0.2 LLM orchestration and prompt chaining
LangChain-Groq Groq API integration
Requests + Selenium Web scraping (strategy 1 & 2)
WebBaseLoader Web scraping fallback (strategy 3)
Pandas Portfolio CSV parsing
python-dotenv Environment variable management

AI / APIs

Tech Purpose
Groq Ultra-fast LLM inference API
LLaMA 3.1 8B Instant Job extraction + email generation

DevOps / Deployment

Tech Purpose
Vercel Frontend hosting (static files)
Render Backend hosting (Python/FastAPI)
GitHub Source control + CI trigger

βš™οΈ Local Setup

Prerequisites

1. Clone the repository

git clone https://github.com/SamridhiiiGupta/MailForge--AI_Powered_Cold_Email_Generator.git
cd mailforge

2. Create a virtual environment

# Windows
py -3.11 -m venv venv
venv\Scripts\activate

# macOS / Linux
python3 -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Configure environment variables

cp .env.example .env

Open .env and fill in at minimum:

GROQ_API_KEY=your_key_here
COMPANY_NAME=Your Company
FOUNDER_NAME=Your Name

5. Customise your portfolio

Edit data/portfolio.csv with your real project links:

Techstack,Links
"Python, Django, FastAPI",https://github.com/you/your-project
"Machine Learning, TensorFlow",https://your-ml-project.com

6. Run the app

# Single command β€” starts both API + frontend + opens browser
python run.py
Service URL
Frontend http://localhost:8080
API http://localhost:8000
API Docs http://localhost:8000/docs

🌍 Deployment

MailForge uses a Vercel + Render split deployment:

  • Frontend (HTML/CSS/JS) β†’ Vercel β€” free, instant, zero config
  • Backend (FastAPI) β†’ Render β€” free tier, Python support, auto-deploys

Step 1 β€” Push to GitHub

git init
git add .
git commit -m "feat: initial MailForge commit"
git branch -M main
git remote add origin https://github.com/SamridhiiiGupta/MailForge--AI_Powered_Cold_Email_Generator.git
git push -u origin main

Step 2 β€” Deploy Backend to Render

  1. Go to render.com β†’ New + β†’ Web Service
  2. Connect your GitHub repo
  3. Render detects render.yaml automatically β€” click Apply
  4. Add environment variables in the Render dashboard:
    • GROQ_API_KEY β†’ your Groq key
    • ALLOWED_ORIGINS β†’ (fill in after Step 3)
  5. Click Deploy β€” copy the URL: https://mailforge-jble.onrender.com

Step 3 β€” Configure Frontend API URL

Open frontend/config.js and replace the placeholder:

window.MAILFORGE_CONFIG = {
  API_URL: "https://mailforge-jble.onrender.com"  // ← your actual Render URL
};

Then commit and push:

git add frontend/config.js
git commit -m "config: set production API URL"
git push

Step 4 β€” Deploy Frontend to Vercel

  1. Go to vercel.com β†’ Add New Project
  2. Import your GitHub repo
  3. Vercel detects vercel.json β€” no config needed
  4. Click Deploy β€” copy the URL: https://mailforge-ai-powered-cold-email-gen-lake.vercel.app

Step 5 β€” Update CORS on Render

Go to Render dashboard β†’ your service β†’ Environment and update:

ALLOWED_ORIGINS = https://mailforge-ai-powered-cold-email-gen-lake.vercel.app

Click Save β†’ Render redeploys automatically. βœ…


πŸ§ͺ Running Tests

pytest
# or with coverage:
pytest --cov=app --cov-report=term-missing

Expected: 15 tests passing


πŸ“Œ Future Improvements

  • ChromaDB vector search β€” replace keyword matching with semantic portfolio search
  • Multi-job support β€” generate emails for all jobs found on a page
  • Email history β€” save and revisit previously generated emails
  • Tone selector β€” formal / casual / aggressive outreach styles
  • Export to Gmail/Outlook β€” one-click mailto or OAuth send
  • Analytics dashboard β€” track which emails got responses

πŸ“– Documentation

Full technical documentation available in docs/MailForge_Documentation.docx

GitHub Repository: SamridhiiiGupta/MailForge--AI_Powered_Cold_Email_Generator


πŸ“„ License

MIT β€” see LICENSE.


Built with β˜• and LLaMA 3.1 by Samridhi Gupta

About

Turn job posts into personalized cold emails πŸ’Όβœ¨ using AI β€” smart extraction, portfolio matching, and instant email generation powered by LLMs πŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors