From the course: Vector Databases in Practice: Deep Dive

Challenge: Vector database queries

From the course: Vector Databases in Practice: Deep Dive

Challenge: Vector database queries

(upbeat music) - [Instructor] For this first challenge, you're going to put your querying skills into practice by writing your own database queries. To get started, open up this Python script, which provides some code to help you get on the way. The provided code here connects to the database, gets the movie collection, and then fetched a couple of objects before displaying the results on the screen. The first query will be a hybrid search on a collection called, Review. This collection has just the one property called, body. And the query string can be any text you'd like to search for in a movie review. As a starting point, maybe I'd suggest a phrase, fun for the whole family, but again, it can be anything you would like to search for. Try this with two different alpha values, 0.1 and 0.9, and see if the results differ at all. If they do, if they don't, consider why they might be. And retrieve the top three results only, which should be sufficient for this exercise. The second query would be a RAG query on the Movie collection, and we'll do that with a vector search for the string, action adventure. Grab the top five results, and then prompt the language model to generate a tagline for each movie based on the movie's title and description properties. And, of course, for each search, display the relevant parts of the response so that you can inspect them. Good luck and have fun.

Contents