How srujanrana07/researchreach-a-cold-email-helper works
1. Repository shape
- The repo is split into two top-level applications:
- app/: a Python backend, likely a Flask service.
- front/: a React single-page frontend.
- There is no obvious database, message queue, or worker system in the file tree; the architecture appears request-driven and stateless.
2. Frontend boundary
- front/src/App.js is the main client shell, with standard React bootstrap files in index.js, index.css, and test scaffolding.
- The frontend’s role is to collect user input, display matched papers, and show generated email content or status.
- It likely consumes backend HTTP endpoints directly; no separate frontend state service is visible.
3. Backend entrypoint
- app/app.py is the backend entrypoint and likely exposes the API surface for the UI.
- This is the orchestration layer: it would receive uploaded resumes or text, call the processing modules, and return ranked papers and email drafts.
4. Resume ingestion and extraction
- app/resume_processor.py is the first major processing boundary.
- Per the README, this stage extracts skills, projects, and other relevant text from resumes, likely from PDF input.
- This module is the bridge between raw user documents and the semantic matching pipeline.
5. Candidate text normalization
- The extracted resume content is condensed into a single “candidate profile text” used downstream.
- This flattened text is important because it becomes the semantic input for similarity matching against paper text.
6. Research paper acquisition
- app/paper_retrieval.py handles finding candidate papers.
- The README indicates paper discovery via Semantic Scholar / web scraping, and possible access to full text via Unpaywall.
- This is the external-data boundary: the backend depends on third-party scholarly APIs and web sources.
7. Semantic matching
- app/similarity.py performs the core ranking logic.
- The README specifies Sentence-BERT embeddings (all-MiniLM-L6-v2) and cosine similarity, so this module likely encodes both resume and paper text and scores their semantic closeness.
- This is the primary ML/NLP subsystem in the repo.
8. Email generation
- app/email_generator.py generates a cold email tailored to the selected paper and candidate profile.
- The README says this uses Gemini, so this module is an LLM integration boundary that turns structured match results into prose.
9. Email delivery
- app/email_sender.py is the outbound communication layer.
- It likely sends the generated email through SMTP or a mail API, separating drafting from actual delivery.
10. End-to-end data flow
- User interacts with the React UI → backend receives resume/input → resume text is extracted → papers are retrieved → resume and paper texts are embedded → cosine similarity ranks results → top match is returned → email draft is generated → optional email sending occurs.
- The central artifact moving through the system is text, transformed progressively from document content into embeddings, scores, and finally an email.
11. Testing and validation
- Backend-side testing appears in app/test.py.
- Frontend tests are set up via front/src/App.test.js and setupTests.js.
- This suggests the repo validates both the UI shell and backend logic, though no dedicated integration-test harness is visible.
12. Operational characteristics
- Dependencies are managed separately with app/requirements.txt for Python and front/package.json / package-lock.json for React.
- Because the visible architecture has no persistence layer, match results and generated emails are probably computed on demand rather than stored long-term.
- External services materially affecting the design are: Semantic Scholar, Unpaywall, and Gemini.
Main entry points: app.py API app · paper_retrieval.py Paper search · email_generator.py Email writer · App.js UI shell
Components 16
Frontend
React single-page client
Backend
Python API and processing pipeline
- API app · Backend entrypoint and request orchestration
app/app.py - Resume parser · Extracts and normalizes resume content into candidate text
app/resume_processor.py - Paper search · Finds candidate papers and fetches available full text
app/paper_retrieval.py - Matcher · Embeds texts and scores semantic similarity
app/similarity.py - Email writer · Generates a tailored cold email for the selected paper
app/email_generator.py - Sender · Sends the generated email outward
app/email_sender.py - Candidate text · Flattened resume-derived text used for matching
- Paper text · Retrieved paper text used for ranking and drafting
- Ranked papers · Similarity-scored paper matches returned to the UI
- Email draft · Tailored outreach email produced from the selected match
External services
Third-party scholarly and LLM integrations
- Semantic Scholar · Paper discovery source
- Unpaywall · Full-text access source
- Gemini · Generates the outreach email text
- Mail service · Outbound email transport
Connections 19
- Bootstrap → UI shell: boots · React entry renders the main UI shell
- UI shell → API app: requests · UI sends user input and fetch requests to the backend
- API app → Resume parser: parses resume · Backend delegates document extraction to the resume processor
- Resume parser → Candidate text: produces · Extracted resume content is normalized into candidate text
- API app → Paper search: finds papers · Backend initiates paper discovery and full-text lookup
- Paper search → Semantic Scholar: searches · Discovery queries scholarly metadata sources
- Paper search → Unpaywall: fetches full text · Attempts to resolve accessible paper text
- Paper search → Paper text: produces · Retrieved paper content is prepared for ranking
- Candidate text → Matcher: scores against · Candidate profile text is embedded and compared to papers
- Paper text → Matcher: scores against · Paper text is embedded and compared to the candidate profile
- Matcher → Ranked papers: ranks · Similarity module returns the best-matching papers
- API app → Email writer: drafts email · Backend asks for a tailored email based on the selected match
- Ranked papers → Email writer: provides context · Top match and scoring context inform the draft
- Email writer → Gemini: calls · LLM integration generates the prose email
- Email writer → Email draft: produces · Generated outreach content is returned as a draft
- Email draft → Sender: sends · Optional delivery step hands the drafted email to the sender
- Sender → Mail service: delivers via · Outbound communication uses SMTP or a mail API
- Ranked papers → UI shell: returns results · Backend sends ranked matches back to the UI
- Email draft → UI shell: returns draft · Backend can return the generated email for display