cookbook
cookbook copied to clipboard
Add Cookbook Example: Scalable Cross-Media Recommendation System using Gemini + Qdrant
Description of the feature request:
This issue proposes adding a new cookbook example that demonstrates how to build a scalable, content-based recommendation system using Gemini’s multimodal embeddings and Qdrant as the vector store. This system will support cross-media recommendations across movies, books, anime, and potentially games, allowing users to receive intelligent suggestions from various media domains based on their input.
What problem are you trying to solve with this feature?
We want to demonstrate how Gemini can power a scalable, content-based recommendation system that works across various media types — not just movies, but also books, anime, and potentially games too. The goal is to show how LLM-generated embeddings, when stored in a vector database like Qdrant, can help generate personalized suggestions based on user preferences, even without any user history.
Right now, most demos stick to simple toy datasets or narrow use-cases. We’d like to offer an example that feels closer to a production-level system — one that can handle real-world scale and adapt to multiple content domains. The plan is to build a chat-style interaction where a user might input a movie they like or describe a theme (say, “slow-burn revenge thriller”), and get smart recommendations pulled from a large dataset using semantic similarity.
Any other information you'd like to share?
We'll use Gemini to embed each item’s title, description, and genre into a single dense vector. These vectors will be stored in Qdrant, which is great for fast, filtered vector search at scale. Each item (be it a film, anime, or novel) will carry a media_type tag, so we can filter or mix recommendations depending on what the user is asking.
The beauty here is that it doesn't rely on collaborative filtering or user interaction data. That makes it ideal for cold-start problems or general-purpose suggestions. Also, it's flexible enough to later integrate feedback, ratings, or even visuals if needed. For now though, we’ll focus on building a clean mid-layer that takes a genre or item as input and returns context-aware recommendations.
The example could live under a new “cross-media recommendations” category in the cookbook — it blends generative embeddings, scalable search, and multi-domain flexibility, all in one neat, self-contained demo.
Let me know if you’d like a sketch of the initial data model or how we’re thinking about user queries. We’re happy to help shape it into something really useful for the broader dev community.
Technical Plan:
-
Dataset Collection: Select datasets for one or more genres/media types to start with (e.g., Sci-Fi movies, dark fantasy anime, classic novels). Extract relevant fields: title, description, genre, and optionally image links and release year.
-
Embedding Generation using Gemini: For each media item, generate an embedding using Gemini’s multimodal capabilities, combining multiple metadata fields.
-
Vector Indexing with Qdrant: Create a collection in Qdrant for each media type or a combined one with media_type as a filterable field. Store embeddings with metadata and media type.
-
Query & Recommendation Pipeline Users can enter freeform inputs — e.g.:
“I liked Inception, what should I watch or read next?” “Suggest a 90s fantasy anime similar to Slayers.”
This query will be embedded via Gemini, then matched against the stored vectors using cosine similarity. We’ll return the top K closest items, optionally filtered by domain. Search will be done through Qdrant’s /search endpoint with applied filters based on user preferences
@markmcd Should I proceed with this?
Sounds like a useful guide - SGTM. CC @Giom-V
If you need it, check out the template for a starting framework. Even if you don't need it, there are some style notes in there to be aware of.
And be cautious with any data you use - if you include copies or snippets of external data in the notebook, then you are "distributing", potentially with "modifications", so need to comply with the appropriate license terms. The same applies to code but as long as you write everything in the notebook then this shouldn't be an issue.
Alright I'll start with going through the template then. I'll keep in mind to comply with the appropriate licence terms