Inspiration

I kept seeing the same story in job search threads: people applying to hundreds of roles with AI tools, getting silence or rejections, and never knowing where they were failing. Resume? ATS keywords? Phone screen? Final round?

Every product I found optimized for volume — more applications, faster cover letters. None of them connected rejection history into a single diagnosis. I wanted an agent that reads your actual pipeline in a database, spots the pattern, and tells you what to fix next.

That became RetrofitAI: a career agent built around one idea — diagnose before you apply harder.


What it does

RetrofitAI is an AI career agent that detects why your job search is failing by analyzing patterns across your MongoDB data — then rebuilds your strategy in real time.

Six core flows:

  1. Intake interview — conversational onboarding; profile saved to career_profiles
  2. Job analyzer — paste a JD → match score, skill gaps, ATS keywords, verdict, cover letter → job_analyses
  3. Rejection intelligence — after 3+ rejections, classifies whether you're losing pre-interview, post-interview, or at the final round → rejection_patterns
  4. Proactive follow-up — on return visits, surfaces stale applications and drafts follow-up emails for approval
  5. Pipeline tracking — kanban-style application status with drag-and-drop
  6. Weekly briefing + PDF — momentum score, response rate vs. industry benchmark, priority actions

The agent doesn't just chat — it reads and writes your data through MongoDB MCP tools while Gemini reasons over live context. Users approve sensitive actions (follow-ups, pattern insights, briefings) before anything is committed.

Live demo: frontend-six-sigma-45.vercel.app


How we built it

Frontend: React 18 + TypeScript + Vite, Tailwind CSS, shadcn/ui, Recharts. Deployed on Vercel with /api/* proxied to Cloud Run.

Backend: Node.js + Express on Google Cloud Run. Anonymous sessions via express-session + connect-mongo.

AI: Gemini 2.5 Flash via Vertex AI (@google-cloud/vertexai). Each agent mode (NEW_USERPROFILE_COMPLETEACTIVE_SEARCHPATTERN_DETECTED) routes to a dedicated function in geminiService.js.

MongoDB: Atlas M0 cluster with five collections — career_profiles, job_analyses, applications, rejection_patterns, weekly_briefings — plus agent_drafts and agent_runs for the autonomous pipeline.

MCP integration: The official @mongodb-js/mongodb-mcp-server runs as a stdio child process. Gemini's tool-call loop invokes find, insert-one, update-one, and aggregate through MCP — visible live in the MongoDB MCP panel on the right side of the UI.

Agent Builder: Dialogflow CX detectIntent endpoint wired for Agent Builder compliance.

Architecture in one line:

Browser → Vercel → Cloud Run → Gemini (Vertex AI) ↔ MCP Server ↔ MongoDB Atlas

Autonomous pipeline: On onboarding complete (not every page refresh), the agent scans applications, drafts follow-ups for stale apps, queues pattern/briefing drafts for approval, and logs the run. Momentum scoring compares your response rate to a 15% industry baseline:

$$\text{momentumScore} = f\left(\frac{|\text{responded}|}{|\text{applications}|},\ \text{trend},\ \text{stale count}\right)$$


Challenges we ran into

1. MCP + Mongoose dual writes
Early on, some routes wrote via Mongoose while the agent loop wrote via MCP. Data could diverge between collections. I merged reads through mongoService.js helpers that prefer Mongoose but backfill from MCP, and mirrored critical writes both ways.

2. Duplicate follow-up drafts on every refresh
The autonomous pipeline ran on every sessionInit, recreating the same follow-up draft for stale applications each time the user landed on the main screen. Fix: load existing drafts on init only; run the pipeline once after onboarding; dedupe pending drafts by applicationId; add a 20-minute cooldown between pipeline runs.

3. Production-only UI bugs
The skill-gap radar chart rendered empty on Vercel but worked locally — ResponsiveContainer sizing in a flex layout. Fixed with explicit chart dimensions and fallback data from topKeywords / profile skills.

4. Session stability across deploys
connect-mongo session store failures could orphan userId references. Added auto userId assignment middleware and batchId fallbacks on job analysis routes.

5. Solo + deadline
Building six features, MCP wiring, Agent Builder integration, and two deploy targets in one hackathon window meant ruthless prioritization: backend correctness and agent behavior first, UI polish second.


Accomplishments that we're proud of

  • Built a full agent lifecycle — not a chatbot wrapper — with mode-based behavior tied to real MongoDB state
  • Wired MongoDB MCP so every agent read/write is auditable in a live panel (great for demos)
  • Human-in-the-loop drafts — follow-ups, rejection patterns, and weekly briefings require explicit user approval before persistence
  • Rejection pattern detection that classifies where in the funnel you're losing, not just that you lost
  • Shipped a public, working deployment on Vercel + Cloud Run with a complete demo flow end-to-end
  • Survived real production debugging (duplicate drafts, chart rendering, favicon caching) under deadline pressure

What we learned

  • Agents need memory architecture, not just a prompt. Loading profile, applications, job analyses, patterns, and briefings into context — and giving Gemini tools to fetch more — made recommendations specific instead of generic.
  • MCP is a judge-friendly integration story. Spawning the official MongoDB MCP server and logging [MCP] operations made the database layer visible and verifiable.
  • Approval gates matter for trust. Career advice that auto-sends emails or overwrites patterns would feel reckless. Pending drafts + confirm/dismiss turned the agent into a collaborator.
  • Deploy early, debug in prod. Vercel and Cloud Run surfaced issues (chart sizing, session cookies, API proxy) that localhost never showed.
  • The best hackathon demos show one clear insight. "You're losing pre-interview — here are the missing keywords across your last 4 rejections" beats "here's a cover letter generator."

What's next for RetrofitAI

  • LinkedIn / email integration — send approved follow-ups directly from the app
  • Resume diff engine — auto-suggest resume edits when missingKeywordsAcrossRejections updates
  • Multi-user auth — move from anonymous sessions to proper accounts (Clerk or Auth0)
  • Embeddings on job descriptions — semantic job matching and smarter ranking in MongoDB Atlas Vector Search
  • Chrome extension — one-click JD capture from job boards into job_analyses
  • Interview prep mode — when pattern is POST_INTERVIEW, generate company-specific question banks from stored JDs

Built With

Share this project:

Updates