JobSMART Recommendation Engine
embeddings
cosine similarity
semantic search
vector database
IVFFlat indexing
pipeline summarizer
Goal
A recommendation engine that finds the best matching jobs for job seekers, from 100,000+ LinkedIn listings in under 100 milliseconds using semantic search.
What I Built
I designed and implemented a semantic search engine that matches job seekers with relevant roles from a 100,000+ entry dataset in under 100ms. The system overcomes a key limitation of traditional keyword-based search—where searching "software engineer" would miss "developer" or "programmer" roles—by understanding intent through vector embeddings.
Methodology
I broke down this project into four stages:
1. Data Cleaning
- Started with a public dataset of over 100,000 LinkedIn job postings. Raw data was messy—missing company names, null salary values, malformed timestamps, and duplicate entries.
- Built a Python ETL pipeline using pandas to clean and normalize everything. Missing company names were filled with 'Unknown', salary fields were set to 0.0 for consistency, and timestamps were converted from Unix milliseconds to PostgreSQL-compatible format.
- Designed a normalized PostgreSQL schema with four tables — company, job, job_embedding, and posting — to organize the relational data efficiently.
- Implemented per-row transaction rollback to gracefully handle data quality issues.
- If a single malformed record caused an insertion failure, the transaction rolled back and the cursor reset, but processing continued on the next row. This prevented one bad record from crashing the entire 100,000-row batch.
2. Embeddings
- Converted text into vectors that preserved meaning.
- Used the all-MiniLM-L6-v2 sentence transformer model, which produces 768-dimensional embeddings. This model runs efficiently on a CPU (no GPU required) while still capturing semantic relationships well enough for a recommendation engine.
- Each job description was passed through the model to generate a dense vector representation, and each vector was normalized using L2 normalization so cosine similarity could be computed as a simple dot product for faster query performance.
- Embedding generation was the bottleneck during ingestion — processed rows in batches and committed to the database every 100 rows.
- Instead of adding a separate vector database, used PostgreSQL with the pgvector extension.
- This allowed storing both relational data (jobs, companies, postings) and vector embeddings in a single unified database.
- The
job_embeddingtable stores the 768-dimensional vectors in a dedicatedVECTORcolumn with a 1:1 relationship to each job, enforced by aUNIQUEconstraint.
3. Indexing
- Core performance challenge: exact cosine similarity search takes several seconds to scan all 100,000+ vectors for every query.
- Solution: implemented an IVFFlat (Inverted File Flat) index, which partitions the embedding space using k-means clustering.
- Calculated the optimal number of buckets dynamically using the formula
10 * sqrt(row_count), then floored to the nearest 10 because PostgreSQL requires thelistsparameter to be a multiple of 10. - At query time, the index identifies only the closest buckets to the query vector and searches within those clusters, dramatically reducing the search space.
- The index creation is idempotent (drops any existing index before creating a new one) to allow safe reruns of optimization as the dataset grows.
4. UX and Summarizer
- Built an LLM-based agent that pre-computes concise summaries for each job description.
- The agent was prompted to extract the top three key responsibilities, the three most important required skills, and one sentence about why someone would want this job.
- These summaries are stored in the database and displayed alongside search results, allowing users to quickly glance at multiple recommendations without reading full job descriptions.
- When a user enters a query, the same sentence transformer converts it into a normalized 768-dimensional embedding.
- PostgreSQL's cosine distance operator (
<=>) compares the query embedding against all indexed job embeddings, efficiently finding the k nearest neighbors using the IVFFlat index. - The system then retrieves the corresponding job details (title, description, summary, salary, company, and location) from the job table and returns the results.
Results
- Query performance: Reduced average response time from several seconds to under 100ms with IVFFlat indexing.
- Semantic accuracy: Queries for "data scientist" return data analyst, ML engineer, and AI researcher roles—results that keyword search would miss.
- Efficient architecture: Eliminated the need for a separate vector database by consolidating into PostgreSQL with pgvector.