Case Study_01

AI-Powered Recruiting Platform.

A Next.js application that makes AI decision-making visible. Type a natural language query and watch the system reason through candidate matching in real-time — filtering and ranking 50+ candidates with full explainability at every step.

ROLE

Full-Stack Engineer

TIMELINE

2024

Think→Act→Act→Speak

MCP Orchestration Workflow

0+

Candidate Profiles

Google Gemini

LLM Provider

MCP Workflow Architecture

The app routes every natural language query through a four-stage MCP pipeline. The LLM first generates structured filter and ranking plans (THINK), the core tools execute filtering and scoring against the CSV dataset (ACT × 2), then the LLM synthesises results into a human-readable summary (SPEAK). Each stage is streamed to the UI in real-time so users can watch the reasoning unfold.

Next.js 15TypeScriptAI SDKGoogle GeminiFramer Motionshadcn/ui
ATS-Lite MCP workflow architecture diagram

FIGURE A.01

Four-Stage MCP Pipeline

Engineering Challenges.

01

Getting the LLM to consistently emit valid filter and ranking plans as structured JSON — without hallucinating fields or breaking the downstream tool calls.

Solution

Used AI SDK's structured output mode with strict Zod schemas for both the filter plan and ranking plan. Any schema violation triggers a retry with an error-context prompt, keeping the pipeline deterministic.

02

Showing each pipeline stage (Think / Act / Speak) as it completes — without blocking the UI or faking progress.

Solution

Streamed stage completion events from the API route using Server-Sent Events. Each stage posts its result as it resolves, letting the frontend animate the timeline in true real-time with Framer Motion staggered transitions.

Building a transparent AI workflow taught me that explainability is an engineering problem, not just a product feature.

Schema-First LLM Integration

Defining strict Zod schemas before writing a single prompt eliminated an entire class of runtime errors and made the LLM's output predictable.

Streaming > Polling

Server-Sent Events for pipeline stage updates gave a dramatically better UX than polling — users see progress immediately rather than waiting for the full result.

Separate Concerns Cleanly

Keeping filtering, ranking, and summarisation as distinct tool functions made each individually testable and easy to swap out.

Transparency Builds Trust

Showing the AI's reasoning steps reduced perceived uncertainty — users trusted the results more when they could see how they were produced.

mcp-workflow.ts

Brian Mutai / Full-Stack Engineer