An intelligent interview question generator that uses AI and vector embeddings to create and store relevant questions for any skill.
- 🤖 AI-Powered Generation: Uses OpenAI GPT-4.1 to generate relevant interview questions
- 🔍 Vector Embeddings: Stores question embeddings using OpenAI's text-embedding-3-small model
- 💾 Smart Caching: Automatically caches generated questions to avoid redundant AI calls
- 🎯 Skill-Based Organization: Organizes questions by specific skills
- ⚡ Fast Performance: Built with Next.js 15 and Turbopack for optimal development experience
- Frontend: Next.js 15, React 19, TailwindCSS 4
- Backend: Next.js API Routes
- Database: PostgreSQL with Prisma ORM
- AI: OpenAI GPT-4.1 for generation, text-embedding-3-small for embeddings
- Language: TypeScript
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Frontend UI │───▶│ API Routes │───▶│ PostgreSQL │
│ │ │ │ │ │
│ - Skill Input │ │ - Question Gen │ │ - Skills │
│ - Question List │ │ - Embeddings │ │ - Questions │
│ │ │ - Caching │ │ - Embeddings │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ OpenAI API │
│ │
│ - GPT-4.1 │
│ - Embeddings │
└──────────────────┘
- Node.js 18+
- PostgreSQL database
- OpenAI API key
-
Clone the repository
git clone <your-repo-url> cd jd-vector
-
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:# OpenAI API Configuration OPENAI_API_KEY=your_openai_api_key_here # Database Configuration DATABASE_URL="postgresql://username:password@localhost:5432/jd_vector"
-
Set up the database
# Generate Prisma client npx prisma generate # Run database migrations npx prisma migrate deploy # (Optional) Open Prisma Studio to view data npx prisma studio
-
Start the development server
npm run dev
-
Open your browser
Navigate to
http://localhost:3000 -
Generate questions
- Enter a skill name (e.g., "React", "Python", "Machine Learning")
- Click "Generate Questions"
- View the AI-generated interview questions
- Input: User enters a skill name
- Check Cache: System checks if questions already exist for this skill
- Generate: If not cached, generates 5 new questions using OpenAI GPT-4.1
- Embed: Creates vector embeddings for each question using OpenAI's embedding model
- Store: Saves questions and embeddings to PostgreSQL database
- Return: Displays questions to the user
-- Skills table
model Skill {
id Int @id @default(autoincrement())
name String @unique
questions Question[]
}
-- Questions table with embeddings
model Question {
id Int @id @default(autoincrement())
skill Skill @relation(fields: [skillId], references: [id])
skillId Int
text String
embedding Json -- Vector embeddings stored as JSON
}POST /api/skills/generate- Generate questions for a skill- Body:
{ "skillName": "React" } - Response:
{ "questions": [...], "source": "generated|existing" }
- Body:
npm run dev- Start development server with Turbopacknpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
# View your data
npx prisma studio
# Reset database (caution: deletes all data)
npx prisma migrate reset
# Deploy migrations to production
npx prisma migrate deploy- Questions are automatically cached after first generation
- Subsequent requests for the same skill return existing questions instantly
- Reduces API costs and improves response times
- Each question is converted to a vector embedding
- Enables future semantic search capabilities
- Stored efficiently in PostgreSQL as JSON
- Uses GPT-4.1 for high-quality question generation
- Prompts optimized for interview-style questions
- Text-embedding-3-small for efficient vector creation
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- 🔍 Semantic Search: Find similar questions using vector similarity
- 📊 Analytics: Track question usage and effectiveness
- 🎨 Enhanced UI: More interactive and visual question management
- 🔒 Authentication: User accounts and personal question libraries
- 📱 Mobile App: React Native companion app
- 🤝 Question Sharing: Community-driven question sharing
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Include error messages, environment details, and steps to reproduce
Built with ❤️ using Next.js, OpenAI, and PostgreSQL