Semantic search & matching engine
AI Mentor Matcher
An intelligent matchmaking platform pairing mentors and mentees based on professional goals, industry experience, and skill profiles.
Outcome
Developed a dual-mode search engine combining traditional keyword searches with high-dimensional vector embeddings for superior semantic relevance.
Problem
Traditional keyword matching fails when mentors and mentees use different terminology for similar concepts or career aspirations.
Approach
Leveraged PostgreSQL pgvector plugin to calculate cosine similarity (<=>) between high-dimensional vector embeddings generated by OpenAI.
Architecture
A serverless Next.js App Router project querying a PostgreSQL database using Prisma ORM. Search queries are mapped to embeddings on-the-fly and processed in-database via pgvector.
Result
Highly accurate mentor matching that surfaces relevant mentors even without exact phrase matches.
Lessons learned
Direct vector math on the database layer significantly outperforms in-memory comparisons as the dataset grows.
Constraints
- Keep response latency low for live searches.
- Prisma-compatible vector storage and similarity scoring.
- Mitigate API cost overhead of generating search query embeddings.
Technical decisions
- • Utilized text-embedding-ada-002 for robust and cost-effective embeddings.
- • Implemented raw SQL similarity queries via Prisma $queryRaw for precise similarity control.
- • Created a hybrid approach fallback using full-text search when database connections or API rates limit vector queries.
Key features
- • High-dimensional vector embedding search.
- • Semantic similarity threshold controls.
- • Full-text keyword fallback match queries.