From 5d1a4e4078d544752a5dd507fd3f0e8ae3c770a7 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Sun, 4 Jan 2026 18:37:47 -0500 Subject: [PATCH] docs(readme): add interview bot documentation --- README.md | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..af1c697 --- /dev/null +++ b/README.md @@ -0,0 +1,159 @@ +# 🤖 Interview Bot + +AI-powered interviewer bot with video call interface and calendar scheduling, built on Cloudflare Workers. + +## Features + +- **📅 Calendar Scheduling** - Visual calendar with drag-and-click scheduling +- **📹 Video Call Interface** - Simulated video call with AI avatar +- **🧠 AI Interviewer** - Streaming responses via Workers AI + AI Gateway +- **💬 Real-time Chat** - Server-sent events for smooth streaming +- **📱 Responsive UI** - Works on desktop and mobile + +## Architecture + +``` +┌─────────────────────────────────────────────────────────┐ +│ Cloudflare Edge │ +│ ┌─────────────┐ ┌──────────────┐ ┌────────────────┐ │ +│ │ Worker │──│ AI Gateway │──│ Workers AI │ │ +│ │ (index.ts) │ │ (optional) │ │ (Llama 3.1 8B) │ │ +│ └──────┬──────┘ └──────────────┘ └────────────────┘ │ +│ │ │ +│ ┌──────┴──────┐ │ +│ │ KV Store │ ← Interview data │ +│ └─────────────┘ │ +└─────────────────────────────────────────────────────────┘ +``` + +## Quick Start + +### 1. Install dependencies + +```bash +npm install +``` + +### 2. Create KV namespaces + +```bash +# Create production namespace +npx wrangler kv namespace create INTERVIEWS + +# Create preview namespace for local dev +npx wrangler kv namespace create INTERVIEWS --preview +``` + +### 3. Update wrangler.toml + +Replace the placeholder IDs with the ones from the previous step: + +```toml +[[kv_namespaces]] +binding = "INTERVIEWS" +id = "" +preview_id = "" +``` + +### 4. (Optional) Configure AI Gateway + +For analytics, caching, and rate limiting: + +1. Create an AI Gateway in the Cloudflare dashboard +2. Uncomment and update the AI Gateway config in `wrangler.toml`: + +```toml +[ai.gateway] +id = "your-gateway-id" +``` + +### 5. Run locally + +```bash +npm run dev +``` + +Open http://localhost:8787 + +### 6. Deploy to production + +```bash +npm run deploy +``` + +## API Endpoints + +| Method | Endpoint | Description | +|--------|----------|-------------| +| GET | `/api/interviews` | List all interviews | +| POST | `/api/interviews` | Create new interview | +| PUT | `/api/interviews/:id` | Update interview | +| DELETE | `/api/interviews/:id` | Delete interview | +| POST | `/api/chat` | Stream AI chat response | + +## Interview Data Structure + +```typescript +interface Interview { + id: string; + candidateName: string; + email: string; + scheduledAt: string; // ISO 8601 + duration: number; // minutes + status: 'scheduled' | 'in-progress' | 'completed' | 'cancelled'; + notes: string[]; + transcript: string[]; +} +``` + +## Customization + +### Change AI Model + +In `src/index.ts`, update the model in `handleChat()`: + +```typescript +const stream = await env.AI.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', { + // ...options +}); +``` + +Available models: https://developers.cloudflare.com/workers-ai/models/ + +### Modify Interview Prompts + +Edit the `SYSTEM_PROMPT` constant in `src/index.ts` to customize: +- Interview style and tone +- Question categories +- Evaluation criteria + +### Add Real Video (WebRTC) + +To add actual video calls using Cloudflare Realtime: + +1. Enable Realtime SFU in your Cloudflare dashboard +2. Add the RealtimeKit SDK to the frontend +3. Replace the simulated video with real WebRTC streams + +See: https://developers.cloudflare.com/realtime/ + +## Tech Stack + +- **Runtime**: Cloudflare Workers +- **AI**: Workers AI with Llama 3.1 8B Instruct +- **Storage**: Cloudflare KV +- **Streaming**: Server-Sent Events (SSE) +- **Frontend**: Vanilla JS with inline styles + +## Cost Estimation + +| Resource | Free Tier | Paid | +|----------|-----------|------| +| Workers requests | 100k/day | $0.30/million | +| Workers AI | 10k neurons/day | $0.011/1k neurons | +| KV reads | 100k/day | $0.50/million | +| KV writes | 1k/day | $5.00/million | + +## License + +MIT