Cold Email Generator

AI-Powered Business Outreach for Service Companies

🎯 Project Overview

The Cold Email Generator is an intelligent tool designed specifically for service companies to automate and personalize their business outreach efforts. By leveraging advanced AI technologies, it extracts job listings from company career pages and generates highly targeted cold emails that match specific job requirements with relevant service offerings.

Llama 3.1 LLM Groq LangChain Streamlit ChromaDB Python

⚡ How It Works

Live Demo Interface


URL Input
Web Scraping
Job Extraction
Resume Matching
Email Generation

🔧 Technical Workflow Deep Dive

Data Extraction Layer

Web Scraping Engine: Uses BeautifulSoup4 and Selenium to extract job postings from career pages. Handles dynamic content loading and JavaScript-rendered pages.

# Web scraping implementation from selenium import webdriver from bs4 import BeautifulSoup import requests def extract_jobs(url): driver = webdriver.Chrome() driver.get(url) html = driver.page_source soup = BeautifulSoup(html, 'html.parser') return parse_job_listings(soup)

Job Parsing & Structuring

LangChain Integration: Processes raw HTML content to extract structured job data including titles, requirements, descriptions, and company information.

# Job parsing with LangChain from langchain.text_splitter import RecursiveCharacterTextSplitter from langchain.schema import Document def structure_job_data(raw_jobs): structured_jobs = [] for job in raw_jobs: job_doc = Document( page_content=job['description'], metadata={ 'title': job['title'], 'requirements': job['requirements'], 'company': job['company'] } ) structured_jobs.append(job_doc) return structured_jobs

Vector Database Storage

ChromaDB Integration: Converts job descriptions into embeddings and stores them in a vector database for semantic similarity matching.

# ChromaDB vector storage import chromadb from langchain.vectorstores import Chroma from langchain.embeddings import HuggingFaceEmbeddings def store_in_vectordb(job_documents): embeddings = HuggingFaceEmbeddings() vectorstore = Chroma.from_documents( documents=job_documents, embedding=embeddings, persist_directory="./job_vectors" ) return vectorstore

Resume Portfolio Matching

Semantic Search: Matches job requirements with relevant portfolios/resumes using cosine similarity. Identifies best-fit candidates for each position.

# Resume matching algorithm def match_resumes_to_jobs(job_embeddings, resume_portfolio): matches = [] for job in job_embeddings: similar_resumes = vectorstore.similarity_search( job.page_content, k=3, filter={'skills': job.metadata['requirements']} ) matches.append({ 'job': job, 'matched_resumes': similar_resumes }) return matches

AI Email Generation

Llama 3.1 via Groq: Generates personalized cold emails using the matched job-resume pairs. Creates contextually relevant content with specific value propositions.

# Email generation with Llama 3.1 from groq import Groq def generate_cold_email(job_match, company_info): client = Groq(api_key="your-groq-api-key") prompt = f""" Generate a professional cold email for: Job: {job_match['job'].metadata['title']} Company: {company_info['name']} Matched Resume: {job_match['matched_resumes'][0]} Focus on specific value propositions and relevance. """ response = client.chat.completions.create( messages=[{"role": "user", "content": prompt}], model="llama3-70b-8192" ) return response.choices[0].message.content

Output Delivery

Streamlit Interface: Presents generated emails in an intuitive web interface with editing capabilities, export options, and campaign management features.

# Streamlit interface import streamlit as st def display_generated_emails(emails): st.title("Generated Cold Emails") for i, email in enumerate(emails): with st.expander(f"Email {i+1}: {email['subject']}"): st.text_area("Email Content", email['content']) if st.button(f"Export Email {i+1}"): export_email(email)

📧 Complete Example

Scenario: A web development agency wants to reach out to Nike for their Senior Frontend Developer position

Input Data:

Job Title: Senior Frontend Developer Company: Nike Requirements: React, TypeScript, 5+ years experience, E-commerce Location: Portland, OR Posted: 2 days ago Matched Resume: John Smith - Frontend Specialist - 6 years React development - E-commerce platform expertise - TypeScript proficiency - Portfolio: 15+ successful projects

Generated Cold Email:

Email Analytics:

Personalization Score: 92/100 Relevance Match: 89/100 Professional Tone: 95/100 Call-to-Action Strength: 88/100 Key Matching Elements: ✓ Technology stack alignment (React, TypeScript) ✓ Industry experience (E-commerce) ✓ Seniority level match (6+ years vs 5+ required) ✓ Location consideration (Remote-friendly) ✓ Portfolio relevance (15+ projects)

🏗️ System Architecture

Streamlit Frontend
LangChain Processing
ChromaDB Vector Store
Groq + Llama 3.1

Data Flow:

Input Processing

Career page URLs → Web scraper → Raw HTML → Job parser → Structured data

Vector Processing

Job descriptions → Embeddings → ChromaDB storage → Similarity search → Resume matching

Email Generation

Matched pairs → Prompt engineering → Llama 3.1 → Generated emails → Quality scoring

Output Delivery

Email content → Streamlit interface → User review → Export/Send → Campaign tracking

🚀 Key Features

Intelligent Matching

Uses vector similarity to match job requirements with portfolio skills, ensuring highly relevant email content and improved response rates.

Dynamic Personalization

Each email is uniquely crafted based on specific job requirements, company culture, and matched candidate profiles.

Batch Processing

Process multiple job listings simultaneously, generating dozens of targeted emails in minutes rather than hours.

Quality Scoring

Built-in analytics rate email quality, relevance, and personalization level to optimize outreach effectiveness.