Skip to main content
Case Studies14 min read

Privacy-First AI at Scale: Building a Multi-Provider Job Analysis System

Privacy-First AI at Scale: Building a Multi-Provider Job Analysis System

Executive Summary

BrightPath Companion is a privacy-first, multi-provider analysis system that helps candidates evaluate job opportunities efficiently and consistently. This case study examines the architectural decisions, development methodology, and leadership considerations behind building a specialized multi-agent pipeline paired with explicit consent and PII controls. The system supports both local and cloud models, provides analytics and export tooling for downstream workflows, and demonstrates how to combine architectural discipline with AI-assisted implementation to ship resilient, explainable software.

Key Outcomes:

  • Multi-provider architecture with local (OpenAI-compatible/Ollama), Gemini, and OpenRouter providers via a unified contract (src/services/ai/providers/)
  • Specialized 12-agent pipeline producing multi-dimensional fit scoring and management overlays (src/services/ai/*)
  • Production-grade privacy controls: explicit consent gate for remote providers and pre-send PII review with Proceed/Redact/Cancel (src/services/piiGuard.ts, src/components/Consent/*)
  • Orchestrated provider selection with primary/secondary, retry-once semantics, and local fallback by error class (src/services/ai/aiOrchestrator.ts)
  • Caching by content hash (resume + job) to avoid redundant invocations (runFullAnalysis in src/services/ai/pipeline.ts)
  • Analytics views and export formats (CSV/JSONL, analytics summary JSON) to support decision-making and reporting (src/components/Dashboard/**, export utils in README)
  • Dual targets: web (Vite) and desktop (Tauri) with scoped filesystem access on desktop; desktop bundles produced for Linux/macOS on Release or manual workflow runs
  • CI for lint/typecheck/tests on push/PR and Desktop packaging on release/manual (.github/workflows/ci.yml and .github/workflows/desktop.yml)

Business Context and Problem Statement

Market Challenge

The contemporary job search landscape presents two compounding problems:

  1. Signal-to-noise ratio degradation: Fraudulent job postings increasingly mimic legitimate opportunities, requiring deeper analysis to identify red flags invisible at surface level. Anomalies and problematic patterns in postings are hard to detect from surface content alone.

  2. Semantic fragmentation: Identical skill sets are advertised under disparate job titles and requirements, forcing candidates to manually cross-reference roles that may represent strong fits despite linguistic differences. This fragmentation obscures strong-fit opportunities across organizations.

These inefficiencies add substantial time burden to an already resource-intensive process. Manual review of job descriptions against candidate qualifications is tedious, error-prone, and scales poorly.

Solution Hypothesis

Through preliminary experimentation with large language models, I validated that AI could effectively:

  • Detect anomalies and red flags in postings
  • Normalize semantic variations across job titles and requirements
  • Quantify alignment between a candidate's resume and role demands using specialized AI agents

The natural progression was systematizing these capabilities into a purpose-built application that candidates could operate autonomously.


Strategic Architecture Decisions

Multi-Provider Philosophy

Decision: Maintain a provider abstraction with support for local, Gemini, and OpenRouter; keep hosted OpenAI/Claude as future work.

Rationale: User data sovereignty, cost control, and optionality across deployment contexts. Different environments demand different trade-offs:

  • Local models (Ollama/OpenAI-compatible): Complete data privacy for sensitive profiles, zero per-query costs, suitable for users with technical infrastructure
  • Cloud providers (Gemini/OpenRouter): Access to frontier models, minimal infrastructure requirements, consumption-based pricing
  • Future enterprise providers (Claude/hosted OpenAI): Compliance-certified endpoints for regulated industries

This architectural pattern increases implementation complexity but eliminates vendor lock-in and provides users agency over how their professional data is processed. In an era of increasing data privacy regulations and varied organizational policies, this flexibility is not optional—it's foundational.

Implementation: Common AIProvider interface with provider-specific modules (local.ts, gemini.ts, openrouter.ts) handling vendor-specific authentication, rate limiting, and response formatting internally.

Agent Specialization Over Monolithic Analysis

Decision: Compose 12 focused agents instead of one general analyzer.

Rationale: In organizational design, we expect specialization because it produces superior outcomes. The same principle applies to AI agent architecture. Specialization improves structure and consistency when there is no interactive correction loop.

Specialized agents implemented:

  • roleClassifier: Taxonomic normalization of job titles and seniority levels
  • jobAnalyzer: Core requirement extraction and structuring
  • companyIntel: Public information aggregation about employer
  • companyStage: Organizational maturity assessment (startup/growth/enterprise)
  • techStack: Technical requirement identification and scoring
  • resumeMatcher: Qualification alignment analysis
  • resumeSignals: Career trajectory pattern recognition
  • leadershipScope: Management responsibility assessment
  • programDelivery: Cross-functional program evaluation
  • strategyAlignment: Strategic thinking requirement analysis
  • grcCompliance: Governance, risk, and compliance consideration
  • confidenceCoach: Actionable recommendation synthesis

Each agent operates with focused prompts optimized for its specific domain. This architectural pattern emerged from observing quality degradation when attempting to consolidate responsibilities—a single agent with a comprehensive prompt exhibited higher error rates and inconsistent output structure.

Critical constraint: Unlike conversational AI applications, this system provides no user feedback loop during analysis. Users cannot interactively correct misinterpretations. Specialization mitigates this by reducing the cognitive load per agent, improving accuracy and consistency.

Privacy-First Architecture

Decision: Implement production-grade consent management and PII detection as first-class features despite this being a personal project.

Rationale: As a technology leader, I recognize that users don't read fine print and may not fully comprehend data flow implications. When a tool processes resumes containing addresses, phone numbers, employment history, and competency assessments, privacy controls aren't optional features—they're ethical requirements.

Implementation approach:

  1. Consent gating: Explicit user acknowledgment required before remote API usage with clear explanation of data transmission (Settings + modal confirmation)
  2. PII detection engine: Pre-send analysis identifying personally identifiable information in resumes and job descriptions
  3. Review interface: Modal presentation of detected PII with Proceed/Redact/Cancel options before transmission
  4. Local-only mode: Bypasses remote and PII prompts by design; graceful degradation when consent is withheld or remote keys unavailable

Code anchors: src/services/piiGuard.ts, src/components/Consent/ConsentDialog.tsx, src/components/Consent/PIIDialog.tsx, src/contexts/PIIProvider.tsx

Secondary objective: This implementation served as a test case for AI-assisted development of security-critical features. A common criticism of AI coding tools is poor security and privacy pattern recognition. By explicitly designing and implementing these systems with AI assistance, I evaluated whether that criticism reflects tool limitations or insufficient human guidance. The successful implementation suggests the latter.


Architecture Deep-Dive

Orchestrated Provider Selection (with Fallback)

The system implements sophisticated provider orchestration with retry logic and fallback mechanisms:

  1. Normalize Gemini model names (normalizeGeminiModel() in gemini.ts)
  2. Build a primary/secondary attempts list from configured keys
  3. Retry by error class (e.g., don't retry 400/401 errors)
  4. Fall back to local if allowed and configured
  5. Wrap final provider with the PII guard shim
flowchart TD
    A[User Settings] --> B{Mode?}
    B -- local --> L[Local Provider]
    B -- remote --> C{Consent Granted?}
    C -- no --> LF{Local Fallback Configured?}
    LF -- yes --> L
    LF -- no --> E[Error: Consent required]
    C -- yes --> D[Build Attempts: primary/secondary]
    D --> TRY{Try provider}
    TRY -- success --> P[PII Guard Wrapper] --> OUT[Response]
    TRY -- retryable error --> NEXT{Has next?}
    NEXT -- yes --> TRY
    NEXT -- no --> LF2{Local Fallback?}
    LF2 -- yes --> L --> OUT
    LF2 -- no --> ERR[Error: remotes failed]

Code: src/services/ai/aiOrchestrator.ts (selection, retries, fallback, wrapping with wrapWithPIIGuard)

Caching and Scoring

  • Cache key: Hash of title + company + description + resume
  • Weighted scoring: Tuned by role seniority and stage-aware tilts; management overlays contribute conditional weights
  • Code: runFullAnalysis() and helpers in src/services/ai/pipeline.ts

Logging and Redaction

  • Sanitized logging with debug/info disabled by default
  • Warn/error levels redact sensitive fields
  • Code: src/utils/logger.ts

Desktop (Tauri) and Data Boundaries

  • Desktop builds restrict filesystem access to scoped folders
  • Connect-src CSP scoped to expected endpoints
  • Code: ai-job-search-web/src-tauri/tauri.conf.json
  • Builds produced on GitHub Release/Manual for Linux and macOS
  • Unsigned (Gatekeeper prompts expected on macOS)

Development Methodology and Tool Evolution

Design-First Development Process

The project followed a structured, human-led approach with AI acceleration:

Phase 1: Empirical Validation Conducted informal experiments using conversational AI interfaces, manually guiding models through resume analysis and job description evaluation to validate capability and identify output patterns.

Phase 2: Architectural Synthesis Translated empirical findings into system design sketches, defining:

  • Agent decomposition and responsibility boundaries
  • Data flow and caching strategy
  • Scoring algorithm and weighting approach
  • Privacy control insertion points

Phase 3: Rapid Scaffolding Partnered with Claude Opus 4 (extended thinking mode) to transform architectural sketches into initial codebase structure. This phase generated the core abstractions and type definitions that would constrain future implementation.

Phase 4: Guided Implementation Maintained tiered project documentation:

  • High-level deliverables: Feature requirements and success criteria
  • Architectural guidance: Design patterns and integration contracts
  • Implementation specifics: Component responsibilities and data schemas

Used this documentation structure to maintain consistency across development sessions, ensuring AI-generated code aligned with established architectural vision.

Critical success factor: Human-defined architecture with AI-accelerated implementation. The reverse approach—AI-driven architecture with human implementation—would have produced a less coherent system.

AI-Assisted Development Journey

The project traversed three AI coding platforms, each transition driven by operational constraints:

Windsurf (Initial Development):

  • Challenge: Frequent internal tool errors with minimal diagnostic feedback
  • Impact: Error messages provided support codes but no actionable debugging information
  • Critical failure mode: Tool invocation loops requiring conversation resets or complete cache purges
  • Economic consideration: Failed tool invocations consumed billable tokens without productive output

Claude Code (Mid-Project):

  • Strengths: Superior code generation quality and architectural reasoning
  • Challenge: Aggressive usage throttling
  • Impact: 30-minute active windows followed by 5-hour lockouts disrupted development flow states
  • Assessment: Excellent for discrete problem-solving sessions, untenable for sustained implementation work

OpenAI Codex (Production Development):

  • Solution: Web UI offering unlimited usage vs. CLI rate limits
  • Adaptation required: Restructured task decomposition and project organization patterns to optimize for web interface rather than conversational CLI workflow
  • Outcome: Eliminated blocking constraints while maintaining development velocity

Key insight: Tool selection requires evaluating not just capability but operational reliability and usage model alignment with project workflow requirements. Tool evolution summary: switched assistants and workflows as reliability/throughput needs evolved while maintaining architectural guardrails.

Testing Infrastructure

Implementation: Vitest unit/integration coverage for providers, orchestrator, parsing, stores

  • jsdom environment with V8 coverage
  • Sequential CI test runs with JUnit output

Measurable Outcomes and Metrics

Initial Baselines and Post-Release Targets

Cache hit rate over N analyses

  • Initial baseline: 30–50% in iterative usage (resume re-analyses, role edits)
  • Post-release target: 50–70% with typical workflows

Latency by provider (same prompt size; p50/p95)

  • Local (OpenAI-compatible/Ollama): p50 1.2–2.5s, p95 3–6s (small prompts ~400–800 tokens)
  • Gemini: p50 0.9–1.8s, p95 2–4s
  • OpenRouter: p50 1.0–2.2s, p95 2.5–5s
  • Post-release target: Keep p95 under 5s for standard analyses; investigate outliers

Cost per analysis (remote) vs local

  • Current state: Local = $0 (ignoring compute); remote cost fields are placeholders in providers
  • Initial placeholder: Derive $/analysis by multiplying estimated tokens by provider pricing; validate against provider dashboards post-release
  • Post-release target: <$0.02 per standard analysis on budget models; provide a "cost ceiling" setting for users

Recommendation agreement vs manual review

  • Initial baseline: 70–80% agreement on Apply/Consider/Don't Apply across K annotated pairs
  • Post-release target: >80% agreement after prompt/weight tuning

Consent/PII decision distribution (remote mode)

  • Initial baseline: Proceed 60–80%, Redact 15–35%, Cancel 0–5%
  • Post-release target: Maintain Cancel <5% with clear UX; reduce Redact over time via improved prompts

Remote fallback rate and retry outcomes

  • Initial baseline: <2–5% of remote calls fall back (network, 5xx, rate-limit)
  • Post-release target: <2% with primary/secondary orchestration

Export utilization

  • Initial baseline: 20–40% of sessions export CSV/JSONL or analytics summary
  • Post-release target: >50% adoption in prolonged sessions (pipeline/analytics usage)

Scope Management and Experimental Development

Feature Expansion Dynamics

The project scope expanded organically through experimentation: "Can this be implemented? Let's validate." Current AI models generate prototype-quality code with remarkable speed, creating temptation to complete partial implementations.

Delivered capabilities:

  • Web application: React + TypeScript + Vite with responsive UI
  • Desktop application: Tauri-based native wrapper with filesystem integration
  • Resume parsing: PDF and DOCX ingestion with text extraction
  • Data persistence: IndexedDB storage with structured schemas
  • Export formats: CSV (configurable columns) and JSONL for portability
  • Analytics views: Dashboard components supporting decision-making
  • Testing infrastructure: Vitest unit tests

Commercial exploration: At project midpoint, I evaluated SaaS viability—a web-only tier for convenience-focused users and a desktop tier for privacy-conscious users preferring local models. This exploration drove the multi-platform architecture but ultimately remained unrealized.

Counterfactual decision: If this had been scoped as a commercial product from inception, I would have committed exclusively to the desktop application, emphasizing data sovereignty and local-first operation as primary differentiators. The privacy-first architecture was already implemented; building the commercial narrative around it would have been straightforward.

Build vs. Buy Decisions

For a solo-developed project, technical infrastructure decisions prioritized:

  1. Proven libraries for commodity functionality:

    • Resume parsing: pdfjs-dist, docx
    • State management: React hooks + IndexedDB
    • Testing: Vitest
  2. Custom implementation for unique value:

    • Multi-agent analysis pipeline
    • Provider abstraction layer
    • Privacy control mechanisms
    • Scoring algorithm with configurable weights

This allocation allowed focus on the proprietary analysis logic while leveraging battle-tested infrastructure components.


Leadership Insights and Lessons Learned

Critical Lessons for Technical Leaders

1. Distrust AI Confidence Signals

Modern AI models generate code with remarkable speed and present completion with high confidence. This creates a dangerous illusion of correctness. The models are optimized to finish tasks and suggest adjacent features, often disregarding previously established constraints or existing documentation.

Leadership implication: AI-assisted development requires continuous architectural vigilance. The "what" and "why" must remain under human control. AI excels at accelerating the "how," but substituting AI judgment for human architectural reasoning produces incoherent systems.

Operational practice: Treat AI-generated code as a first draft requiring critical review, not as a trusted implementation ready for integration.

2. Specialization Principle Applies to AI Agents

The multi-agent architecture proved superior to monolithic approaches repeatedly during development. Attempts to consolidate agent responsibilities degraded output quality and consistency.

Leadership implication: This mirrors organizational design principles. Specialized roles with clear boundaries produce better outcomes than generalist roles with diffuse responsibilities. When architecting AI systems, apply the same decomposition thinking used for human teams.

3. Privacy Architecture Cannot Be Retrofitted

Implementing consent management, PII detection, and data handling controls from the beginning established patterns that influenced all subsequent development. These systems would be significantly more complex to retrofit into an existing codebase.

Leadership implication: Privacy and security controls must be foundational architectural concerns, not post-production additions. Even in exploratory projects, establishing these patterns creates muscle memory for production systems.

Cultural impact: Demonstrating privacy-first thinking in personal projects establishes standards for team behavior. Leaders set norms through their own work, not just through policy documents.


Trade-offs and Current Limits

Provider coverage:

  • Hosted OpenAI/Claude endpoints not included in this drop (abstraction ready for them)
  • Incomplete provider implementations drafted but unvalidated

Platform support:

  • Desktop bundles built for Linux/macOS; Windows not included in this drop

Testing coverage:

  • Unit/integration tests present for core services
  • End-to-end testing not implemented in current release

Features:

  • PWA/offline: Disabled in this drop (plugin removed)
  • Desktop signing/notarization: Not configured; Gatekeeper prompts expected on macOS
  • CI/CD pipeline: Manual deployment currently

Accessibility:

  • Audit required for keyboard navigation and screen reader support

Technical Artifacts (Code Anchors)

Core Services:

  • Provider orchestration: src/services/ai/aiOrchestrator.ts
  • Gemini model normalization: src/services/ai/providers/gemini.ts
  • OpenRouter provider: src/services/ai/providers/openrouter.ts
  • Consent + PII guard: src/services/piiGuard.ts, src/components/Consent/*, src/contexts/PIIProvider.tsx
  • Pipeline and caching: src/services/ai/pipeline.ts
  • Logging & redaction: src/utils/logger.ts
  • Data stores: src/services/database/*

Platform Configuration:

  • Desktop configuration & CSP: src-tauri/tauri.conf.json
  • CI: .github/workflows/ci.yml
  • Desktop builds (release/manual): .github/workflows/desktop.yml

User Interface:

  • Analytics and dashboards: src/components/Dashboard/**
  • Export utilities: Documented in README

Conclusion

BrightPath Companion demonstrates how technical leaders can leverage AI-assisted development as a force multiplier while maintaining architectural control and product vision. The project validates that:

  1. Privacy and user agency can coexist with AI-powered features through thoughtful architecture
  2. Multi-provider flexibility is essential for data sovereignty and cost control in an evolving AI landscape
  3. Specialization principles from organizational design apply to AI agent architecture and produce superior outcomes
  4. AI coding tools accelerate implementation velocity when guided by clear architectural vision, but architectural decisions must remain human-driven
  5. Production-grade privacy controls must be foundational, not retrofitted

For organizations evaluating AI integration strategies, this case study provides a blueprint: define the architectural vision and constraints, then leverage AI to accelerate execution within those boundaries. Keep the "what" and "why" human-driven while allowing AI to accelerate the "how." The inverse—allowing AI to drive architecture—produces technically functional but strategically incoherent outcomes.

Leaders can use this blueprint to ship coherent software that moves fast without breaking fundamentals like privacy and reliability. The most valuable insight may be the simplest: in AI-assisted development, trust yourself, not the AI. Technical leadership remains a human responsibility.


Technologies: React, TypeScript, Vite, Tauri, IndexedDB, Vitest, PDF.js, Ollama, Gemini API, OpenRouter API
Development Timeline: 3 months (part-time)
Lines of Code: ~15,000 (excluding tests and generated types)
Project Status: Production-ready for personal use; commercial deployment would require completion of known technical debt items