Repository navigation
TIG-306: Add location and event similarity signals to the For You feed - #65
Conversation
|
The deploy already applies migration 0007 on its own: deploy/run-release.sh runs tools/migrate.js before switching traffic, and the post-deploy sync fills in area for synced venues. One step is still manual, though. db:setup-recommendations isn't in the release package, so staging and production never get event_tag_embeddings loaded, and the similarity signal will score 0 for everyone there. Since the script is safe to re-run, could you run it on every deploy? deploy/build-release.sh, next to the other tools: bun build "$root/apps/database/src/setup-recommendations.ts" --target=bun --outfile "$stage/tools/setup-recommendations.js" >/dev/null (The script reads ${import.meta.dir}/seeddata/eventTags_embeddings.json at runtime, so once it's bundled into tools/, the JSON has to sit at tools/seeddata/. Alternatively, switch to a static JSON import so it's bundled inline.) deploy/run-release.sh, right after the migrate line: "$bun" --env-file="$root/shared/environment" "$dir/tools/setup-recommendations.js" It runs before traffic moves, so a failure aborts the deploy and the current release keeps serving. Please also update the Deployment section of the PR description and docs/ranking.md so they no longer list it as a manual step, and mention that you checked it with deploy/build-release.sh locally (the bundled script finds the JSON and exits 0) after you check it. Otherwise this looks good to me, thanks so much! |
|
Changed it so that the recommendation setup now runs automatically after migrations and before switching releases and updated the docs |
Summary
Complete the recommendation algorithm by ranking events using students’ preferred campus areas and similarity to their saved/RSVP’d events.
Data and sync
InboxEngine’s implementation and submodule reference are unchanged. No new embedding service or per-event embedding storage is required.
Validation
Deployment
Recommendation setup now runs automatically on every staging and production deploy.
deploy/build-release.shbundlestools/setup-recommendations.jsand includestools/seeddata/eventTags_embeddings.jsonat the runtime path the script expects.deploy/run-release.shruns migrations, then recommendation setup using the sameshared/environmentfile, before switching thecurrentrelease. Setup upserts all tag embeddings and backfills venue areas in an idempotent transaction. A setup failure aborts deployment before traffic switches; already-applied migrations are not rolled back. No manual production setup command is required. Subsequent InboxEngine syncs assign areas to incoming venues.Local verification
deploy/build-release.shlocally to produce a release tarball.tools/setup-recommendations.jsand itstools/seeddata/eventTags_embeddings.jsonexist; the packaged JSON matches the source file.--env-file, withNODE_ENV=production. It found its JSON, loaded all 22 embeddings (1536 dimensions each), mapped the test venues correctly, and exited with code 0.git diff --checkpassed.https://github.com/user-attachments/assets/4168c891-0260-4d97-8a22-f55fadbb003d
https://github.com/user-attachments/assets/b34379fe-21f1-43a8-ae5a-4cb94e4b8c00