Skip to content

SAMI-CODEAI/Controlled-AI-Resume-Personalization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Controlled AI Resume Personalization Platform

A MERN platform for generating job-specific resumes using AI with a strict zero-hallucination guarantee.


πŸš€ Overview

The Controlled AI Resume Personalization Platform is a highly engineered solution designed to solve the "hallucination" problem in AI-generated resumes. By implementing a Source-of-Truth Orchestration Layer, the platform ensures that every bullet point, skill, and achievement is semantically anchored to the user's verified career data, while being stylistically optimized for specific Job Descriptions (JDs).


πŸ› οΈ MERN Stack Implementation

This platform is built on the MERN (MongoDB, Express, React, Node) stack, with a focus on asynchronous orchestration and type-safe data handling.

πŸƒ MongoDB (Persistence Layer)

  • Career Data Vault: Stores structured, multi-dimensional data across several entities (Skills, Experiences, Projects, Achievements).
  • Generated Resumes: Implements versioning for LaTeX documents, allowing users to track refinements over time.
  • Mongoose ODM: Handles schema validation and provides a robust interface for data orchestration.

πŸš‚ Express.js (Orchestration Layer)

  • RESTful API: Clean separation of concerns across authentication, career data management, and AI services.
  • Middleware Architecture: Implements JWT-based route protection, global error handling, and file upload processing (Multer).
  • Zod Validation: Ensures strict input validation at the API boundary.

βš›οΈ React & Next.js (Experience Layer)

  • Next.js 14: Leverages App Router and Server Components for optimal performance and SEO.
  • Monaco Editor: Integrated Microsoft Monaco (VS Code core) for real-time, syntax-highlighted LaTeX source editing.
  • Live PDF Rendering: Uses react-pdf and pdfjs-dist for high-fidelity browser-side PDF previews.

🟒 Node.js (Runtime Layer)

  • AI Service Integration: Manages complex streams and JSON orchestration with OpenAI's GPT-4o models.
  • Async Orchestration: Handles multiple database lookups and AI completions concurrently to minimize latency.

πŸ€– AI Agent Orchestration

The platform employs specialized AI Agents to handle the heavy lifting of resume personalization and refinement.

1. Resume Personalization Agent

  • Role: Professional Resume Writer & Career Coach.
  • Logic:
    • Extraction: Dynamically parses the target LaTeX template for placeholders (e.g., %%SKILLS%%).
    • Matching: Analyzes the JD to select the most relevant items from the user's Career Data Vault.
    • Personalization: Rewrites content to align with JD keywords while strictly adhering to a Zero-Hallucination Policy.
  • Source-of-Truth Enforcement: The system prompt enforces that no new technology or experience can be created if it doesn't exist in the verified user data.

2. Refinement Agent

  • Role: Expert AI Assistant.
  • Logic: Operates on a feedback loop via an interactive chat interface.
  • Capability: Can interpret natural language requests (e.g., "Make my project description more impact-oriented") and re-generate the underlying LaTeX source code in real-time.

βš™οΈ System Architecture & Workflows

πŸ—οΈ Technical Architecture

graph TD
    subgraph Client
        User([User]) <--> Web[Next.js Frontend]
        Web <--> Monaco[Monaco Editor]
        Web <--> PDFView[PDF Previewer]
    end
    subgraph Backend_Services [Backend Services]
        Web <--> API[Express.js Node Backend]
        API <--> LLM[OpenAI GPT-4o Service]
        API <--> LaTeX[LaTeX Rendering Engine]
    end
    subgraph Data_Layer [Data Layer]
        API <--> DB[(MongoDB Atlas)]
    end
Loading

πŸ“Š Entity Relationship Diagram (ERD)

erDiagram
    USER ||--o{ EXPERIENCE : "has"
    USER ||--o{ PROJECT : "has"
    USER ||--o{ SKILL : "has"
    USER ||--o{ ACHIEVEMENT : "has"
    USER ||--o{ GENERATED_RESUME : "generates"
    GENERATED_RESUME }o--|| RESUME_TEMPLATE : "uses"
Loading

πŸ”„ Resume Generation Workflow

graph TD
    JD[Job Description Input] --> Agent[AI Generation Agent]
    Vault[(Career Data Vault)] --> Agent
    Template[LaTeX Template] --> Agent
    Agent --> Matcher{Match & Personalize}
    Matcher --> Valid[Source-of-Truth Validation]
    Valid --> XML[JSON-Section Mapping]
    XML --> LaTeX[LaTeX Sanitization]
    LaTeX --> DB[(Save to MongoDB)]
    DB --> PDF[Live PDF Rendering]
Loading

πŸ€– Agentic Implementation

The platform's intelligence is powered by a multi-agent system that utilizes a suite of specialized agentic tools to bridge the gap between AI-generated content and professional LaTeX typesetting.

🧩 Agentic Tools

  • LaTeX Sanitizer: A precision regex tool designed to identify and strip Unicode control characters (C0/C1) that typically crash standard LaTeX compilers.
  • Placeholder Parser: An automated analysis tool that dynamically scans LaTeX templates to map user data components to specific document sections.
  • Context Injector: A logic layer that orchestrates the retrieval of "Career Data Vault" entities and injects them into the agent's high-context system prompt.
  • PDFLaTeX Compiler: A hardware-level tool accessed via Node.js child_process to perform real-time validation and PDF generation.

βš™οΈ Orchestration & Collaboration

The system uses a State-Aware Orchestration pattern to manage agent interactions:

  1. State Persistence: All agent outputs and analysis (match scores, missing skills) are stored in MongoDB as a "Generated Resume" entity.
  2. Context Handover: The Refinement Agent inherits the full state of the Generation Agent, allowing it to understand the rationale behind specific content choices during the interactive chat.
  3. Iterative Feedback Loop: Agents collaborate with the user through a versioned history, where each chat message triggers a re-orchestration of the LaTeX source based on the previous "best" state.

πŸ›‘οΈ Hallucination Prevention & Sanitization

The platform implements several technical guardrails to ensure professional-grade output:

  1. Strict Prompt Engineering: The generation agent is governed by "Absolute Rules" that prioritize user data over stylistic fluff.
  2. LaTeX Sanitization: A dedicated layer strips out Unicode control characters and invisible tokens that typically crash pdflatex or cloud rendering engines.
  3. Dynamic Score Breakdown: Every generated resume receives a Match Score based on:
    • Skill Overlap: Direct technology matches.
    • Semantic Alignment: Relevancy of projects to the JD.
    • Keyword Density: Strategic placement of industry-standard terms.

πŸš€ Getting Started

Prerequisites

  • Node.js (v18+)
  • MongoDB (Running locally or on Atlas)
  • OpenAI API Key

Installation

  1. Clone & Install Core Dependencies:

    git clone https://github.com/your-repo/resume-platform.git
    cd resume-platform
  2. Configure Environment:

    • Create backend/.env (refer to .env.example).
    • Create frontend/.env (refer to .env.example).
  3. Start Services:

    • Backend: cd backend && npm install && npm run dev
    • Frontend: cd frontend && npm install && npm run dev
  4. Access App: Open http://localhost:3000


Developed for high-impact resume personalization.

About

A MERN stack application for matching resumes to job descriptions using AI-driven agents and LaTeX orchestration based on verified user career data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors