How yash-meshram/cold-email-generator works
Project type and purpose
• This is a full-stack AI-powered web application (“Cold Email Generator”) with a Streamlit frontend, Python backend logic written with LangChain, and a local vector database (ChromaDB) for portfolio matching. Its purpose is to scrape job postings, vectorize your portfolio, query the vector store, and use an LLM (via Groq) to generate personalized cold emails.
File structure
• Top-level:
• app/ – main Streamlit entrypoint (main.py), orchestration logic (chains.py), portfolio management (portfolio.py), utilities (utils.py), and static resources (resources/my_portfolio.csv).
• VectorDB/ – persistent ChromaDB storage (SQLite and binary index files).
• testing/ – unit/integration scripts, sample data, and temporary vector store.
• README.md, NOTES.txt, .gitignore.
• Patterns:
• “chains.py” implements a pipeline (filters and transformations).
• “portfolio.py” encapsulates CRUD + vector-store integration.
• “VectorDB/” holds the on-disk vector index.
• Config via environment variables (.env).
Extract insights from README
• Frontend: Streamlit UI in app/main.py.
• Backend:
• Web scraper → text cleaning (utils.py) → job parser (chains.py).
• Portfolio ingestion & query using ChromaDB (portfolio.py).
• LLM integration (langchain_groq) for email generation.
• External dependencies: Groq LLM, ChromaDB, Streamlit, LangChain, pandas.
Main components and interactions
a. Components:
1. Streamlit UI (app/main.py)
2. Controller/Chain Orchestrator (app/chains.py)
3. Web Scraper & Parser (inside chains.py + utils.py)
4. Portfolio Vector Store (app/portfolio.py + VectorDB/)
5. LLM Service (Groq via LangChain_groq)
6. Data Sources: Career page URLs; app/resources/my_portfolio.csv
b. Relationships & data flow:
• User enters URL in Streamlit UI →
• Main triggers chain: scrape → clean → parse →
• Portfolio module loads/updates vector store → queries for top-N relevant projects →
• Chain calls LLM with job + portfolio context →
• Generated email returned to Streamlit UI.
• Vector store persists to VectorDB/ (SQLite & binary files).
c. Architectural patterns:
• Pipeline (chains of transformations).
• Layered separation: Presentation (Streamlit) → Orchestration (chains.py) → Domain (portfolio.py) → Persistence (ChromaDB) → External (Groq API).
d. Key technologies:
• Python, Streamlit, LangChain, Groq API, ChromaDB (SQLite backend), pandas.