Embeddings

Episode #499 by Teacher's Avatar David Kimura

Summary

In this episode, we explore embeddings and how they improve search and recommendations by converting text into numerical vectors. We'll set up a Rails 8 app with PostgreSQL + PG Vector, generate embeddings, and perform similarity searches.
rails model ai machine learning search 28:15

Chapters

  • Introduction (0:00)
  • Setting up PostgreSQL (2:48)
  • Understanding the Embeddings (5:24)
  • Adding gems (7:53)
  • Creating the embedding model (9:01)
  • Making the background job (11:30)
  • Generating the embeddings (15:48)
  • Creating the similarity searches (18:17)
  • Creating some test data (22:30)
  • Creating a search form (23:39)
  • Final thoughts (25:34)
Student & Teacher
$ 9 /mo

Valid School Email Required

Same Access as Pro

Subscribe Now
Pro Monthly
$ 19 /mo

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Pro Annual
$ 190 /yr

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Teams
$ 57 /mo

3 Users Minimum

$19.00 / user / month

Same Access as Pro

Subscribe to Teams