AI-powered system for automatically matching rejected candidates to alternative open positions.
When a candidate is rejected for a position, this system automatically:
- Parses their CV using Gemini AI
- Generates embeddings for skills, experience, and overall profile
- Searches for similar open positions using pgvector
- Consolidates and ranks matches
- Generates a detailed analysis memo for recruiters
- Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS
- Backend: Next.js API Routes, BullMQ workers
- Database: Supabase (PostgreSQL + pgvector)
- AI: Google Gemini 2.0 (CV parsing, embeddings, analysis)
- Workflow: LangGraph (parallel execution orchestration)
- Queue: BullMQ + Redis (background job processing)
- Node.js 18+ and npm
- Docker (for Redis)
- Supabase account
- Google Gemini API key
npm install- Create a new project at supabase.com
- Run the migration from
supabase-migration.sqlin the SQL Editor - Note your Project URL, anon key, and service_role key
Copy .env.example to .env.local:
cp .env.example .env.localFill in your credentials:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# Gemini
GEMINI_API_KEY=your-gemini-api-key
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000
NODE_ENV=developmentdocker-compose up -dQuick Start (Recommended):
npm run dev:concurrent # Starts all services at once with color-coded outputIndividual Services:
# Terminal 1: Next.js server
npm run dev
# Terminal 2: Workflow worker
npm run worker:workflow
# Terminal 3: Job indexing worker
npm run worker:indexingVisit http://localhost:3000
The project includes comprehensive Claude Code development tools:
# Initialize project management
/pm:init
# List available commands
/pm:help
# Show current development status
/pm:statusFor detailed setup, see the Developer Guide.
POST /api/candidates/reject
Content-Type: application/json
{
"candidate_id": "uuid",
"application_id": "uuid",
"rejection_reason": "Not enough experience"
}GET /api/workflow/status/[workflow_execution_id]POST /api/jobs/index
Content-Type: application/json
{
"company_id": "uuid",
"job_ids": ["uuid1", "uuid2"] // optional, indexes all active jobs if omitted
}The matching workflow uses LangGraph for orchestration:
START
β
Parse CV (Gemini)
β
βββ Retrieve by Skills (parallel)
βββ Retrieve by Experience (parallel)
βββ Retrieve by Profile (parallel)
β
Consolidate Matches (weighted scoring)
β
Generate Analysis (Gemini)
β
END
- Parallel Execution: Skills, experience, and profile searches run simultaneously
- Weighted Scoring: Skills (40%), Experience (35%), Profile (25%)
- Multi-source Boost: Jobs matching multiple criteria get a 5% boost per source
- Graceful Degradation: Workflow continues even if some retrievers fail
Key tables:
companies- Company informationjobs- Job postingsjob_embeddings- Vector embeddings for semantic searchcandidates- Candidate profilesparsed_cvs- Structured CV dataapplications- Job applicationsworkflow_executions- LangGraph workflow runsmatch_results- Matched jobs with scores
This project includes a comprehensive Claude Code development ecosystem with specialized agents and tools.
- 9 Specialized Agents: Code analysis, testing, documentation, design review, and more
- 50+ Project Management Commands: Epic/issue tracking, PRD management, workflow automation
- Automated Testing: Comprehensive test execution with real services (no mocking)
- Smart Documentation: Auto-generated and updated documentation
- Epic-Based Development: Organize work around large features rather than individual issues
# Project Management
/pm:init # Initialize new epic
/pm:status # Show current work status
/pm:next # Get next task
/pm:standup # Generate standup report
# Development Workflow
/review # Code review mode
/testing:run # Run tests with analysis
/commit # Smart commit with validation
/prompt <task> # Get AI assistance
# Get Help
/pm:help # List all available commandsFor complex tasks, agents work together automatically:
# Example: Add new feature
Task agent_type="workflow-orchestrator" description="Add user authentication"This will coordinate multiple agents to:
- Analyze requirements
- Create implementation plan
- Build the feature
- Write tests
- Update documentation
- Perform code review
For complete documentation, see the Developer Guide.
Use the specialized test-runner agent for comprehensive testing:
# Run all tests with analysis
Task agent_type="test-runner" description="Run full test suite"
# Test specific functionality
Task agent_type="test-runner" description="Test authentication endpoints"To test the workflow manually:
- First, index some jobs:
curl -X POST http://localhost:3000/api/jobs/index
-H "Content-Type: application/json"
-d '{"company_id": "00000000-0000-0000-0000-000000000001"}'-
Create a candidate and application (via Supabase dashboard or API)
-
Reject the candidate to trigger matching:
curl -X POST http://localhost:3000/api/candidates/reject
-H "Content-Type: application/json"
-d '{
"candidate_id": "your-candidate-uuid",
"application_id": "your-application-uuid",
"rejection_reason": "Overqualified"
}'- Check the workflow status:
curl http://localhost:3000/api/workflow/status/[workflow_id]- CV Parsing: ~2-4 seconds
- Embedding Generation: ~1 second per type (3 parallel)
- Vector Search: <100ms per query (with HNSW index)
- Match Consolidation: <50ms
- Analysis Generation: ~3-5 seconds
- Total Workflow: ~10-15 seconds
Per candidate workflow:
- Gemini Parsing: ~$0.02
- Embeddings (3 types): ~$0.06
- Vector Search: ~$0.01
- Analysis: ~$0.03
- Total: ~$0.12 per candidate
- Set up proper authentication
- Configure Row Level Security (RLS) in Supabase
- Set up monitoring and alerting
- Configure rate limiting
- Set up error tracking (e.g., Sentry)
- Deploy workers to production (e.g., Railway, Render)
- Set up CI/CD pipeline
- Configure backup strategy
- Set up log aggregation
- Performance testing
- API Documentation - Complete API reference with validation rules
- Developer Guide - Development workflow and Claude Code infrastructure
- Error Handling Guide - Common errors and troubleshooting
- Error Notes - Recent fixes and resolved issues
MIT
We use epic-based development with Claude Code infrastructure:
- Initialize Epic: Use
/pm:initto start new features - Follow Patterns: See Developer Guide for workflow
- Use Agents: Leverage specialized agents for code quality and testing
- Smart Commits: Use
/commitfor validated commits
Contributions welcome! Please open an issue or PR.
For questions or issues:
- Debug with Claude Code: Use
Task agent_type="code-analyzer" description="Investigate issue" - Check Documentation: Review Error Handling Guide
- GitHub Issues: Open an issue for bugs or feature requests
- Developer Help: Use
/pm:helpfor command assistance