A powerful AI-driven matchmaker for dating apps that uses Gemini embeddings and Pinecone vector database to find highly compatible matches based on personality, interests, and lifestyle. It uses Google's Gemini AI to understand the "vibe" of a user's profile (their personality, interests, and lifestyle) by converting their profile into a numerical representation called an "embedding." These embeddings are stored in a Pinecone vector database, which allows for very fast and efficient searching of similar users.
It also ultilize Rule-based Compatibility Filtering which applies a set of rules to filter and rank potential matches based on user preferences like age, gender, relationship goals, and other "deal-breakers."
- AI-Powered Matching: Uses Google's Gemini API to generate semantic embeddings from user profiles
- Vector Similarity Search: Leverages Pinecone for fast and accurate similarity matching
- Smart Compatibility Filtering: Filters matches based on preferences (age, gender, lifestyle, education)
- Comprehensive Scoring: Combines embedding similarity (60%) and preference compatibility (40%)
- RESTful API: Simple endpoints to embed users and find matches
Each user profile (bio, interests, lifestyle, occupation) is converted into a rich text representation, then transformed into a 768-dimensional vector using Gemini's text-embedding-004 model.
All user vectors are stored in Pinecone, a specialized vector database optimized for similarity search.
When finding matches for a user:
- Generate an embedding for the user's profile
- Query Pinecone to find the nearest neighbor vectors (cosine similarity)
- Filter results based on compatibility preferences
- Calculate a combined score:
60% similarity + 40% compatibility - Return the top matches sorted by overall score
- Node.js (v18+)
- Gemini API Key - Get one here
- Pinecone Account - Sign up here
npm installCopy .env.example to .env and fill in your credentials:
cp .env.example .envGEMINI_API_KEY=your_gemini_api_key_here
PINECONE_API_KEY=your_pinecone_api_key_here
PINECONE_INDEX_NAME=datie-ai-matchmakingIn your Pinecone dashboard, create a new index with:
- Name:
datie-ai-matchmaking(or your chosen name) - Dimensions:
768 - Metric:
cosine
npm run devThe server will start on http://localhost:3000
Get API information and available endpoints
Response:
{
"message": "Datie AI - Modern Dating Matchmaking Engine",
"endpoints": {
"POST /embed-users": "Embed all user profiles and store in Pinecone",
"GET /match/:userId": "Find matches for a specific user",
"GET /users": "Get all users",
"GET /users/:userId": "Get a specific user"
}
}List all available users
Response:
{
"total": 50,
"users": [
{
"userId": "dc2a5a7b-e91b-4b1a-9c7f-3d6e5a4b1c2d",
"firstName": "Ethan",
"age": 29,
"gender": "Male",
"location": { "city": "Boulder", "state": "CO" },
"bio": "Environmental scientist who feels most at home..."
}
]
}Get details for a specific user
Example: GET /users/dc2a5a7b-e91b-4b1a-9c7f-3d6e5a4b1c2d
Important: Run this once to initialize the vector database
Embeds all user profiles and stores them in Pinecone.
Response:
{
"message": "Embedding complete",
"total": 50,
"success": 50,
"failed": 0,
"errors": []
}Find matches for a specific user
Parameters:
userId(path): The user ID to find matches fortopK(query, optional): Number of matches to return (default: 10)
Example: GET /match/dc2a5a7b-e91b-4b1a-9c7f-3d6e5a4b1c2d?topK=5
Response:
{
"message": "Matches found!",
"forUser": {
"userId": "dc2a5a7b-e91b-4b1a-9c7f-3d6e5a4b1c2d",
"firstName": "Ethan",
"age": 29,
"gender": "Male",
"location": { "city": "Boulder", "state": "CO" }
},
"totalMatches": 5,
"matches": [
{
"userId": "c4d5e6f7-a8b9-4c1d-a2b3-d4e5f6a7b8c9",
"firstName": "Sophia",
"age": 30,
"gender": "Female",
"location": { "city": "San Diego", "state": "CA" },
"bio": "Yoga instructor and wellness advocate...",
"occupation": "Yoga Instructor",
"interests": ["Yoga", "Meditation", "Beach", "Dogs"],
"profileImages": ["https://example.com/..."],
"similarityScore": 0.92,
"compatibilityScore": 85,
"overallScore": 89
}
]
}First, embed all users into Pinecone:
curl -X POST http://localhost:3000/embed-usersThis will process all users and store their embeddings in Pinecone (takes ~5-10 seconds).
Get matches for a user (e.g., Ethan):
curl http://localhost:3000/match/dc2a5a7b-e91b-4b1a-9c7f-3d6e5a4b1c2d?topK=5You'll get the top 5 most compatible matches!
List all users to find different userIds:
curl http://localhost:3000/usersThen try matching for different personalities and preferences.
The matching system uses a two-stage approach:
- Converts profiles to semantic embeddings using Gemini
- Finds nearest neighbors using cosine similarity in Pinecone
- Captures personality "vibe" and lifestyle compatibility
- Age Range: Must fall within both users' preferences
- Gender Preference: Must match what each is looking for
- Smoking/Drinking: Respects deal-breakers
- Children: Aligns family goals
- Education: Matches education preferences
- Pets: Respects "must love dogs/cats" preferences
- Shared Interests: Bonus points for common hobbies
Overall Score = (Similarity × 0.6 × 100) + (Compatibility × 0.4)
datie-ai/
├── src/
│ ├── data/
│ │ └── users.json # Sample user profiles
│ ├── services/
│ │ ├── embedding.ts # Gemini embedding service
│ │ ├── pinecone.ts # Pinecone client setup
│ │ └── matchmaking.ts # Core matching logic
│ ├── utils/
│ │ ├── profileToText.ts # Profile to text conversion
│ │ └── compatibility.ts # Compatibility checking
│ └── index.ts # Main API server
├── .env.example # Environment variables template
├── package.json
├── tsconfig.json
└── README.md
Converts a user profile into rich text that captures their personality, interests, and preferences.
Generates a 768-dimensional embedding vector using Gemini's text-embedding-004 model.
Embeds a single user and stores in Pinecone with metadata.
Calculates a 0-100 compatibility score based on preferences and shared interests.
Main matching function that combines AI similarity with preference compatibility.
- Rate Limiting: Add rate limiting to embedding endpoints
- Caching: Cache embeddings to avoid re-computing
- Batch Processing: Process embeddings in background jobs
- Monitoring: Add logging and error tracking
- Security: Add authentication and authorization
- Pagination: Implement pagination for large result sets
- Distance Filtering: Add geographic distance filtering
- Real-time Updates: Webhook for profile updates
- Hono: Fast, lightweight web framework
- Google Gemini: Advanced AI embeddings
- Pinecone: Vector database for similarity search
- TypeScript: Type-safe development
- Node.js: Runtime environment