|
| 1 | +# HR Team Matcher |
| 2 | + |
| 3 | +A smart HR assistant that helps managers build optimal teams for projects using MongoDB Vector Search for semantic skills matching and the Vercel AI SDK for agentic capabilities. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Advanced Skill Matching**: Uses MongoDB Vector Search to find employees with the right skills, even when they're not an exact keyword match |
| 8 | +- **Multi-step Reasoning**: Uses Vercel AI SDK's agentic functionality to analyze projects, search for candidates, and evaluate team fit |
| 9 | +- **Team Analysis**: Evaluates skill coverage, team diversity, and past collaboration success |
| 10 | +- **Recommendations with Rationale**: Provides detailed justification for each team member suggestion |
| 11 | +- **Risk Assessment**: Identifies potential issues with proposed teams and suggests mitigation strategies |
| 12 | + |
| 13 | +## Architecture |
| 14 | + |
| 15 | +The HR Team Matcher is built with the following technologies: |
| 16 | + |
| 17 | +- **Next.js**: Frontend and API routes |
| 18 | +- **MongoDB**: Database with Vector Search for semantic skill matching |
| 19 | +- **Vercel AI SDK**: Agentic AI capabilities with multi-step reasoning |
| 20 | +- **Voyage AI**: Generation of text embeddings for semantic search |
| 21 | +- **OpenAI**: Language model for team analysis and recommendations |
| 22 | +- **Tailwind CSS**: Styling |
| 23 | + |
| 24 | +## How It Works |
| 25 | + |
| 26 | +1. **Project Analysis**: The agent analyzes the project description to extract required skills, team size, and timeline constraints |
| 27 | +2. **Skill Matching**: Using MongoDB Vector Search, the system finds employees with matching skills |
| 28 | +3. **Team Formation**: The agent explores different combinations to form an optimal team |
| 29 | +4. **Team Evaluation**: Each potential team is evaluated for skill coverage, diversity, and collaboration history |
| 30 | +5. **Recommendation**: The best team is recommended with detailed justifications and risk assessments |
| 31 | + |
| 32 | +## Getting Started |
| 33 | + |
| 34 | +### Prerequisites |
| 35 | + |
| 36 | +- Node.js 18.x or higher |
| 37 | +- MongoDB Atlas account (with Vector Search capability) |
| 38 | +- OpenAI API key |
| 39 | +- Voyage AI API key |
| 40 | + |
| 41 | +### Environment Setup |
| 42 | + |
| 43 | +1. Clone this repository |
| 44 | +2. Install dependencies: |
| 45 | + ``` |
| 46 | + npm install |
| 47 | + ``` |
| 48 | +3. Create a `.env.local` file with the following variables: |
| 49 | + ``` |
| 50 | + MONGODB_URI=your_mongodb_connection_string |
| 51 | + OPENAI_API_KEY=your_openai_api_key |
| 52 | + VOYAGE_API_KEY=your_voyage_api_key |
| 53 | + ``` |
| 54 | + |
| 55 | +### Database Setup |
| 56 | + |
| 57 | +1. Create a MongoDB Atlas cluster |
| 58 | +2. Create a database named `hr_database` |
| 59 | +3. Create the following collections: |
| 60 | + - `employees` |
| 61 | + - `teams` |
| 62 | +4. Set up the Vector Search index on the `employees` collection named `skill_vector_index`: |
| 63 | + ```json |
| 64 | + { |
| 65 | + "fields": [ |
| 66 | + { |
| 67 | + "type": "vector", |
| 68 | + "path": "embedding", |
| 69 | + "numDimensions": 1024, |
| 70 | + "similarity": "cosine" |
| 71 | + } |
| 72 | + ] |
| 73 | + } |
| 74 | + ``` |
| 75 | + |
| 76 | +### Running the Application |
| 77 | + |
| 78 | +1. Start the development server: |
| 79 | + ``` |
| 80 | + npm run dev |
| 81 | + ``` |
| 82 | +2. Open your browser and navigate to `http://localhost:3000` |
| 83 | + |
| 84 | +## Usage |
| 85 | + |
| 86 | +1. Navigate to the "Build New Team" tab |
| 87 | +2. Enter a detailed project description, including required skills, timeline, and any special requirements |
| 88 | +3. Click "Build Team" and wait for the AI to generate a team recommendation |
| 89 | +4. Review the recommended team, including skill coverage, member details, and risk assessment |
| 90 | +5. Saved teams can be viewed and approved in the "Team History" tab |
| 91 | + |
| 92 | +## Implementation Details |
| 93 | + |
| 94 | +### MongoDB Vector Search |
| 95 | + |
| 96 | +Skills are matched using semantic search, allowing the system to understand that "React experience" is related to "Frontend development" even without exact keyword matches. |
| 97 | + |
| 98 | +### Voyage AI Embeddings |
| 99 | + |
| 100 | +The Voyage AI model converts skill descriptions into vector embeddings that capture semantic meaning, enabling more intelligent matching. |
| 101 | + |
| 102 | +### Vercel AI SDK Agent |
| 103 | + |
| 104 | +The agent uses multiple tools in sequence to: |
| 105 | +1. Analyze projects with `analyzeProjectRequirements` |
| 106 | +2. Search for employees with `searchEmployeesBySkill` |
| 107 | +3. Analyze team compositions with `analyzeTeamComposition` |
| 108 | +4. Save recommended teams with `saveTeamToDatabase` |
| 109 | +5. Generate final recommendations with `generateTeamRecommendation` |
| 110 | + |
| 111 | +The `maxSteps: 15` parameter enables the agent to perform multiple tool calls in sequence, making it a true agentic application rather than a simple API wrapper. |
| 112 | + |
| 113 | +## License |
| 114 | + |
| 115 | +MIT |
0 commit comments