TalentSync

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

Prompt engineering system

The prompt engineering system powering TalentSync’s AI-driven talent tools.

Repository layout#

The prompt system is organized under a dedicated module that exposes reusable templates and builders. Services orchestrate LLM calls, inject parameters, and validate outputs.

Building blocks#

  • Template registry and exports: Centralized exports of prompt templates and builders for reuse across services.
  • LLM factory: Provider-agnostic creation of chat models with temperature support and fallbacks.
  • Task-specific prompt libraries:
  • Detailed resume parsing and structuring
  • Resume improvement with truthfulness rules and keyword alignment
  • Resume enrichment via guided questioning and iterative refinement
  • ATS analysis scoring and recommendations
  • Interview question and answer evaluation
  • Cold email generation
  • JD-targeted resume editing
  • Code review prompting

How it fits together#

The system composes LangChain prompt templates with LLM instances to produce structured outputs for each feature. Services sanitize inputs, inject parameters, and validate outputs against Pydantic models.

Structured resume analysis#

  • Purpose: Convert raw resume text into a structured JSON aligned with UI models.
  • Pattern: PromptTemplate with explicit schema and instructions; chained with an LLM.
  • Validation: Pydantic model validates and normalizes output.

Resume improvement and truthfulness#

  • Purpose: Tailor resumes to job descriptions while preserving truthfulness.
  • Pattern: Multiple prompt variants (nudge, keywords, full) with critical truthfulness rules injected.
  • Validation: Post-processing checks for truncation and Pydantic validation.

Resume enrichment via guided questioning#

  • Purpose: Identify weak spots and generate targeted questions; iteratively refine enhancements.
  • Pattern: Analyze → Generate questions → Improve/add bullets → Apply to resume.
  • Validation: Strict formatting and safety checks; safe application by item identifiers.

ATS optimization and scoring#

  • Purpose: Score resume-JD alignment, detect missing keywords, and provide recommendations.
  • Pattern: PromptTemplate with scoring rubrics; service normalizes outputs to a consistent response model.

Interview preparation tools#

  • Question Generation: ChatPromptTemplate with system + human messages; returns structured question metadata.
  • Answer Evaluation: Structured scoring and feedback with streaming-friendly alternatives.

Communication tools: cold email generation#

  • Purpose: Generate personalized cold emails with subject/body in a structured JSON format.
  • Pattern: PromptTemplate with resume and contextual fields; service builds chain and invokes LLM.

JD-Targeted resume editing#

  • Purpose: Extract JD keywords, score resume alignment, edit to match JD while preserving facts, and compute changes.
  • Pattern: Multiple specialized prompts with consistent truthfulness constraints.

Code review prompting#

  • Purpose: Evaluate code submissions with structured scoring and feedback; supports streaming and non-streaming modes.
  • Pattern: ChatPromptTemplate with system + human messages and JSON output instructions.

Dependencies#

  • Prompt templates depend on LangChain’s PromptTemplate or ChatPromptTemplate.
  • Services depend on prompt templates and LLM factories.
  • Validation depends on Pydantic models defined in prompt templates and service schemas.

Performance#

  • Token limits: Many prompts set generous max token budgets; tune based on expected output sizes.
  • Streaming vs. non-streaming: Prefer streaming for interactive UX; non-streaming for strict JSON parsing.
  • Provider temperature: Respect provider-specific constraints; avoid temperature for certain models.
  • Retry and fallback: Implement retry with exponential backoff and provider fallbacks.
  • Caching: Cache repeated prompts with identical parameters; invalidate on prompt updates.
  • Batch processing: For bulk operations, batch prompts and deduplicate repeated contexts.

Troubleshooting#

  • Empty or truncated outputs: Validate required sections and log warnings for missing fields.
  • JSON parsing failures: Ensure system prompts enforce JSON-only outputs; normalize LLM responses.
  • Injection risks: Sanitize user inputs to prevent prompt injection; redact suspicious patterns.
  • Validation errors: Catch Pydantic validation errors and return structured error responses.
  • Provider misconfiguration: Verify API keys and base URLs; handle initialization failures gracefully.