Prompt

I'm building a recommendation system from user behavior embeddings, where do I start

Artificial Intelligence / AI Search1 observationLast seen Oct 10, 2026

Latest observation

Oct 10, 2026OpenAI APIWeb search: off

A good way to start is to treat this as a retrieval + ranking problem built on top of your user behavior embeddings.

1) Define the recommendation objective

First decide what you want to recommend and optimize for:

  • Next item prediction: “What will the user click/buy/watch next?”
  • Top-N retrieval: “Show the most relevant items from a large catalog”
  • Session-based recommendations: use recent actions only
  • Long-term personalization: use all historical behavior

This matters because the embedding model, loss, and evaluation should match the task.

2) Make sure your embeddings are usable

If you already have user behavior embeddings, check:

  • Are they dense vectors of fixed size?
  • What do they represent: user history, session, sequence, or interaction summary?
  • Are they updated offline or online?
  • Do similar users/items actually land close together in embedding space?

If not, you may need to train them or improve the representation.

3) Build a simple baseline first

Start with a very simple system so you have something to compare against:

  • Most popular items
  • Recently trending items
  • Item-to-item similarity using cosine similarity between embeddings
  • User embedding → nearest item embeddings

This baseline will help you tell whether more complex methods are helping.

4) Choose the recommendation architecture

Common starting architectures:

A. Two-tower retrieval model

  • One tower encodes the user behavior embedding
  • The other tower encodes item embeddings
  • Train so matching user-item pairs are close together

Good for large-scale candidate retrieval.

B. Similarity-based recommender

  • Use cosine similarity or dot product between user and item vectors
  • Very easy to implement
  • Good baseline, sometimes surprisingly strong

C. Sequence model

  • If behavior order matters, use Transformer/RNN over event sequences
  • Better for session-based or short-term intent

If you’re just starting, I’d recommend:

  1. similarity baseline
  2. two-tower model
  3. sequence model if needed

5) Prepare training data correctly

You need examples of:

  • Positive pairs: user interacted with item
  • Negative pairs: items not interacted with

Common setup:

  • For each user-event, use their prior behavior as input
  • Predict the next clicked/purchased item
  • Sample negatives from the item catalog

Be careful with:

  • Data leakage: don’t use future behavior in the input
  • Time split: train on past, validate on future
  • Implicit feedback: clicks/views/purchases are usually implicit positives

6) Pick a loss function

For recommendation, common losses are:

  • Binary cross-entropy with negative sampling
  • Pairwise ranking loss like BPR
  • Contrastive / InfoNCE loss for embedding learning

A very practical default is:

  • dot product + sampled softmax or BCE with negative samples

7) Evaluate properly

Offline metrics:

  • Recall@K
  • NDCG@K
  • MRR
  • Hit Rate@K

Also evaluate by segment:

  • new users vs heavy users
  • different item categories
  • recent vs old behavior

Make sure you do a temporal split so evaluation reflects real deployment.

8) Think about retrieval vs ranking

Usually recommendation systems have two stages:

  1. Candidate generation: quickly find a few hundred likely items
  2. Ranking: score those candidates with more features

Embeddings are often used in stage 1.
You can later add:

  • user/item metadata
  • context features
  • freshness
  • popularity
  • business constraints

9) Production concerns

If deploying:

  • Build an ANN index for fast nearest-neighbor search
  • Update embeddings periodically
  • Handle cold-start users/items with metadata or popularity fallback
  • Monitor drift and online performance

Libraries/tools:

  • FAISS, ScaNN, Annoy for similarity search
  • PyTorch / TensorFlow for model training

10) A practical first project plan

Here’s a simple path:

  1. Collect interaction logs
  2. Create a time-based train/val/test split
  3. Build a popularity baseline
  4. Build cosine-similarity recommendations from embeddings
  5. Train a two-tower model with negative sampling
  6. Evaluate Recall@K / NDCG@K
  7. Add ranking features if needed

If you want a concrete starting point

If your embeddings are already available, the easiest first prototype is:

  • represent each user by their behavior embedding
  • represent each item by an item embedding
  • score with cosine similarity or dot product
  • retrieve top-K via FAISS
  • evaluate with Recall@10 and NDCG@10 on future interactions

If you want, I can help you with:

  1. a minimal architecture design,
  2. a training data schema, or
  3. PyTorch code for a two-tower recommender.

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.