Prompt

How do I use vector search for recommendations?

Technology / Databases1 observationLast seen Oct 7, 2026

Latest observation

Oct 7, 2026OpenAI APIWeb search: off

Vector search is a great way to build recommendations when you can represent items and users as embeddings. The core idea is:

  • turn each item into a vector
  • turn the user’s current interests into a vector
  • find the item vectors closest to the user vector

Basic workflow

1. Create embeddings for items

For each product, article, movie, song, etc., generate an embedding from:

  • title
  • description
  • tags
  • category
  • metadata
  • user-generated text like reviews

Example:

  • “wireless noise-canceling headphones”
  • “over-ear bluetooth headset with ANC”

These should end up near each other in vector space.

2. Build a user/query vector

You can create a vector for a user from:

  • items they clicked
  • items they purchased
  • search terms
  • profile data
  • session behavior

Common approach:

  • average the embeddings of items they liked
  • weight recent interactions more heavily
  • combine text from search/history into one embedding

3. Store embeddings in a vector database

Use a vector index such as:

  • FAISS
  • Milvus
  • Pinecone
  • Weaviate
  • pgvector in Postgres
  • Elasticsearch/OpenSearch vector search

4. Retrieve nearest neighbors

For a given user vector, run nearest-neighbor search to find top-k similar items.

This gives you:

  • “users who like X also like Y” style recommendations
  • personalized “for you” results
  • similar item recommendations

5. Filter and rerank

After vector retrieval, apply business rules:

  • exclude already purchased items
  • filter out out-of-stock items
  • enforce freshness/diversity
  • rerank using a separate model or heuristics

Simple example

If a user liked:

  • “The Martian”
  • “Project Hail Mary”

You embed those books, average the vectors, and search for nearby books. Results might include:

  • “Artemis”
  • “Red Mars”
  • “Seveneves”

Common recommendation patterns

Item-to-item recommendations

“Because you viewed this, you might like that.”

  • Embed each item
  • Find nearest neighbors for the item

User-to-item recommendations

“Recommended for you.”

  • Build a user embedding from history
  • Search across the item catalog

Session-based recommendations

Use the last few clicks in the current session to build a temporary vector and recommend relevant items.

Why vector search works well

It captures semantic similarity beyond exact keywords:

  • “sneakers” and “trainers”
  • “laptop” and “notebook computer”
  • “mindfulness meditation” and “stress relief breathing”

Important caveats

Vector search alone is usually not enough for production recommendations:

  • it may over-recommend similar items
  • it doesn’t automatically handle popularity, freshness, or constraints
  • it can miss collaborative signals unless embeddings are built from behavior
  • it may not be ideal for very sparse catalogs without good features

Best practice

Use vector search as the candidate generation step, then combine it with:

  • collaborative filtering
  • popularity signals
  • business rules
  • ranking models

If you want to implement it

A typical stack looks like:

  1. Embed items with an embedding model
  2. Index vectors in a vector DB
  3. Build user/session vectors from interactions
  4. Search top-k nearest items
  5. Filter and rerank
  6. Log clicks/purchases to improve embeddings

If you want, I can show you:

  • a concrete Python example using FAISS or pgvector
  • how to build user embeddings
  • how to combine vector search with collaborative filtering

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.