CoolFace
Apppublic

Spidercraft01/prepai-advanced-interview-platform

sourceHugging Facemitupdated 2mo agoView on Hugging Face
0likes
App README

PrepAI โ€” AI Interview Coach

<img width="916" height="922" alt="image" src="https://github.com/user-attachments/assets/dd3647f9-66f2-4961-932e-031a4f63f0cd" />

Master technical interviews with confidence. Real-time AI feedback | Daily Coding Challenges | GitHub Integration | High-Quality Neural Voice


๐Ÿ“– About The Project

Problem Specialization Statement

PrepAI v2 specializes in adaptive AI-driven interview coaching because generic chatbots cannot track performance across a session, adapt difficulty in real-time, or produce a quantified score. PrepAI v2 closes this gap with a full agentic loop โ€” evaluate, decide, follow-up, adapt โ€” making it a purpose-built agent rather than a prompt-wrapped chatbot. As someone actively interviewing for AI/ML SDE roles, I built this to solve a problem I face personally, which is why every design decision reflects real user need.

PrepAI is a cutting-edge interview preparation platform designed to bridge the gap between candidate potential and interview performance.

What it does:

  • โ€”Simulates Reality: Conducts voice-based technical interviews using advanced AI Personas
  • โ€”Daily Quiz: AI-generated topic-based coding challenges with interactive execution
  • โ€”Analyzes Identity: Parses your resume locally and scans your GitHub profile to tailor questions
  • โ€”Provides Insights: Real-time, actionable feedback on your answer quality and communication style

Built with a developer-first mindset, featuring a high-contrast dark theme, monospaced typography, and a privacy-first local architecture.

Documentation

See the `docs/` folder: architecture, interview engine, scoring, prompts, domain packs, recommendations, quiz, testing, deployment, Hugging Face Spaces, environment, launch checklist, and growth/user-testing playbooks.


๐Ÿš€ Key Features

  • โ€”๐Ÿค– Open-Source AI: Powered by Groq (Llama 3.3) for intelligent, fast, and free AI interactions
  • โ€”๐Ÿ—ฃ๏ธ High-Quality Neural Voice: Uses Piper TTS (WASM) for local, privacy-first speech synthesis
  • โ€”๐Ÿ“„ Privacy-First: Resume parsing and voice generation happen locally or via secure open-source APIs
  • โ€”๐Ÿงฉ Daily Quiz: Interactive coding challenges with browser-based execution and interview questions
  • โ€”๐Ÿ™ GitHub Integration: Analyzes your repositories directly in the sidebar
  • โ€”๐Ÿ’Ž Developer UI/UX: High-contrast dark theme with neon accents and terminal aesthetics
  • โ€”๐Ÿ“Š Detailed Analytics: Visualizes your skill growth with Radar charts and session tracking

๐Ÿ› ๏ธ Getting Started

Prerequisites

  • โ€”Node.js (v18 or higher)
  • โ€”Python (3.11 or higher)
  • โ€”Docker + Docker Compose (recommended)
  • โ€”Git

Environment Variables

Copy .env.example to .env and fill in your keys:

bash
cp .env.example .env
VariableDescriptionRequired
GROQ_API_KEYGroq LLM API key (get free key)โœ…
REDIS_URLRedis connection string for session memoryโœ…
HUGGINGFACE_API_KEYHuggingFace Inference API key (for Whisper STT)For voice
FRONTEND_URLAllowed CORS origin for the frontendProduction
VITE_API_URLBackend URL the frontend callsโœ…
โš ๏ธ Security: Never commit .env with real values. The Groq API key is loaded server-side only via python-dotenv. The frontend bundle contains no API keys.

Option A: Docker (Recommended)

Unified production image (frontend + FastAPI + Redis behind nginx on port 7860 โ€” same layout as Hugging Face Spaces):

bash
cp .env.example .env   # add GROQ_API_KEY
docker compose up --build

Open http://localhost:7860. Health: http://localhost:7860/health.

Split stack (API on 8000 + Redis, for local debugging):

bash
docker compose --profile split up --build backend redis

Then run the Vite frontend with VITE_API_URL=http://localhost:8000.

Option B: Manual Setup

Backend:

bash
cd backend
python -m venv venv
# Windows: venv\Scripts\activate
# macOS/Linux: source venv/bin/activate
pip install -r requirements.txt
cp ../.env.example ../.env
# Edit ../.env with your API keys
uvicorn main:app --reload --port 8000

Frontend (separate terminal):

bash
# From project root
npm install
npm run dev

Open http://localhost:5173 in your browser.


๐Ÿ“ Performance Metrics & Scoring Formula

PrepAI calculates a 1-to-10,000 integer score using a weighted five-axis formula:

Score = (accuracy ร— 0.35 + depth ร— 0.25 + adaptability ร— 0.20 + speed ร— 0.10 + confidence ร— 0.10) / 100 ร— 10,000

The result is clamped to [1, 10000] and returned as an integer.

AxisWeightSource
Accuracy0.35Factual correctness scored by the Groq LLM rubric (0โ€“100)
Depth0.25Technical depth and detail scored by the Groq LLM rubric (0โ€“100)
Adaptability0.20Inverse of follow-up count: 100 - (follow_ups ร— 20) โ€” fewer follow-ups = higher score
Speed0.10Response latency normalized against a 30-second baseline
Confidence0.10100 - (filler_word_ratio ร— 100) โ€” derived from transcript analysis

๐Ÿ“Š Benchmark Comparison: PrepAI v2 vs. Generic AI Chatbot

Five identical tasks were run on both PrepAI v2 and a general-purpose AI assistant (such as Cursor's Claude), with outputs compared side by side to demonstrate where a specialized agent outperforms a general model.

TaskPrepAI v2Generic AI Chatbot (Claude/GPT)
Task 1: Evaluate a shallow answerStructured JSON Score. Returns a validated Pydantic JSON object with explicit scores for accuracy, depth, clarity, and confidence (e.g., {"accuracy": 40, "depth": 20, ...}).Freeform Text. Returns conversational text with qualitative feedback, difficult to parse programmatically without brittle regex or separate extraction passes.
Task 2: Generate a follow-upTyped Follow-up (Python Logic). Deterministically categorizes the follow-up as probe, challenge, or hint based on the exact evaluation score.Generic Response. Guesses whether to ask another question or give a hint based on the LLM's internal weights, lacking deterministic structure.
Task 3: Track session memoryPersistent Redis Memory. Accurately tracks questions_asked, running averages of axes scores, and follow_ups_used across the entire 1-hour session.Context Window Dependency. Relies purely on appending to the chat history. Struggles to track quantitative metrics like running averages accurately over many turns.
Task 4: Numeric performance score1-to-10,000 Integer. Returns a mathematically calculated integer using a strict weighted formula (accuracy*0.35 + depth*0.25 + adaptability*0.20 + speed*0.10 + confidence*0.10) / 100 * 10000.Unavailable / Hallucinated. Feature is fundamentally unavailable. When asked to score, it invents a subjective number that does not follow a strict multi-axis formula.
Task 5: Downloadable PDF reportGenerated PDF (ReportLab). Creates a concrete, downloadable .pdf file with per-question scores, adaptability metrics, and recommended study areas.Not Possible. Chatbots can generate markdown or text summaries, but cannot natively generate and serve binary .pdf files without external plugins or wrappers.

Conclusion

Generic chatbots operate strictly as text-in/text-out systems. PrepAI v2 functions as a true agentic loop. By removing the decision-making from the LLM and anchoring it in deterministic Python logic, PrepAI v2 reliably scores, adapts, and tracks candidate performance in ways a prompt-wrapped chatbot cannot achieve.


๐Ÿ’ก Usage Examples

API Examples

Start a session:

bash
curl -X POST http://localhost:8000/session/start \
  -H "Content-Type: application/json" \
  -d '{"role": "Senior Software Engineer", "session_id": "test-001"}'

Evaluate an answer (with audio):

bash
curl -X POST http://localhost:8000/session/evaluate \
  -F "session_id=test-001" \
  -F "question_text=Explain the difference between TCP and UDP" \
  -F "latency_seconds=22.5" \
  -F "filler_ratio=0.05" \
  -F "audio_file=@recording.webm"

Evaluate an answer (text only):

bash
curl -X POST http://localhost:8000/session/evaluate \
  -F "session_id=test-001" \
  -F "question_text=Explain the difference between TCP and UDP" \
  -F "text_answer=TCP is connection-oriented and guarantees delivery..."

Workflow

  1. 1.Start a session by providing your target role โ€” the agent generates the first question.
  2. 2.Speak or type your answer โ€” the agent evaluates it and decides: advance (score โ‰ฅ 80), probe deeper (50โ€“79), or give a hint and retry (< 50).
  3. 3.Receive your report โ€” after all questions, download a PDF with your 1-to-10,000 score, per-axis breakdowns, and recommended study areas.

๐Ÿ“ Project Structure

PrepAI/
โ”œโ”€โ”€ backend/          # FastAPI backend (agent loop, evaluator, memory)
โ”‚   โ”œโ”€โ”€ main.py       # Routes + agent decision logic
โ”‚   โ”œโ”€โ”€ models.py     # Pydantic models for all request/response schemas
โ”‚   โ””โ”€โ”€ services/     # Evaluator, follow-up, planner, report, transcriber
โ”œโ”€โ”€ components/       # React components (Sidebar, QuizLab, etc.)
โ”œโ”€โ”€ pages/            # Main pages (Dashboard, Quiz, InterviewRoom, etc.)
โ”œโ”€โ”€ hooks/            # Custom React hooks (useInterview, etc.)
โ”œโ”€โ”€ services/         # Frontend API proxy services (groq, piper, github)
โ”œโ”€โ”€ types.ts          # TypeScript type definitions
โ”œโ”€โ”€ index.css         # Global styles (Developer theme)
โ”œโ”€โ”€ .env.example      # Environment variable template
โ””โ”€โ”€ docker-compose.yml

๐Ÿ” Security Notes

  • โ€”No API keys in the frontend bundle. All LLM calls (Groq) route through the FastAPI backend. The GROQ_API_KEY is loaded server-side via python-dotenv and never exposed to the browser.
  • โ€”`.env` is gitignored. The repository ships .env.example with placeholder values only.
  • โ€”Session data expires. Redis keys are set with a 1-hour TTL via setex.
  • โ€”Audio is processed in-memory. Voice recordings are transcribed via the HuggingFace Whisper API without being written to persistent disk.

๐Ÿค Contributing

Contributions are welcome! Please open an issue or submit a pull request.


๐Ÿ“„ License

This project is licensed under the MIT License.


๐Ÿ™ Acknowledgments

  • โ€”Groq for blazing-fast open-source LLM inference
  • โ€”Piper TTS for high-quality local speech synthesis
  • โ€”Vite + React for lightning-fast development experience