Dri iconDriAug 26, 2026 ~1 min source read

Finding related posts with embeddings

Raw cosine similarity makes everything look related Once every post has an embedding vector, the next question is how to compare them. I added a new feature to my blog: a list of related posts at the bottom of each post.

Share this story

Send the public story page.

Useful takeaways from this story.

I added a new feature to my blog: a list of related posts at the bottom of each post.

Embeddings turn meaning into numbers An embedding model reads text and returns a vector: a long list of numbers.

I looked at how other content management systems identify related posts: most use shared tags, backlinks, manual curation, or embeddings.

Building the complete brief

The page is ready to read now. The fuller skim-friendly version will appear here automatically.

The useful part

I added a new feature to my blog: a list of related posts at the bottom of each post. I looked at how other content management systems identify related posts: most use shared tags, backlinks, manual curation, or embeddings. I chose embeddings, which compare the meaning of each post, because they can uncover connections without shared tags, existing links, or manual curation.

How it works

  • Together, the 768 numbers place the post near other posts with similar meaning.
  • During training, the model learns that certain words and phrases appear in similar contexts or play similar roles, so it places them near each other in the space.
  • Raw cosine similarity makes everything look related Once every post has an embedding vector, the next question is how to compare them.
  • I implemented it using embeddings, and this note documents how.
  • Embeddings turn meaning into numbers An embedding model reads text and returns a vector: a long list of numbers.

What to take from it

Conceptually, it is a bit like tagging each blog post with hundreds of auto-generated tags, except that these tags are unnamed (they are just numbers) and distributed (meaning is spread across all of them). It does not need "car" and "automobile" to share any letters to learn that they are used in related ways.

Details worth keeping

This is what lets two posts match even when they use different words. This is where I had to dust off a little math.

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app