# manishgaurav24/resume_poc architecture

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

- Interactive diagram: https://gitdiagram.com/manishgaurav24/resume_poc
- Repository: https://github.com/manishgaurav24/resume_poc

## Overview

##### Project type and purpose
- This is an **Agentic AI–based document transformation tool** (open-source engine) that accepts arbitrary PDF resumes, extracts structured data, normalizes and maps it to a fixed JSON schema, and finally renders a pixel-perfect Exavalu-style PDF.
- It uses a **LangGraph** workflow of discrete “agents” (extract, normalize, map, render).

##### File structure
- Top-level:
- main.py & graph.py – entry point & DAG definition
- agents/ – four single-responsibility Python modules (extract_agent.py, normalize_agent.py, map_agent.py, render_agent.py)
- render/ – template code (exavalu_template.py) + static assets (logo, watermark)
- utils/ – shared helpers (gemini_utils.py, pdf_utils.py, path_utils.py)
- resumes/ – input PDFs
- Raw_Json/ & Modified_Resumes/ – generated JSON and output PDFs
- Configuration: pyproject.toml, .python-version, .gitignore, .env

##### README for additional insights
- It defines a **4-stage pipeline**:
1) EXTRACT_AGENT: hybrid extraction (PyPDF + Gemini API)
2) NORMALIZE_AGENT: cleans & merges raw data
3) MAP_AGENT: dynamic JSON → fixed Exavalu schema (schemas/*.json)
4) RENDER_AGENT: ReportLab PDF generation with layout rules
- It also mentions fallback logic if Gemini quota is exceeded.

a. Main components (use rectangular nodes):
- Input Storage: “resumes/” (PDF files)
- Orchestrator: LangGraph engine (graph.py)
- Agents:
- Extract Agent (extract_agent.py)
- Normalize Agent (normalize_agent.py)
- Agent (map_agent.py)
- Render Agent (render_agent.py)
- Schemas: dynamic_resume.schema.json, exavalu_fixed.schema.json
- Template & Assets: exavalu_template.py + logo/watermark
- Output Storage: Raw_Json/ (JSON) & Modified_Resumes/ (PDF)
- External Service: Google Gemini API
resumes/ → (PDF stream) → EXTRACT_AGENT → produces raw JSON → Raw_Json/
Raw_Json/ → NORMALIZE_AGENT → normalized JSON → (in-memory)
normalized JSON → MAP_AGENT → fixed-schema JSON
fixed-schema JSON + exavalu_template → RENDER_AGENT → output PDF → Modified_Resumes/
c. Architectural patterns & design principles:
- **Agentic pipeline**: single-responsibility nodes
- **Modular utils** for PDF & path operations
- **Schema-driven mapping** for data validation
- **Graceful degradation** (Gemini → PyPDF)
d. Technologies & frameworks:
- LangGraph (workflow orchestrator)
- Google Gemini 2.5 Flash (multimodal extraction)
- PyPDF (text extraction fallback)
- ReportLab (PDF rendering)
- Python (.env for API keys, uv for dependency management)

##### Detail
- Every folder/component (utils, render/assets, schemas)
- LangGraph orchestration layer as a central spine
- Modules (gemini_utils.py, pdf_utils.py) to show where specialized logic resides

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Storage Layer"
        Resumes["resumes/ (PDF)"]:::storage
        RawJson["Raw_Json/ (JSON)"]:::storage
        ModifiedResumes["Modified_Resumes/ (PDF)"]:::storage
    end

    subgraph "Orchestrator"
        Orchestrator["LangGraph Orchestrator\n(graph.py / main.py)"]:::orchestrator
    end

    subgraph "Agents Layer"
        Extract["EXTRACT_AGENT\n(agents/extract_agent.py)"]:::agent
        Normalize["NORMALIZE_AGENT\n(agents/normalize_agent.py)"]:::agent
        Map["MAP_AGENT\n(agents/map_agent.py)"]:::agent
        RenderAgent["RENDER_AGENT\n(agents/render_agent.py)"]:::agent
    end

    subgraph "Schemas"
        DynamicSchema["dynamic_resume.schema.json"]:::schema
        ExavaluSchema["exavalu_fixed.schema.json"]:::schema
    end

    subgraph "Templates & Assets"
        Template["exavalu_template.py"]:::template
        Assets["assets/ (logo, watermark)"]:::template
    end

    subgraph "Utilities"
        GeminiUtils["gemini_utils.py"]:::util
        PdfUtils["pdf_utils.py"]:::util
        PathUtils["path_utils.py"]:::util
    end

    External["Google Gemini API"]:::external

    Resumes -->|PDF stream| Extract
    Extract -->|raw JSON| RawJson
    RawJson -->|input| Normalize
    Normalize -->|normalized JSON| Map
    Map -->|fixed-schema JSON| RenderAgent
    Template --> RenderAgent
    Assets --> RenderAgent
    RenderAgent -->|PDF| ModifiedResumes

    Extract -->|extract via Gemini| External
    Extract -.fallback to PyPDF.- PdfUtils

    Orchestrator --> Extract
    Orchestrator --> Normalize
    Orchestrator --> Map
    Orchestrator --> RenderAgent
    Orchestrator --> PathUtils

    Extract --> GeminiUtils
    Extract --> PdfUtils
    Extract --> PathUtils
    Normalize --> PathUtils
    Map --> PathUtils
    RenderAgent --> PathUtils

    click Resumes "https://github.com/manishgaurav24/resume_poc/blob/main/resumes/Manish-Gaurav-Resume-AI.pdf"
    click Orchestrator "https://github.com/manishgaurav24/resume_poc/blob/main/graph.py"
    click Orchestrator "https://github.com/manishgaurav24/resume_poc/blob/main/main.py"
    click Extract "https://github.com/manishgaurav24/resume_poc/blob/main/agents/extract_agent.py"
    click Normalize "https://github.com/manishgaurav24/resume_poc/blob/main/agents/normalize_agent.py"
    click Map "https://github.com/manishgaurav24/resume_poc/blob/main/agents/map_agent.py"
    click RenderAgent "https://github.com/manishgaurav24/resume_poc/blob/main/agents/render_agent.py"
    click DynamicSchema "https://github.com/manishgaurav24/resume_poc/blob/main/schemas/dynamic_resume.schema.json"
    click ExavaluSchema "https://github.com/manishgaurav24/resume_poc/blob/main/schemas/exavalu_fixed.schema.json"
    click Template "https://github.com/manishgaurav24/resume_poc/blob/main/render/exavalu_template.py"
    click Assets "https://github.com/manishgaurav24/resume_poc/tree/main/render/assets/"
    click RawJson "https://github.com/manishgaurav24/resume_poc/blob/main/Raw_Json/Manish-Gaurav-Resume-AI.pdf.json"
    click ModifiedResumes "https://github.com/manishgaurav24/resume_poc/blob/main/Modified_Resumes/EXAVALU_Manish-Gaurav-Resume-AI.pdf"
    click GeminiUtils "https://github.com/manishgaurav24/resume_poc/blob/main/utils/gemini_utils.py"
    click PdfUtils "https://github.com/manishgaurav24/resume_poc/blob/main/utils/pdf_utils.py"
    click PathUtils "https://github.com/manishgaurav24/resume_poc/blob/main/utils/path_utils.py"

    classDef storage fill:#D3D3D3,stroke:#333,stroke-width:1px,shape:cylinder
    classDef orchestrator fill:#B19CD9,stroke:#333,stroke-width:1px
    classDef agent fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef schema fill:#FFC0CB,stroke:#333,stroke-width:1px
    classDef template fill:#FFD700,stroke:#333,stroke-width:1px
    classDef util fill:#FFFACD,stroke:#333,stroke-width:1px
    classDef external fill:#98FB98,stroke:#333,stroke-width:1px,shape:cloud
```
