Skip to content

Commit ab887f1

Browse files
Updating tutorial for recommendations
1 parent 849c951 commit ab887f1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/uc/personalized_recommendations.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
Imagine you’re building a movie recommendation app, and your users expect intuitive, meaningful results, not just keyword matches, but intelligent understanding.
2-
3-
Not just keyword matching, but semantic understanding — powered by vector embeddings. These are numerical representations of text that capture meaning, allowing you to search by intent rather than exact words.
1+
Imagine you’re building a movie recommendation app that goes beyond simple keyword matching. Your users want recommendations based on the meaning of the movie plots — an intuitive and meaningful search experience powered by semantic understanding.
42

53
### Store Movie Documents with Vector Embeddings
6-
7-
Let’s import a dataset containing plot summaries, each paired with an embedding vector. Each movie JSON document contains metadata like title, genre, year, and a vector embedding of the plot.
4+
Semantic search uses vector embeddings — numerical representations of text that capture the meaning of sentences. This enables search by intent rather than just keywords.
5+
Let’s import a dataset containing plot summaries, each paired with an embedding vector.
6+
Each movie is stored as a JSON document with:
7+
- `title`, `genres`, `year`, `plot`
8+
- `embedding`, which is a binary-encoded `FLOAT32[]` used for vector similarity that can be generated using sentence-transformers or similar libraries. Demo uses 8-dim vectors; production models typically use 128–1536 dimensions.
89

910
```redis:[run_confirmation=true] Upload Movies
1011
JSON.SET movie:001 $ '{"title":"Toy Story","genres":["Animation","Comedy","Family"],"plot":"Toys come to life when humans arent around.","year":1995,"embedding":[0.22,0.04,0.33,0.12,-0.02,0.17,0.09,0.01]}'
@@ -154,7 +155,6 @@ FT.SEARCH idx:movies '@genres:{"Animated"|"Sci-Fi"} =>[KNN 5 @embedding $vec AS
154155
This makes Redis recommendations responsive to evolving user preferences without retraining embeddings.
155156

156157
### Next Steps
157-
- Now that you’ve seen the basics, here are a few ideas to extend this:
158-
- Build personalized watchlists based on user preferences and past behavior.
159-
- Power chatbots that provide context-aware movie suggestions.
160-
- Blend keyword and vector search for a richer discovery experience.
158+
- Build a UI that lets users type natural language queries and get semantic recommendations instantly
159+
- Add personalization by combining user preferences with semantic search
160+
- Explore advanced vector search techniques like HNSW indexing for large datasets

0 commit comments

Comments
 (0)