Knn vectors

Let us say I am building an ecommerce app and there are 2 users:
user A : always searches for electronics (laptop, headphones, etc)
user B: searches for snacks, beverages

Is it possible to show a page with banner that has electronics for user A and snacks for user B as soon as they log in? and also show similar recommendations when they search for it?

Can this be accomplished using knn?

Knn search is used to find similar items, so recommendations could be a good use case of it.

does this mean knn can be used for my usecase