# sumitlakhera/ai-job-agent architecture

> Architecture diagram of the GitHub repository sumitlakhera/ai-job-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sumitlakhera/ai-job-agent
- Repository: https://github.com/sumitlakhera/ai-job-agent

## Overview

AI Job Agent is a resume-to-job fit application. Candidates upload a PDF, review extracted skills, experience and projects, then search by role and location for ranked opportunities with match scores, skill gaps and explanations. The frontend calls Flask endpoints; the backend parses resumes and fetches and evaluates jobs. The README documents several capabilities whose internal wiring is not fully shown in the excerpts, so those relationships are attributed to the README. Job processing is concentrated in one service, so its distinct responsibilities share that source path.

Main entry points: [`backend/services/job_service.py`](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py) (Job search and retrieval), [`frontend/src/App.js`](https://github.com/sumitlakhera/ai-job-agent/blob/main/frontend/src/App.js) (Resume and job UI), [`backend/services/resume_service.py`](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/resume_service.py) (Resume insight extraction), [`backend/routes/job_routes.py`](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/routes/job_routes.py) (Job endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Candidate interface"]
  node_webapp["Resume and job UI<br/>[App.js]"]
  node_results["Ranked opportunities<br/>[App.js]"]
end

subgraph group_api["API entry points"]
  node_resume_api["Resume endpoint<br/>[resume_routes.py]"]
  node_job_api["Job endpoint<br/>[job_routes.py]"]
  node_flask_app["Flask app<br/>[app.py]"]
end

subgraph group_resume["Resume processing"]
  node_pdf_text["PDF text extraction<br/>[pdf_parser.py]"]
  node_resume_insights["Resume insight extraction<br/>[resume_service.py]"]
  node_resume_cache[("Resume cache<br/>[resume_cache.json]")]
end

subgraph group_jobs["Job evaluation"]
  node_job_search["Job search and retrieval<br/>[job_service.py]"]
  node_job_cache[("Job cache<br/>[job_cache.json]")]
  node_job_skills["Job skill extraction<br/>[job_service.py]"]
  node_fit_match["Skill and fit matching<br/>[job_service.py]"]
  node_fit_explanations["Fit explanations<br/>[job_service.py]"]
  node_email_drafts["Application email drafts<br/>[job_service.py]"]
end

node_candidate(("Candidate"))
node_groq["Groq API"]
node_serpapi["SerpAPI"]

node_candidate -->|"uploads and searches"| node_webapp
node_webapp -->|"posts PDF"| node_resume_api
node_webapp -->|"requests jobs"| node_job_api
node_flask_app -->|"registers route"| node_resume_api
node_flask_app -->|"registers route"| node_job_api
node_resume_api -->|"calls parser"| node_resume_insights
node_resume_insights -->|"extracts text"| node_pdf_text
node_resume_insights -->|"requests structured data"| node_groq
node_resume_insights -->|"writes insights"| node_resume_cache
node_job_api -->|"fetches jobs"| node_job_search
node_job_search -->|"fetches listings"| node_serpapi
node_job_search -->|"reads and writes cache"| node_job_cache
node_job_search -->|"extracts requirements"| node_job_skills
node_job_search -->|"compares resume skills"| node_fit_match
node_fit_match -->|"informs fit insights"| node_fit_explanations
node_job_search -->|"generates insights"| node_groq
node_fit_explanations -.->|"supports tailored drafts"| node_email_drafts
node_job_api -->|"returns ranked matches"| node_results
node_webapp -->|"displays results"| node_results

click node_webapp "https://github.com/sumitlakhera/ai-job-agent/blob/main/frontend/src/App.js"
click node_resume_api "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/routes/resume_routes.py"
click node_job_api "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/routes/job_routes.py"
click node_flask_app "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/app.py"
click node_pdf_text "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/utils/pdf_parser.py"
click node_resume_insights "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/resume_service.py"
click node_resume_cache "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/resume_cache.json"
click node_job_search "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py"
click node_job_cache "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/job_cache.json"
click node_job_skills "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py"
click node_fit_match "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py"
click node_fit_explanations "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py"
click node_email_drafts "https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py"
click node_results "https://github.com/sumitlakhera/ai-job-agent/blob/main/frontend/src/App.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_results toneBlue
class node_resume_api,node_job_api,node_flask_app toneAmber
class node_pdf_text,node_resume_insights,node_resume_cache,node_groq,node_serpapi toneMint
class node_job_search,node_job_cache,node_job_skills,node_fit_match,node_fit_explanations,node_email_drafts toneRose
class node_candidate toneIndigo
```

## Components

### Candidate interface

- [Resume and job UI](https://github.com/sumitlakhera/ai-job-agent/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Ranked opportunities](https://github.com/sumitlakhera/ai-job-agent/blob/main/frontend/src/App.js): `frontend/src/App.js`

### API entry points

- [Resume endpoint](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/routes/resume_routes.py): `backend/routes/resume_routes.py`
- [Job endpoint](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/routes/job_routes.py): `backend/routes/job_routes.py`
- [Flask app](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/app.py): `backend/app.py`

### Resume processing

- [PDF text extraction](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/utils/pdf_parser.py): `backend/utils/pdf_parser.py`
- [Resume insight extraction](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/resume_service.py): `backend/services/resume_service.py`
- [Resume cache](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/resume_cache.json): `backend/resume_cache.json`

### Job evaluation

- [Job search and retrieval](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py): `backend/services/job_service.py`
- [Job cache](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/job_cache.json): `backend/job_cache.json`
- [Job skill extraction](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py): `backend/services/job_service.py`
- [Skill and fit matching](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py): `backend/services/job_service.py`
- [Fit explanations](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py): `backend/services/job_service.py`
- [Application email drafts](https://github.com/sumitlakhera/ai-job-agent/blob/main/backend/services/job_service.py): `backend/services/job_service.py`

### Other components

- **Candidate**
- **Groq API**
- **SerpAPI**

## Connections

- Candidate → Resume and job UI: uploads and searches (evidence: `README.md`)
- Resume and job UI → Resume endpoint: posts PDF (evidence: `frontend/src/App.js`)
- Resume and job UI → Job endpoint: requests jobs (evidence: `frontend/src/App.js`)
- Flask app → Resume endpoint: registers route (evidence: `backend/app.py`)
- Flask app → Job endpoint: registers route (evidence: `backend/app.py`)
- Resume endpoint → Resume insight extraction: calls parser (evidence: `backend/routes/resume_routes.py`)
- Resume insight extraction → PDF text extraction: extracts text (evidence: `backend/services/resume_service.py`)
- Resume insight extraction → Groq API: requests structured data (evidence: `backend/services/resume_service.py`)
- Resume insight extraction → Resume cache: writes insights (evidence: `backend/services/resume_service.py`)
- Job endpoint → Job search and retrieval: fetches jobs (evidence: `backend/routes/job_routes.py`)
- Job search and retrieval → SerpAPI: fetches listings (evidence: `backend/services/job_service.py`)
- Job search and retrieval → Job cache: reads and writes cache (evidence: `backend/services/job_service.py`)
- Job search and retrieval → Job skill extraction: extracts requirements (evidence: `README.md`)
- Job search and retrieval → Skill and fit matching: compares resume skills (evidence: `README.md`)
- Skill and fit matching → Fit explanations: informs fit insights (evidence: `README.md`)
- Job search and retrieval → Groq API: generates insights (evidence: `backend/services/job_service.py`)
- Fit explanations → Application email drafts: supports tailored drafts (evidence: `backend/services/job_service.py`)
- Job endpoint → Ranked opportunities: returns ranked matches (evidence: `README.md`)
- Resume and job UI → Ranked opportunities: displays results (evidence: `frontend/src/App.js`)
