# sowmya-bh/resumeparser architecture

> Architecture diagram of the GitHub repository sowmya-bh/resumeparser, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sowmya-bh/resumeparser
- Repository: https://github.com/sowmya-bh/resumeparser

## Overview

#### Purpose and Entry Points
Job Scout + Resume ATS Agent matches a resume to indexed jobs, routes the user through selection and ATS review, then supports iterative revision and generated application materials. Primary entry points are the FastAPI app in `server.py`, interactive CLI in `run.py`, and static browser UI in `web/index.html`.

#### Orchestrated Agent Workflow
The LangGraph workflow is assembled in `agent/graph.py` over shared state from `agent/state.py`. It forks two independent first-stage tasks—job scouting and resume parsing—then joins them for matching. Two graph interrupts implement human gates: select a job, then review/revise results. The review branch can loop back to scoring or dispatch generation actions.

#### Retrieval, Resume Parsing, and Matching
`agent/nodes.py` implements graph stages: `scout`, `parser`, `match`, `select_job`, `ats_score`, `human_review`, and `extras`. Scouting reads the job index (`data/jobs_index.jsonl`, or sample `data/jobs_sample.jsonl`); parsing converts supplied text or supported documents into a working profile/resume. `agent/matcher.py` performs deterministic skill-overlap ranking for the retrieved job pool and distinguishes ranking from ATS scoring.

#### Scoring Boundary and Audit Controls
All ResumeHQ interaction is centralized in `agent/rq_tools.py`, which validates against a fixed tool registry, preserves raw scorer outputs, and writes append-only audit events. Scoring uses ResumeHQ’s `mcp_scorer` interfaces for ATS/HR scores, explanations, text extraction, and cover-letter support. The main process must not fabricate score data when the scorer is unavailable; errors remain explicit and audited.

#### API and HITL Control Plane
`server.py` exposes the UI-facing graph lifecycle: start a session, resume after job selection, and resume review actions such as adding information, uploading a revision, asking questions, generating materials, or finishing. It also exposes audit access. The frontend is intentionally build-free and delegates all stateful workflow execution to the API.

#### LLM and Generated Outputs
`agent/llm.py` wraps Gemini and provides fallback behavior when no API key is configured. It supports explanation and generation-oriented paths, while scored ATS/HR content remains grounded in ResumeHQ outputs. `agent/nodes.py` routes cover letters, tailored resumes, and interview-question actions through the extras stage using the final revised resume state.

#### Deployment Topology
The default app runtime is Python/FastAPI/LangGraph, packaged by `Dockerfile`. Lightweight production scoring can use ResumeHQ cloud with local fallback disabled. Heavy local ResumeHQ scoring is isolated behind HTTP in `scorer_service/app.py`, built separately by `scorer_service/Dockerfile`; `docker-compose.yml` connects the app to this sidecar under separate memory limits. `render.yaml` defines the equivalent public app/private scorer deployment split.

Main entry points: [`agent/graph.py`](https://github.com/sowmya-bh/resumeparser/blob/main/agent/graph.py) (LangGraph Workflow), [`agent/nodes.py`](https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py) (ATS Score & Review), [`agent/matcher.py`](https://github.com/sowmya-bh/resumeparser/blob/main/agent/matcher.py) (Skill-overlap Matcher), [`agent/rq_tools.py`](https://github.com/sowmya-bh/resumeparser/blob/main/agent/rq_tools.py) (ResumeHQ Tool Gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Interfaces"]
  node_browser["Static Browser UI<br/>frontend<br/>[index.html]"]
  node_cli["Interactive CLI<br/>[run.py]"]
end

subgraph group_workflow["Application Workflow"]
  node_api["FastAPI Lifecycle API<br/>[server.py]"]
  node_graph{{"LangGraph Workflow<br/>orchestrator<br/>[graph.py]"}}
  node_state["Shared Workflow State<br/>state model<br/>[state.py]"]
  node_scout["Job Scout<br/>graph stage<br/>[nodes.py]"]
  node_parser["Resume Parser<br/>graph stage<br/>[nodes.py]"]
  node_job_index[("Job Index<br/>JSONL data<br/>[jobs_index.jsonl]")]
  node_matcher["Skill-overlap Matcher<br/>ranking<br/>[matcher.py]"]
  node_selection(("Job Selection Gate<br/>human interrupt<br/>[nodes.py]"))
  node_ats_review(("ATS Score &amp; Review<br/>human interrupt<br/>[nodes.py]"))
  node_extras["Materials Generator<br/>graph stage<br/>[nodes.py]"]
  node_llm["Gemini Wrapper<br/>LLM adapter<br/>[llm.py]"]
end

subgraph group_scoring["Scoring Boundary"]
  node_rq_tools{{"ResumeHQ Tool Gateway<br/>scoring adapter<br/>[rq_tools.py]"}}
  node_resumehq["ResumeHQ Scorer<br/>external scoring"]
end

subgraph group_deployment["Deployment"]
  node_scorer_sidecar["Local Scorer Sidecar<br/>HTTP service<br/>[app.py]"]
  node_container_app["App Container<br/>container build"]
  node_container_scorer["Scorer Container<br/>container build"]
  node_compose["Compose Topology<br/>local deployment<br/>[docker-compose.yml]"]
  node_render["Render Deployment Split<br/>production deployment<br/>[render.yaml]"]
end

node_browser -->|"session and resume actions"| node_api
node_cli -->|"runs workflow"| node_graph
node_api -->|"starts and resumes"| node_graph
node_graph -->|"reads and updates"| node_state
node_graph -->|"parallel first stage"| node_scout
node_graph -->|"parallel first stage"| node_parser
node_scout -->|"reads jobs"| node_job_index
node_scout -->|"job pool"| node_matcher
node_parser -->|"resume profile"| node_matcher
node_matcher -->|"ranked matches"| node_selection
node_selection -->|"chosen job"| node_ats_review
node_ats_review -->|"ATS/HR scoring"| node_rq_tools
node_rq_tools -->|"registered scorer calls"| node_resumehq
node_ats_review -.->|"revision rescore"| node_matcher
node_ats_review -->|"generation actions"| node_extras
node_extras -->|"generation and explanations"| node_llm
node_rq_tools -.->|"local scoring option"| node_scorer_sidecar
node_container_app -->|"app image"| node_compose
node_container_scorer -->|"scorer image"| node_compose
node_compose -->|"runs sidecar"| node_scorer_sidecar
node_render -.->|"public app service"| node_api
node_render -.->|"private scorer service"| node_scorer_sidecar

click node_browser "https://github.com/sowmya-bh/resumeparser/blob/main/web/index.html"
click node_cli "https://github.com/sowmya-bh/resumeparser/blob/main/run.py"
click node_api "https://github.com/sowmya-bh/resumeparser/blob/main/server.py"
click node_graph "https://github.com/sowmya-bh/resumeparser/blob/main/agent/graph.py"
click node_state "https://github.com/sowmya-bh/resumeparser/blob/main/agent/state.py"
click node_scout "https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py"
click node_parser "https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py"
click node_job_index "https://github.com/sowmya-bh/resumeparser/blob/main/data/jobs_index.jsonl"
click node_matcher "https://github.com/sowmya-bh/resumeparser/blob/main/agent/matcher.py"
click node_selection "https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py"
click node_ats_review "https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py"
click node_extras "https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py"
click node_llm "https://github.com/sowmya-bh/resumeparser/blob/main/agent/llm.py"
click node_rq_tools "https://github.com/sowmya-bh/resumeparser/blob/main/agent/rq_tools.py"
click node_scorer_sidecar "https://github.com/sowmya-bh/resumeparser/blob/main/scorer_service/app.py"
click node_container_app "https://github.com/sowmya-bh/resumeparser/blob/main/Dockerfile"
click node_container_scorer "https://github.com/sowmya-bh/resumeparser/blob/main/scorer_service/Dockerfile"
click node_compose "https://github.com/sowmya-bh/resumeparser/blob/main/docker-compose.yml"
click node_render "https://github.com/sowmya-bh/resumeparser/blob/main/render.yaml"

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_browser,node_cli toneBlue
class node_api,node_graph,node_state,node_scout,node_parser,node_job_index,node_matcher,node_selection,node_ats_review,node_extras,node_llm toneAmber
class node_rq_tools,node_resumehq toneMint
class node_scorer_sidecar,node_container_app,node_container_scorer,node_compose,node_render toneRose
```

## Components

### User Interfaces

- [Static Browser UI](https://github.com/sowmya-bh/resumeparser/blob/main/web/index.html): frontend · Build-free UI for workflow interactions. · `web/index.html`
- [Interactive CLI](https://github.com/sowmya-bh/resumeparser/blob/main/run.py): cli · `run.py`

### Application Workflow

- [FastAPI Lifecycle API](https://github.com/sowmya-bh/resumeparser/blob/main/server.py): api · Starts sessions, resumes interrupts, and exposes audits. · `server.py`
- [LangGraph Workflow](https://github.com/sowmya-bh/resumeparser/blob/main/agent/graph.py): orchestrator · Forks scouting and parsing, then manages human gates. · `agent/graph.py`
- [Shared Workflow State](https://github.com/sowmya-bh/resumeparser/blob/main/agent/state.py): state model · `agent/state.py`
- [Job Scout](https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py): graph stage · `agent/nodes.py`
- [Resume Parser](https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py): graph stage · `agent/nodes.py`
- [Job Index](https://github.com/sowmya-bh/resumeparser/blob/main/data/jobs_index.jsonl): JSONL data · Primary indexed jobs, with a sample alternative. · `data/jobs_index.jsonl`
- [Skill-overlap Matcher](https://github.com/sowmya-bh/resumeparser/blob/main/agent/matcher.py): ranking · Deterministically ranks retrieved jobs before ATS scoring. · `agent/matcher.py`
- [Job Selection Gate](https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py): human interrupt · `agent/nodes.py`
- [ATS Score & Review](https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py): human interrupt · Scores the selected job and accepts revision decisions. · `agent/nodes.py`
- [Materials Generator](https://github.com/sowmya-bh/resumeparser/blob/main/agent/nodes.py): graph stage · Creates cover letters, tailored resumes, and interview questions. · `agent/nodes.py`
- [Gemini Wrapper](https://github.com/sowmya-bh/resumeparser/blob/main/agent/llm.py): LLM adapter · Provides explanation and generation fallback behavior. · `agent/llm.py`

### Scoring Boundary

- [ResumeHQ Tool Gateway](https://github.com/sowmya-bh/resumeparser/blob/main/agent/rq_tools.py): scoring adapter · Validates tools, preserves raw outputs, and appends audits. · `agent/rq_tools.py`
- **ResumeHQ Scorer**: external scoring · Provides ATS/HR scores, extraction, explanations, and cover-letter support.

### Deployment

- [Local Scorer Sidecar](https://github.com/sowmya-bh/resumeparser/blob/main/scorer_service/app.py): HTTP service · Isolated heavy local ResumeHQ scoring runtime. · `scorer_service/app.py`
- [App Container](https://github.com/sowmya-bh/resumeparser/blob/main/Dockerfile): container build · `Dockerfile`
- [Scorer Container](https://github.com/sowmya-bh/resumeparser/blob/main/scorer_service/Dockerfile): container build · `scorer_service/Dockerfile`
- [Compose Topology](https://github.com/sowmya-bh/resumeparser/blob/main/docker-compose.yml): local deployment · Connects app and scorer with separate memory limits. · `docker-compose.yml`
- [Render Deployment Split](https://github.com/sowmya-bh/resumeparser/blob/main/render.yaml): production deployment · Defines public app and private scorer services. · `render.yaml`

## Connections

- Static Browser UI → FastAPI Lifecycle API: session and resume actions
- Interactive CLI → LangGraph Workflow: runs workflow
- FastAPI Lifecycle API → LangGraph Workflow: starts and resumes
- LangGraph Workflow → Shared Workflow State: reads and updates
- LangGraph Workflow → Job Scout: parallel first stage
- LangGraph Workflow → Resume Parser: parallel first stage
- Job Scout → Job Index: reads jobs
- Job Scout → Skill-overlap Matcher: job pool
- Resume Parser → Skill-overlap Matcher: resume profile
- Skill-overlap Matcher → Job Selection Gate: ranked matches
- Job Selection Gate → ATS Score & Review: chosen job
- ATS Score & Review → ResumeHQ Tool Gateway: ATS/HR scoring
- ResumeHQ Tool Gateway → ResumeHQ Scorer: registered scorer calls
- ATS Score & Review → Skill-overlap Matcher: revision rescore
- ATS Score & Review → Materials Generator: generation actions
- Materials Generator → Gemini Wrapper: generation and explanations
- ResumeHQ Tool Gateway → Local Scorer Sidecar: local scoring option
- App Container → Compose Topology: app image
- Scorer Container → Compose Topology: scorer image
- Compose Topology → Local Scorer Sidecar: runs sidecar
- Render Deployment Split → FastAPI Lifecycle API: public app service
- Render Deployment Split → Local Scorer Sidecar: private scorer service
