kuldeep
back to all writing
Jun 2026 · 7 min read
ai + saasai systems & document engineering

Inside Resuvee: Engineering an AI ATS Resume Suite with Groq

Sub-second ATS resume audit engine combining deterministic heuristic calibration with Groq LPU inference, client-side PDF.js extraction, and loss-free DOCX roundtrip architecture.

AI Latency

< 600ms

Inference Engine

Groq LPU

PDF Extraction

Client-Side PDF.js

DOCX Roundtrip

100% Loss-Free XML

view repository ↗live demo ↗#Next.js 16#Groq AI#Supabase#IndexedDB#DOCX XML#TypeScript#Zustand

1. The Serverless Trap: Client-Side PDF Extraction vs Payload Bloat

A major architectural blunder in early resume analyzers is routing binary PDF and Word documents through serverless API endpoints. A resume containing high-resolution graphics can easily weigh 5MB to 10MB. Streaming multi-megabyte binaries through ephemeral Node.js functions triggers memory bloat, payload size limits, and cold-start execution delays.

For Resuvee, we shifted document extraction to the browser edge. Using pdfjs-dist directly on the client, text layers and structural coordinates are extracted in-memory with zero external upload latency. Our serverless /api/analyze route only receives pre-extracted, normalized strings — shrinking payload transfers from 8MB to under 4KB and ensuring user documents never leave the browser unencrypted.

Client-side extraction eliminates 99% of file payload overhead and keeps serverless routes stateless and instantaneous.

2. Groq LPU Integration: High-Speed Inference & Resilient JSON Extraction

To deliver real-time feedback, Resuvee connects to Groq's high-speed Language Processing Units (LPUs) via the OpenAI-compatible SDK endpoint (https://api.groq.com/openai/v1), utilizing high-throughput models such as openai/gpt-oss-120b and Llama 3.3.

Because cutting-edge reasoning models may output chain-of-thought tokens (<think>...</think>) or markdown commentary alongside structured objects, standard JSON.parse() calls frequently break. We implemented a depth-tracking balanced-brace parser (extractJson) that strips thought tags and isolates valid JSON payloads with 100% reliability. Additionally, an in-memory SHA-256 cache avoids redundant LLM queries when re-analyzing identical resumes.

src/modules/analyzer/services/ai-analyzer.ts
1import OpenAI from "openai";
2import { getGroqModel } from "@/shared/lib/groq-model";
3import { auditResumeText } from "./resume-evidence";
4
5export async function analyzeResume(resumeText: string): Promise<ResumeAnalysis> {
6 const normalizedResume = normalizeResumeText(resumeText);
7 const audit = auditResumeText(normalizedResume);
8
9 const client = new OpenAI({
10 apiKey: process.env.GROQ_API_KEY,
11 baseURL: "https://api.groq.com/openai/v1",
12 timeout: 180000,
13 maxRetries: 3,
14 });
15
16 const completion = await client.chat.completions.create({
17 model: getGroqModel(), // defaults to "openai/gpt-oss-120b"
18 reasoning_effort: "low",
19 messages: [
20 { role: "system", content: SYSTEM_PROMPT },
21 {
22 role: "user",
23 content: `Document checks: ${JSON.stringify(audit.facts)}\nReview this resume and return only the requested JSON:\n\n${trimmedResume}`,
24 },
25 ],
26 temperature: 0.05,
27 top_p: 0.85,
28 response_format: { type: "json_object" },
29 });
30
31 return JSON.parse(extractJson(completion.choices[0]?.message?.content ?? "{}"));
32}

📌 Key Engineering Takeaways:

  • Connecting through Groq's LPU infrastructure guarantees sub-600ms token generation.
  • Balanced-brace depth parsing strips out reasoning tokens and guarantees robust JSON extraction.
  • SHA-256 fingerprint caching prevents duplicate API billing on repeated audits.

3. Anchoring LLM Hallucinations: Heuristic Calibration (resume-evidence.ts)

The greatest danger of unconstrained LLM grading is hallucination: asking an LLM to score a resume thrice often returns three wildly divergent ratings. To build genuine trust with job seekers, Resuvee anchors semantic analysis with a deterministic evidence audit layer.

Before the LLM prompt is even assembled, resume-evidence.ts inspects the document using strict deterministic regex rules: it verifies standard section headings (summary, experience, projects, education, certs), counts quantified impact metrics (percentages, revenue figures, multipliers), and audits action verbs against a dictionary of 150+ high-impact verbs. These verified facts are passed into the prompt as rigid constraints that the LLM cannot override.

Never rely purely on LLM vibes for critical scores — anchor evaluation with deterministic, rule-based evidence.

4. Loss-Free DOCX Roundtripping via Custom XML Metadata

Most resume builders suffer from a fatal flaw: exporting to Microsoft Word (.docx) produces flattened text that cannot be re-imported into the builder without losing styling, layout data, and field boundaries.

Resuvee solved this with custom OpenXML packaging. When exporting via docx 9.7, we serialize the complete structured JSON resume state and embed it as custom document properties (ResulyraResumeData / ResulyraResumeSchema) inside the docProps/custom.xml archive. When re-importing, jszip inspects this archive and hydrates the studio state with 100% loss-free precision, while falling back to heuristic parsing for generic Word resumes.

src/modules/resume/utils/docx-resume-metadata.ts
1export const DOCX_RESUME_DATA_PROPERTY = "ResulyraResumeData";
2export const DOCX_RESUME_SCHEMA_PROPERTY = "ResulyraResumeSchema";
3export const DOCX_RESUME_SCHEMA_VERSION = 1;
4
5export function createDocxResumePayload(data: ResumeData) {
6 return JSON.stringify({ version: DOCX_RESUME_SCHEMA_VERSION, data });
7}
8
9// When re-importing, jszip inspects custom.xml to unpack pristine JSON
10export async function extractEmbeddedDocxPayload(buffer: Buffer): Promise<ResumeData | null> {
11 const zip = await JSZip.loadAsync(buffer);
12 const customXml = await zip.file("docProps/custom.xml")?.async("string");
13 return customXml ? parseCustomProperties(customXml) : null;
14}

5. Dual-Persistence Studio Architecture: IndexedDB + Supabase RLS

The Resuvee Studio features 16 original copyright-safe templates, an interactive on-canvas formatting bar (font scaling A-/A+, alignment, custom color wheel swatches), and smart multi-page pagination that dynamically distributes sections across A4 continuation sheets.

To guarantee zero work loss, we engineered a dual-persistence architecture. Every edit is saved locally to dedicated IndexedDB key-value stores (resuvee_resume_db and resuvee_cover_letter_db) asynchronously off the main thread. When users sign in, changes automatically synchronize to Supabase PostgreSQL protected by Row Level Security (RLS) policies and SSR cookie sessions.

📌 Key Engineering Takeaways:

  • IndexedDB ensures lightning-fast offline draft recovery without localStorage 5MB quotas.
  • Embedded OpenXML properties enable loss-free roundtrip editing between Word and web.
  • Heuristic document evidence audits keep AI scoring consistent, fair, and actionable.

— Kuldeep Rajput ✌️

Software Developer · building ambitious full-stack web apps