Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions use-cases/tripathi-03/interview-preparation-brief/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Application
APP_NAME=Interview Preparation Brief
APP_ENV=development
API_PREFIX=/api/v1
LOG_LEVEL=INFO
CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173

# Database
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/interview_prep

# LLM — use groq (free) by default. Options: groq | gemini | openai | anthropic
LLM_PROVIDER=groq
GROQ_API_KEY=your-groq-key-here
GROQ_MODEL=llama-3.1-8b-instant

# Optional paid / alternate providers
OPENAI_API_KEY=
OPENAI_MODEL=gpt-4.1
ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=claude-sonnet-4-20250514
GEMINI_API_KEY=
GEMINI_MODEL=gemini-2.0-flash

# Embeddings — local is free (no API). Options: local | openai | gemini
EMBEDDING_PROVIDER=local
EMBEDDING_MODEL=local-hashing-v1
EMBEDDING_DIMENSIONS=1536

# SuperDocs cloud document API (Task 2 — upload / chat / approve / export)
SUPERDOCS_ENABLED=true
SUPERDOCS_API_KEY=sk_your_superdocs_key_here
SUPERDOCS_BASE_URL=https://api.superdocs.app

# RAG
CHUNK_SIZE=800
CHUNK_OVERLAP=120
RETRIEVAL_TOP_K=6
EVIDENCE_FALLBACK=No evidence found.

# Storage
UPLOAD_DIR=./uploads
MAX_UPLOAD_MB=10
COMPANY_RESEARCH_ENABLED=true
HTTP_TIMEOUT_SECONDS=20
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI

on:
push:
branches: [main, master]
pull_request:

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
backend:
name: Backend Pytest
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: backend/requirements.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Ruff lint
run: ruff check app tests

- name: Run unit tests
env:
OPENAI_API_KEY: test-openai-key-not-real
ANTHROPIC_API_KEY: test-anthropic-key-not-real
LLM_PROVIDER: openai
APP_ENV: test
EVIDENCE_FALLBACK: No evidence found.
run: pytest tests/unit -q

- name: Run LangGraph tests
env:
OPENAI_API_KEY: test-openai-key-not-real
LLM_PROVIDER: openai
APP_ENV: test
run: pytest tests/langgraph -q

- name: Run integration tests
env:
OPENAI_API_KEY: test-openai-key-not-real
LLM_PROVIDER: openai
APP_ENV: test
run: pytest tests/integration -q

frontend:
name: Frontend Vitest
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: frontend/package.json

- name: Install dependencies
run: npm install

- name: Typecheck
run: npx tsc -b --pretty false

- name: Unit tests
run: npm test

- name: Build
run: npm run build
37 changes: 37 additions & 0 deletions use-cases/tripathi-03/interview-preparation-brief/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Python
__pycache__/
*.py[cod]
*.egg-info/
.venv/
venv/
.env
.mypy_cache/
.pytest_cache/
.ruff_cache/
htmlcov/
.coverage

# Node
node_modules/
dist/
build/
.vite/
coverage/
*.local

# IDE / OS
.idea/
.vscode/
*.swp
.DS_Store
Thumbs.db

# Uploads / local data
uploads/
*.log
.docker-data/

.env
.env.*
!.env.example

21 changes: 21 additions & 0 deletions use-cases/tripathi-03/interview-preparation-brief/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Interview Preparation Brief contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
95 changes: 95 additions & 0 deletions use-cases/tripathi-03/interview-preparation-brief/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Interview Preparation Brief

Evidence-grounded interview prep for job seekers: combine a **resume**, **job description**, and **company context** into a professional Interview Preparation Report — then polish and export it through **SuperDocs**.

Built for the **SuperDocs Round 2** assignment by **Divyanshu Tripathi** (`tripathi-03`).

## What it does

1. Upload resume (PDF/DOCX) + paste/upload JD + company name
2. LangGraph pipeline (Groq LLM + local embeddings / pgvector) produces:
- company overview, role summary, skill gaps
- categorized interview questions
- evidence-backed answers (`No evidence found.` when unsupported)
- STAR answers + 30-60-90 roadmap
3. Local export: PDF / DOCX / Markdown / HTML
4. **SuperDocs path (required integration):** upload → chat polish → human approve → export

## SuperDocs features used

| Step | SuperDocs API |
|------|----------------|
| Upload report HTML | `POST /v1/documents/upload` |
| Edit / polish | `POST /v1/chat/async` (`approval_mode=ask_every_time`) |
| Approve / deny changes | `POST /v1/chat/{session_id}/approve` |
| Export DOCX/PDF | `POST /v1/documents/export` |

In the UI, open a completed report → **SuperDocs polish & export**.

## Stack

- **Frontend:** React, TypeScript, Vite, Tailwind
- **Backend:** FastAPI, LangGraph, PostgreSQL + pgvector
- **LLM:** Groq (`LLM_PROVIDER=groq`) — free tier
- **Embeddings:** local hashing by default (`EMBEDDING_PROVIDER=local`)
- **Documents:** SuperDocs cloud API for styled export / HITL edit

## How to run

### Prerequisites

- Python 3.12+
- Node.js 20+
- Docker (Postgres/pgvector)
- Free [Groq](https://console.groq.com/) API key
- [SuperDocs](https://use.superdocs.app) API key (`sk_…`)

### Setup

```bash
cp .env.example .env
# Fill in:
# GROQ_API_KEY=...
# SUPERDOCS_API_KEY=...
# SUPERDOCS_ENABLED=true
# LLM_PROVIDER=groq
# EMBEDDING_PROVIDER=local

docker compose up -d db

cd backend
python -m venv .venv
# Windows: .venv\Scripts\python.exe -m pip install -r requirements.txt
# Windows: .venv\Scripts\python.exe -m uvicorn app.main:app --reload --port 8000

cd ../frontend
cp .env.example .env
npm install
npm run dev
```

- App: http://localhost:5173
- API docs: http://localhost:8000/docs

### Environment placeholders

```env
LLM_PROVIDER=groq
GROQ_API_KEY=your-groq-key-here
GROQ_MODEL=llama-3.1-8b-instant
EMBEDDING_PROVIDER=local
SUPERDOCS_ENABLED=true
SUPERDOCS_API_KEY=your-superdocs-key-here
SUPERDOCS_BASE_URL=https://api.superdocs.app
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/interview_prep
```

Never commit real keys.

## Anti-hallucination

Resume-backed answers use resume-only RAG retrieval. Missing evidence returns exactly: **`No evidence found.`**

## License

Contributed under this repository’s MIT license.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.12-slim

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

RUN mkdir -p /app/uploads

EXPOSE 8000

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Backend — Interview Preparation Brief

## Modules

- `app/api` — FastAPI routers + dependency injection
- `app/services` — parsers, RAG, company research, brief services
- `app/agents` — LangGraph 7-node workflow
- `app/models` — SQLAlchemy ORM
- `app/schemas` — Pydantic models
- `app/database` — engine, sessions, bootstrap
- `app/utils` — evidence guard / helpers
- `app/core` — config, logging, exceptions

## Run

```bash
# from repo root
docker compose up -d db
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
```

Open http://localhost:8000/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Backend package marker."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Agents package — LangGraph orchestration."""

__all__ = [
"NODE_ORDER",
"build_brief_graph",
"build_validated_brief_graph",
"run_brief_pipeline",
]


def __getattr__(name: str):
if name in {"NODE_ORDER", "build_brief_graph", "build_validated_brief_graph"}:
from app.agents import graph as _graph

return getattr(_graph, name)
if name == "run_brief_pipeline":
from app.agents.runner import run_brief_pipeline

return run_brief_pipeline
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
Loading