Skip to content
Merged
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
101 changes: 100 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ See [Pipeline Setup Guide](./.github/PIPELINE_SETUP.md) for configuration detail
- **Candidate Management**: Create, read, update, and delete candidate profiles
- **Job Position Management**: Manage job postings with detailed requirements
- **Application Tracking**: Track job applications and their statuses
- **πŸš€ AI-Powered Matching**: Semantic search-based candidate-job matching using OpenAI embeddings
- **Vector Search**: ChromaDB for efficient similarity search and ranking
- **Smart Filtering**: Metadata-based filtering with location, experience, salary, etc.
- **Auto-Sync**: Automatic synchronization of candidates and jobs to vector database
- **Schema Validation**: Robust input validation using Zod
- **Type Safety**: Full TypeScript implementation with Prisma-generated types
- **Database Relations**: Properly structured database with foreign key relationships
Expand All @@ -34,6 +38,8 @@ See [Pipeline Setup Guide](./.github/PIPELINE_SETUP.md) for configuration detail
- **Language**: TypeScript
- **Database**: PostgreSQL
- **ORM**: Prisma
- **Vector Database**: ChromaDB
- **AI/ML**: OpenAI Embeddings API
- **Validation**: Zod
- **Development**: Nodemon, ts-node

Expand Down Expand Up @@ -180,14 +186,26 @@ DATABASE_URL="postgresql://username:password@localhost:5432/database_name?schema

# Server
PORT=3000
# Optional: Add other environment-specific variables
NODE_ENV=development

# OpenAI API (required for AI matching)
OPENAI_API_KEY=your_openai_api_key_here

# ChromaDB (for vector search)
CHROMA_HOST=localhost
CHROMA_PORT=8000
CHROMA_URL=http://localhost:8000
```

### Environment Variable Descriptions

- `DATABASE_URL`: PostgreSQL connection string
- `PORT`: Port number for the server (default: 3000)
- `NODE_ENV`: Environment mode (development, production, test)
- `OPENAI_API_KEY`: **Required** - OpenAI API key for generating embeddings
- `CHROMA_HOST`: ChromaDB server host (default: localhost)
- `CHROMA_PORT`: ChromaDB server port (default: 8000)
- `CHROMA_URL`: Full ChromaDB server URL

## Database Setup

Expand All @@ -211,6 +229,87 @@ npx prisma generate
npx prisma studio
```

## ChromaDB Setup

### Option 1: Docker (Recommended)
```bash
# Pull and run ChromaDB
docker pull chromadb/chroma
docker run -p 8000:8000 chromadb/chroma
```

### Option 2: Local Installation
```bash
# Install ChromaDB
pip install chromadb

# Run ChromaDB server
chroma run --host localhost --port 8000
```

### Verify ChromaDB is Running
```bash
curl http://localhost:8000/api/v1/heartbeat
```

## AI Matching System

### Initial Setup
1. **Get OpenAI API Key**: Visit [OpenAI Platform](https://platform.openai.com/) and create an API key
2. **Add to Environment**: Set `OPENAI_API_KEY` in your `.env` file
3. **Start ChromaDB**: Ensure ChromaDB is running on port 8000
4. **Sync Data**: Use the sync endpoints to populate the vector database

### Matching API Endpoints

#### Health Check
```http
GET /api/matching/health
```

#### Find Matching Jobs for Candidate
```http
GET /api/matching/candidates/{candidateId}/jobs?limit=10&location=Istanbul&remote_ok=true
```

#### Find Matching Candidates for Job
```http
GET /api/matching/jobs/{jobId}/candidates?limit=10&availability=immediate&min_experience=2
```

#### Sync Individual Items
```http
POST /api/matching/sync/candidates/{candidateId}
POST /api/matching/sync/jobs/{jobId}
```

#### Bulk Sync
```http
POST /api/matching/sync
Content-Type: application/json

{
"type": "all" // or "candidates" or "jobs"
}
```

### Query Parameters for Job Matching
- `limit`: Number of results (default: 10)
- `location`: Filter by location
- `remote_ok`: Filter by remote work availability (true/false)
- `experience_level`: Filter by experience level (entry, mid, senior, lead)
- `employment_type`: Filter by employment type (full_time, part_time, contract, internship)
- `salary_min`: Minimum salary filter
- `salary_max`: Maximum salary filter

### Query Parameters for Candidate Matching
- `limit`: Number of results (default: 10)
- `location`: Filter by location
- `availability`: Filter by availability (immediate, within_week, within_month, not_available)
- `min_experience`: Minimum years of experience
- `max_experience`: Maximum years of experience
- `max_salary_expectation`: Maximum salary expectation

## Running the Application

### Development Mode
Expand Down
Loading