The system follows a carefully designed pipeline with isolated stages to prevent fabrication: ## System Architecture Overview The system uses a pipeline of isolated analysis and generation steps: 1. **Stage 1: Isolated Analysis** (three sub-stages) - **1A: Job Analysis** - Extracts requirements from job description only - **1B: Candidate Analysis** - Catalogs qualifications from resume/context only - **1C: Mapping Analysis** - Identifies legitimate matches between requirements and qualifications 2. **Stage 2: Resume Generation** - Uses mapping output to create a tailored resume with evidence-based content 3. **Stage 3: Verification** - Performs fact-checking to catch any remaining fabrications ```mermaid flowchart TD subgraph "Stage 1: Isolated Analysis" subgraph "Stage 1A: Job Analysis" A1[Job Description Input] --> A2[Job Analysis LLM] A2 --> A3[Job Requirements JSON] end subgraph "Stage 1B: Candidate Analysis" B1[Resume & Context Input] --> B2[Candidate Analysis LLM] B2 --> B3[Candidate Qualifications JSON] end subgraph "Stage 1C: Mapping Analysis" C1[Job Requirements JSON] --> C2[Candidate Qualifications JSON] C2 --> C3[Mapping Analysis LLM] C3 --> C4[Skills Mapping JSON] end end subgraph "Stage 2: Resume Generation" D1[Skills Mapping JSON] --> D2[Original Resume Reference] D2 --> D3[Resume Generation LLM] D3 --> D4[Tailored Resume Draft] end subgraph "Stage 3: Verification" E1[Skills Mapping JSON] --> E2[Original Materials] E2 --> E3[Tailored Resume Draft] E3 --> E4[Verification LLM] E4 --> E5{Verification Check} E5 -->|PASS| E6[Approved Resume] E5 -->|FAIL| E7[Correction Instructions] E7 --> D3 end A3 --> C1 B3 --> C2 C4 --> D1 D4 --> E3 style A2 fill:#f9d77e,stroke:#333,stroke-width:2px style B2 fill:#f9d77e,stroke:#333,stroke-width:2px style C3 fill:#f9d77e,stroke:#333,stroke-width:2px style D3 fill:#f9d77e,stroke:#333,stroke-width:2px style E4 fill:#f9d77e,stroke:#333,stroke-width:2px style E5 fill:#a3e4d7,stroke:#333,stroke-width:2px style E6 fill:#aed6f1,stroke:#333,stroke-width:2px style E7 fill:#f5b7b1,stroke:#333,stroke-width:2px ``` ## Stage 1: Isolated Analysis (three separate sub-stages) 1. **Job Analysis**: Extracts requirements from just the job description 2. **Candidate Analysis**: Catalogs qualifications from just the resume/context 3. **Mapping Analysis**: Identifies legitimate matches between requirements and qualifications ## Stage 2: Resume Generation Creates a tailored resume using only verified information from the mapping ## Stage 3: Verification 1. Performs fact-checking to catch any remaining fabrications 2. Corrects issues if needed and re-verifies ### Key Anti-Fabrication Mechanisms The system uses several techniques to prevent fabrication: * **Isolation of Analysis Stages**: By analyzing the job and candidate separately, the system prevents the LLM from prematurely creating connections that might lead to fabrication. * **Evidence Requirements**: Each qualification included must have explicit evidence from the original materials. * **Conservative Transferability**: The system is instructed to be conservative when claiming skills are transferable. * **Verification Layer**: A dedicated verification step acts as a safety check to catch any remaining fabrications. * **Strict JSON Structures**: Using structured JSON formats ensures information flows properly between stages. ## Implementation Details * **Prompt Engineering**: Each stage has carefully designed prompts with clear instructions and output formats. * **Error Handling**: Comprehensive validation and error handling throughout the pipeline. * **Correction Loop**: If verification fails, the system attempts to correct issues and re-verify. * **Traceability**: Information in the final resume can be traced back to specific evidence in the original materials.