The GradGather recommender exposes a single REST endpoint served by a Flask development server. It accepts a person’s name and an optional result count, then returns a JSON object mapping the most similar profiles to their cosine similarity scores. The endpoint is intentionally lightweight — no authentication, no pagination, no request body — making it easy to call from any part of the frontend or to test directly withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/meenalsingh0/GradGather/llms.txt
Use this file to discover all available pages before exploring further.
curl.
Base URL
5000. This is a development server; for production deployments the base URL and port would be updated to reflect the hosting environment.
The main GradGather Node.js application runs on
http://localhost:3000. Both servers must be running simultaneously for the recommender UI to function. See the Overview for startup instructions.GET /recom
Returns the top N most similar people to the specified person, ranked by cosine similarity score in descending order. Method:GETPath:
/recom
Query Parameters
The full name of the person to find recommendations for. The value must match a
Person entry in the loaded CSV dataset exactly, including capitalisation and spacing. URL-encode names that contain spaces (e.g. Meenal+Singh or Meenal%20Singh).The number of recommendations to return. Defaults to
5 when omitted. The server parses this with int(request.args.get('n', 5)), so non-integer values will raise a ValueError at runtime.Example Request
Example Success Response
The response is a flat JSON object. Each key is a person’s name and each value is their cosine similarity score — a float between0.0 (no shared interests) and 1.0 (identical interest profile). Results are pre-sorted in descending order by score.
Error Responses
The API returns a JSON error object for two failure conditions. Missingperson_name parameter — HTTP 400
Returned when the person_name query parameter is absent entirely.
person_name is present but does not match any row in the loaded CSV. Note that the HTTP status code is 200 in this case, since the Flask route handler returns the dictionary directly without setting a status code for this branch.
How Scores Are Calculated
Cosine similarity measures the angle between two vectors in multi-dimensional space — in this case, each person’s binary interest vector. For two people A and B with interest vectors a and b:- A score of 1.0 means the two people have identical interests (their vectors point in exactly the same direction).
- A score of 0.0 means they share no interests at all (their vectors are perpendicular).
- All real matches fall somewhere between these extremes.
0 or 1), the dot product a · b is simply the count of interests both people share. The denominator normalises for the total number of interests each person holds, so someone with five interests matching another person’s five interests scores higher than if one of them had fifteen interests and only matched five.
Identical profiles
Two people with the exact same set of interests score 1.0, regardless of how many interests they share in total.
No shared interests
Two people with completely disjoint interest sets score 0.0 — their vectors are orthogonal.
Adding People to the Dataset
The recommender reads its data at startup, so adding a new person is a matter of appending a row to the CSV file and restarting the Flask server.CSV Structure
Each row must follow this schema exactly (column order matters):tempelates/people_recommender_dataset.csv — eleven interest columns, no Mysql. The alternative dataset at people/database.csv adds a twelfth Mysql column; make sure you add to the correct file for the server instance you are running.
Example: Adding a New Profile
0.
After saving the file:
The similarity matrix is recomputed from scratch on every server start. There is no incremental update mechanism — adding one person recalculates all pairwise scores across the entire dataset.
Example: Fetching Recommendations from JavaScript
The following snippet mirrors the pattern used intempelates/recom.js and can be dropped into any part of the GradGather frontend.
mode: 'cors' option is required because the frontend origin (localhost:3000) differs from the API origin (localhost:5000). Flask’s CORS(app) configuration permits this cross-origin request.