Delete conversation_summary_phase-1.md
Browse files- conversation_summary_phase-1.md +0 -137
conversation_summary_phase-1.md
DELETED
|
@@ -1,137 +0,0 @@
|
|
| 1 |
-
# AI Interview Coach β Session Handoff Summary (June 11, 2026)
|
| 2 |
-
|
| 3 |
-
## 1. Project Overview
|
| 4 |
-
|
| 5 |
-
An **AI-powered Interview Coach** built with **Gradio + Ollama (Mistral 7B)**. The user pastes a job description, the app validates it, generates tailored interview questions, scores the candidate's answers using LLM-based evaluation, and produces a downloadable PDF report of the session.
|
| 6 |
-
|
| 7 |
-
**GitHub Repo:** `ishan-awas-13/HF_Hackathon`
|
| 8 |
-
**Active Branch:** `Primarily-Vibe-Coded` (branched from `feature/job-analyzer-pipeline`)
|
| 9 |
-
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
## 2. Architecture (3-File Modular Design)
|
| 13 |
-
|
| 14 |
-
| File | Role | Lines |
|
| 15 |
-
|---|---|---|
|
| 16 |
-
| `config.py` (104 lines) | All static config: `OLLAMA_URL`, `HISTORY_FILE`, `QUESTION_PROMPTS`, `TIPS_DB`, `DEFAULT_TIPS`, `CUSTOM_CSS` |
|
| 17 |
-
| `engine.py` (632 lines) | All backend logic: Ollama API calls, job description validation pipeline, question generation, answer scoring, history persistence, PDF report generation |
|
| 18 |
-
| `interview_coach.py` (247 lines) | Pure Gradio UI layer: layout, state management, event wiring. Imports everything from `config` and `engine` via `from config import *` / `from engine import *` |
|
| 19 |
-
|
| 20 |
-
---
|
| 21 |
-
|
| 22 |
-
## 3. Key Features & Their Implementation
|
| 23 |
-
|
| 24 |
-
### 3.1 Security Pipeline (`engine.py` β `analyze_and_validate_job`)
|
| 25 |
-
Two-stage job description validation:
|
| 26 |
-
1. **Programmatic filter:** Rejects inputs < 350 characters.
|
| 27 |
-
2. **LLM guardrail:** A temperature=0.0 prompt that classifies input as `VALID` or `INVALID` to prevent prompt injection.
|
| 28 |
-
|
| 29 |
-
After validation, the LLM extracts `<INDUSTRY>`, `<KEYWORDS>`, and `<TIPS>` XML tags from the job description to personalize the session.
|
| 30 |
-
|
| 31 |
-
### 3.2 PDF Report Generation (`engine.py` β `generate_pdf_report`)
|
| 32 |
-
- Uses **ReportLab** (`reportlab` package, v4.5.1 installed in `.venv`).
|
| 33 |
-
- Imports: `SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak` from `reportlab.platypus`.
|
| 34 |
-
- Generates `Interview_Session_Report.pdf` with:
|
| 35 |
-
- Professional styled title, section headers, body text.
|
| 36 |
-
- Metadata table (date, job snippet).
|
| 37 |
-
- Color-coded score badges (green β₯8, orange β₯5, red <5).
|
| 38 |
-
- Per-question breakdown: question text, candidate answer, AI score.
|
| 39 |
-
- Summary & Recommendations section with dynamic coaching text.
|
| 40 |
-
- Page breaks between sessions.
|
| 41 |
-
- **UI integration:** "π History & PDF Report" tab contains a `gr.Button("π₯ Generate PDF Report")` wired to `generate_pdf_report`, outputting to a `gr.File` component for browser download.
|
| 42 |
-
|
| 43 |
-
### 3.3 Current-Session-Only History
|
| 44 |
-
- `generate_all_questions` resets history on every new interview start:
|
| 45 |
-
```python
|
| 46 |
-
history_state = [session] # Overwrites, does NOT append
|
| 47 |
-
save_history(history_state)
|
| 48 |
-
```
|
| 49 |
-
- Each new interview session is completely independent β no data carries over from previous sessions.
|
| 50 |
-
- The PDF report and history preview reflect only the current/latest session.
|
| 51 |
-
|
| 52 |
-
### 3.4 Robust History Loading (`engine.py` β `load_history`)
|
| 53 |
-
- Protected against `JSONDecodeError` when `interview_history.json` is empty or corrupted:
|
| 54 |
-
```python
|
| 55 |
-
try:
|
| 56 |
-
content = f.read().strip()
|
| 57 |
-
if not content:
|
| 58 |
-
return []
|
| 59 |
-
return json.loads(content)
|
| 60 |
-
except json.JSONDecodeError:
|
| 61 |
-
return []
|
| 62 |
-
```
|
| 63 |
-
|
| 64 |
-
### 3.5 Gradio 6.0 Compatibility Fix
|
| 65 |
-
- `theme` and `css` parameters moved from `gr.Blocks()` constructor to `demo.launch()`:
|
| 66 |
-
```python
|
| 67 |
-
with gr.Blocks(title="AI Interview Coach") as demo:
|
| 68 |
-
...
|
| 69 |
-
custom_theme = gr.themes.Soft(
|
| 70 |
-
primary_hue=gr.themes.colors.violet,
|
| 71 |
-
...
|
| 72 |
-
)
|
| 73 |
-
demo.launch(theme=custom_theme, css=CUSTOM_CSS)
|
| 74 |
-
```
|
| 75 |
-
|
| 76 |
-
---
|
| 77 |
-
|
| 78 |
-
## 4. UI Layout (3 Tabs)
|
| 79 |
-
|
| 80 |
-
### Tab 1: π― Practice
|
| 81 |
-
- **Left column:** Job description input + "Start Interview" button.
|
| 82 |
-
- **Right column:** Progress indicator, question display, answer input, "Get Feedback" & "Next Question" buttons.
|
| 83 |
-
- **Accordions:** "Previous Question Review" and "This Session's Log".
|
| 84 |
-
- **Feedback box:** Displays AI coach scoring output.
|
| 85 |
-
|
| 86 |
-
### Tab 2: π History & PDF Report
|
| 87 |
-
- "π₯ Generate PDF Report" button β `gr.File` download component.
|
| 88 |
-
- "π Refresh Preview" and "ποΈ Clear History" buttons.
|
| 89 |
-
- Markdown-rendered quick progress history below a separator.
|
| 90 |
-
|
| 91 |
-
### Tab 3: π‘ Tips & Resources
|
| 92 |
-
- Dynamically populated based on validated job description profile (industry, keywords, tips extracted by LLM).
|
| 93 |
-
|
| 94 |
-
---
|
| 95 |
-
|
| 96 |
-
## 5. Visual Design
|
| 97 |
-
- **Dark theme:** `body { background: #0d0d1f }` with transparent Gradio containers.
|
| 98 |
-
- **Animated blobs:** 4 fixed `div` elements with CSS `@keyframes` float animations (violet, purple, orange, pink).
|
| 99 |
-
- **Gradient buttons:** Primary buttons use `linear-gradient(135deg, #6366f1, #8b5cf6)` with hover lift effect.
|
| 100 |
-
- **Typography:** Google Sans font via CSS import.
|
| 101 |
-
|
| 102 |
-
---
|
| 103 |
-
|
| 104 |
-
## 6. Environment & Dependencies
|
| 105 |
-
- **Python:** 3.12
|
| 106 |
-
- **Virtual env:** `.venv` in project root
|
| 107 |
-
- **Key packages:** `gradio` (v6.x), `requests`, `reportlab` (v4.5.1)
|
| 108 |
-
- **LLM Backend:** Ollama running locally at `http://localhost:11434/api/generate`, model `mistral:7b`
|
| 109 |
-
- **Persistence:** `interview_history.json` (JSON file, reset per session)
|
| 110 |
-
|
| 111 |
-
---
|
| 112 |
-
|
| 113 |
-
## 7. Git Branch Structure
|
| 114 |
-
| Branch | Purpose |
|
| 115 |
-
|---|---|
|
| 116 |
-
| `main` | Original stable version |
|
| 117 |
-
| `history-and-tips` | Added history & tips features |
|
| 118 |
-
| `multi-question-version` | Multi-question interview flow |
|
| 119 |
-
| `feature/job-analyzer-pipeline` | Modularized architecture + security pipeline + PDF |
|
| 120 |
-
| `Primarily-Vibe-Coded` | **ACTIVE** β Current development branch for agent-driven refinements |
|
| 121 |
-
|
| 122 |
-
---
|
| 123 |
-
|
| 124 |
-
## 8. Project Agenda (from `Project_Agenda.md`)
|
| 125 |
-
1. β
Bulletproof prompts β security validation pipeline implemented.
|
| 126 |
-
2. β
Fix Tips section β dynamically generated from LLM-parsed job description.
|
| 127 |
-
3. β
Fix History Section β replaced with PDF download option.
|
| 128 |
-
4. β¬ Make response grading flexible β keyword-based scoring (partially implemented via `keywords` extraction, needs scoring integration).
|
| 129 |
-
5. β¬ Support more job types β industry detection implemented, but broader flexibility can be enhanced.
|
| 130 |
-
|
| 131 |
-
---
|
| 132 |
-
|
| 133 |
-
## 9. Known Issues & Next Steps
|
| 134 |
-
- **Keyword-based scoring:** The `job_profile_state` extracts keywords from the job description but `score_answer` does not yet use them to influence the score. This is Agenda Item #4.
|
| 135 |
-
- **STAR format enforcement:** The scoring prompt mentions STAR but doesn't programmatically verify structure.
|
| 136 |
-
- **PDF filename:** Currently hardcoded as `Interview_Session_Report.pdf` β could be timestamped for uniqueness.
|
| 137 |
-
- **Deployment:** Currently local-only. For Hugging Face Spaces deployment, would need to swap Ollama for an API-based model (e.g., HF Inference API).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|