TalentSync

AI resume builder and ATS optimizer for job seekers. Tailored resumes, outreach, and interview prep from one profile.

Resume analysis engine

Turns resume files into structured data: parse, clean, NLP extract, validate, and emit schemas used by ATS scoring, recommendations, and PDF generation. Formats: TXT, MD, PDF, DOC/DOCX.

Key capabilities:

  • Multi-format document ingestion and conversion
  • Text formatting and cleaning via LLM
  • Structured data extraction using JSON-parsing prompts
  • Detailed analysis including skills, experiences, projects, and recommendations
  • Frontend components for preview, PDF processing, and analysis display
  • Data models for resume storage and enrichment history

Repository layout#

The Resume Analysis Engine spans backend APIs, services, prompts, and frontend components:

Building blocks#

  • Routes: Expose endpoints for resume upload, detailed analysis, and format-and-analyze workflows.
  • Services: Implement the processing pipeline, including document conversion, text formatting, JSON extraction, and validation.
  • Prompts: Define structured prompts for text formatting, JSON extraction, and detailed analysis.
  • Models: Define typed schemas for structured outputs and API responses.
  • Frontend: Provide upload, preview, and PDF generation UI components.

How it fits together#

The system follows a layered architecture:

  • Presentation Layer: FastAPI routes expose endpoints for file uploads and text-based analysis.
  • Application Layer: Services orchestrate document processing, LLM interactions, and data validation.
  • Data Layer: Typed schemas define the structure of extracted and enriched data.
  • Frontend Layer: React components handle user interactions, previews, and PDF generation.

Backend routes#

  • File-based analysis endpoint: Accepts uploaded files, processes them, formats text if needed, validates content, extracts structured JSON, and returns a typed response.
  • Detailed analysis endpoint: Performs a full analysis and returns a structured dataset.
  • Format-and-analyze endpoint: Converts raw text to a standardized format and returns analysis results.
  • Text-based analysis endpoint: Accepts pre-formatted text and returns detailed analysis.

Document processing pipeline#

  • Supports TXT, MD, PDF, DOC/DOCX.
  • Uses PyMuPDF to convert to Markdown for consistent parsing.
  • Includes a fallback conversion using Google GenAI for PDFs when configured.
  • Validates resume presence of key sections using heuristics.

LLM integration and JSON extraction#

  • Text formatting: Uses a dedicated chain to normalize resume text.
  • JSON extraction: Parses LLM responses to ensure valid dictionaries.
  • Detailed analysis: Builds a unified analysis dictionary with skills, experiences, projects, and recommendations.
  • Fallbacks: Reliable JSON parsing handles fenced blocks, standalone JSON, and extracted substrings.

Detailed analysis and structured output#

  • Detailed analysis returns a rich dataset including skills, languages, education, work experience, projects, certifications, achievements, and recommended roles.
  • Portfolio links are normalized from various field aliases.
  • Validation checks inputs and returns meaningful error messages.

Frontend components for resume preview, PDF processing, and analysis display#

  • Upload Component: Handles file selection and submission to backend.
  • Resume Service: Manages API calls for analysis and retrieval.
  • Types: Define TypeScript interfaces for resume data structures.
  • PDF Tools: Provide preview, configuration, tailoring, export, and LaTeX output components.

Data models for resume storage, analysis results, and enrichment history#

  • Prisma Schema: Defines database models for resumes, analysis results, and enrichment history.
  • Resume Data Interfaces: TypeScript interfaces mirror backend schemas for frontend consumption.

Note: The Prisma schema file path is referenced below for completeness; consult the file for precise model definitions.

Dependencies#

The system splits work by layer:

  • Routes depend on Services for processing logic.
  • Services depend on Prompts and LLM helpers for text formatting and JSON extraction.
  • Models provide type safety for responses and internal structures.
  • Frontend depends on backend services and shared types.

Performance#

  • Document conversion: Prefer native text formats (TXT/MD) to avoid heavy conversions.
  • LLM calls: Batch operations where possible; cache formatted text and validated JSON to reduce redundant processing.
  • Large documents: Implement pagination for lists (work experience, projects) and filter empty/low-quality entries early.
  • Rate limiting: Handle LLM rate limits gracefully by falling back to original text and retrying later.
  • Memory: Stream file reads/writes and remove temporary files promptly after processing.

Troubleshooting#

Common issues:

  • Unsupported file type: Ensure the file extension is one of TXT, MD, PDF, DOC/DOCX.
  • Empty or invalid resume text: Verify the document contains recognized resume keywords or sections.
  • LLM errors: Check authentication and rate limits; the system falls back to original text when appropriate.
  • JSON parsing failures: The system attempts multiple strategies to extract valid JSON; if all fail, returns an empty dictionary.

Appendix#

Implementation examples#

  • Resume upload and analysis:

  • Endpoint: POST /resume/analysis

  • Behavior: Processes file, formats text if needed, extracts structured JSON, validates, filters lists, and returns a typed response.

  • Reference: analyze_resume_service

  • Detailed analysis:

  • Endpoint: POST /resume/detailed/analysis/

  • Behavior: Validates resume content, performs detailed analysis, normalizes portfolio links, and returns structured data.

  • Reference: comprehensive_resume_analysis_service

  • Format-and-analyze:

  • Endpoint: POST /resume/format-and-analyze

  • Behavior: Converts raw text to Markdown, formats and analyzes, normalizes portfolio links, and returns cleaned text and analysis.

  • Reference: format_and_analyze_resume_service

  • Text-based analysis:

  • Endpoint: POST /resume/analysis (text-based)

  • Behavior: Accepts formatted text, performs detailed analysis, and returns structured data.

  • Reference: analyze_resume_v2_service

  • Frontend integration:

  • Upload component: upload-resume.tsx

  • Service: resume.service.ts

  • Types: resume.ts

  • Data models:

  • Backend schemas: schemas.py

  • Prisma schema: schema.prisma