All work

Giving Connection · 2025

Smart Match: helping people find the right nonprofit, faster.

A hybrid recommender I designed, built, and shipped to production. It turns a short quiz into ranked, explainable nonprofit matches, and it cut Time-to-Success by 80% for 15,500+ users.

Role
Platform Development & ML Intern
Timeline
Jun to Aug 2025 · Stanford, CA
Live
givingconnection.org ↗

The problem

Finding the right nonprofit is confusing. People face long lists, unclear categories, and inconsistent descriptions, and many give up before they reach the help they need.

Nonprofits have the opposite problem: poor discovery, low visibility, and mismatched search terms keep them from reaching the right people.

The opportunity

Replace keyword search with matching. A short branching quiz helps people say what they need, and their answers become semantic vectors, so recommendations get more personal and much less overwhelming.

My role

Product strategy

Scoped the user journey, defined matching requirements, and shaped the branching quiz that feeds the engine.

ML systems

Researched models, wrote the embedding and matching code, and validated outputs with real nonprofit data.

Front end

Designed and coded the quiz experience, prototyped it, and iterated on clarity and match relevance.

How it works

Rule filtersNarrow the candidate set
Dense retrievalbge-large-en-v1.5, 1024-d embeddings
Re-ranking26 config-driven attribute rules
Explained matchesReasons shown, feedback captured
A hybrid pipeline: hard rules first, semantic retrieval second, interpretable re-ranking last.
  • Data. I wrote the Python embedding ETL over 928 nonprofits, with regex section extraction and batched inference.
  • Integration. I built a Ruby/Python bridge into Rails 7.2, with synonym query expansion and a PostGIS fallback.
  • Trust. Every match comes with its reasons, and feedback capture means the next iteration starts from evidence.

Feature by feature

Branching quiz

A quiz that branches by who you are

The first question decides the path. Seekers answer 12 steps across 36 causes, and volunteers and donors get shorter paths with 14. Causes become structured filters, and the free-text answer at the end is embedded and matched by meaning.

Matching

Rules, then meaning, then reasons

A location filter narrows the field first. Dense retrieval with bge-large-en-v1.5 finds what sits closest to the person's own words across 928 embedded nonprofits, and a weighted score ranks what is left. The dots are a diagram; the names and scores at the end are the live results.

Results

Ranked, with reasons

Each match carries its score and the answers it met, so a Great Match label always comes with the why.

Transparency

Honest about the gaps

How we matched you lists everything the person said mattered and how the results measure up. When a nonprofit hasn't published something, the page marks it Not stated and suggests asking them directly.

Filters

Narrow by service

An optional service filter, with a count beside each service of how many of the matches offer it.

Architecture

Rails runs the quiz, filters, scores and ranks. Python does one job: it turns text into vectors. The embedding matrix is the only link between the offline pipeline and live ranking.

Browser

QuizStimulus controller, three Slim quiz paths, answers kept in the Rails session
Results page10 cards built from ViewComponents, with a like and dislike on each

Rails 7.2 app

Quiz controllerFive routes; branches on seeker, volunteer and donor
Intent converterTurns answers into a profile: type, state, city, travel, causes, preferences
Recommendation serviceFilter by state, build the query text, score, rank the top 10

Python, conda env

Query embeddingBGE-large turns the query into 1024 numbers

Offline pipeline

Matrix builderCleans, labels and embeds the 928-row catalog in batches of 16

Files the service reads

Embedding matrix928 nonprofits × 1024 dimensions, 29 MB
Matching rulesWeights, synonyms, cause mappings, 26 attribute rules
City coordinatesCoordinates for 243 cities
If the service fails, the controller falls back to the app's PostGIS search.
  1. Quiz. One step at a time; the answers live in the Rails session, so the quiz survives a reload and the Back button.
  2. Intent. The answers become a profile, with quiz causes mapped to the config's cause keys.
  3. Validation. With no causes selected, the service stops early.
  4. Filtering. Keep the nonprofits in the person's state.
  5. Query text. Causes expanded with synonyms, plus language, accessibility needs and city, written as one string.
  6. Query embedding. BGE with its retrieval prefix, "Represent this sentence for searching relevant passages:".
  7. Scoring. Every candidate gets the weighted score below.
  8. Ranking. Sort, keep the top 10, and write each one's reason, listing the causes it serves.
  9. Display and feedback. The set is labeled by its best score, and each card takes a like or a dislike.

Scoring

Each nonprofit's score blends three parts, with every weight set in a config file, so tuning needs no code change.

final = 0.70 × similarity + 0.20 × attribute bonus + 0.10 × distance

0.70 Similarity0.20 Attributes0.10 Distance
Similarity

Cosine, on BGE vectors

The query and each nonprofit are embedded separately, and the score is the cosine between them, nudged up for nonprofits that list several causes.

Attribute bonus

26 rules, capped at 0.20

12 for seekers, 7 for volunteers and 7 for donors, worth 0.04 to 0.08 each: LGBTQ+ affirming 0.08, wheelchair access 0.07, sliding-scale pricing 0.06.

Distance

Haversine, in buckets

Miles to 243 city centroids, scored from 1.00 within 2 miles down to 0.70 past 25.

Results are labeled by match strength: 0.7 and up is strong, 0.4 moderate, 0.2 weak.

Data

928 nonprofits, by state

Tennessee and New Jersey hold Giving Connection's two communities, Nashville and Atlantic City.

Tennessee
575
New Jersey
196
California
76
Other states
47
No state listed
34
  • 1,024numbers per nonprofit vector
  • 29 MBembedding matrix
  • 62%of nonprofits list more than one cause
  • 44cause synonym lists for query expansion
  • 31mappings from scraped cause labels to quiz categories
  • 10ranked matches per request

Embedding pipeline

One batch job turns the scraped catalog into the matrix the service ranks against.

ExtractRead the scraped CSV: 928 rows with name, URL, mission, causes, city, state and address
TransformClean the text, pull Mission, Vision and Services out with regex, and join one labeled string per nonprofit
EmbedBGE-large in batches of 16, CLS pooling, L2-normalized
LoadA JSON matrix: each nonprofit's details plus its 1024-number vector
Each string reads Organization, Mission, Vision, Services, Causes, Location, Address, so the model sees the same structure for every nonprofit.

Stack and techniques

Web framework
Ruby on Rails 7.2, Ruby 3.2, Puma
Frontend
Hotwire (Turbo and Stimulus), Tailwind CSS, ViewComponent, Slim and ERB
Database
PostgreSQL with PostGIS
Embedding runtime
Python 3.11 in a conda environment
ML libraries
sentence-transformers, PyTorch, NumPy, scikit-learn
Model
BAAI/bge-large-en-v1.5: 1024 dimensions, 512-token input
Ruby to Python
A Ruby subprocess (Open3) that runs the conda environment
Storage
JSON matrix, CSV, YAML config
Testing
RSpec, FactoryBot, Capybara; 14 controller tests
  • Dense semantic retrieval with a bi-encoder: query and nonprofits embedded separately, compared by cosine.
  • Asymmetric retrieval: BGE's instruction prefix on the query only.
  • Structured document text: labeled fields joined before encoding.
  • Query expansion from 44 synonym lists.
  • Label harmonization: 35 scraped cause labels mapped onto quiz categories.
  • Hybrid ranking: a hard filter, then semantic similarity, then a config-weighted score.
  • Configuration over code: weights, synonyms, mappings and rules all in YAML.
  • Branching intake: one opening question routes to three quiz paths.
  • Explainable results: a reason per match and match-strength labels.
  • Explicit feedback: a like or dislike per result, stored with the answers.
  • Graceful degradation: a service error falls back to PostGIS search.

What I learned

Design clarity shapes user confidence.

Clearer questions, guided flows, and simple visual cues didn't just improve usability. They made people feel more certain and supported in stressful moments.

The model only works when the system works.

A matching engine isn't defined by its embeddings alone. Impact came from aligning the quiz, the ranking logic, the UI, and people's expectations into one flow.