Rap Genie uses OpenAI to generate an embedding for each verse and each search query. The song/verse database is stored in Convex and Convex vector search is used to obtain the embeddings that have the closest cosine similarity to a given search query. Convex is a serverless fullstack development platform that makes it easy to build dynamic web apps, talk to third party APIs, and run background jobs. Feel free to fork the repo to make changes, or build something else cool on Convex.