← All demos

NLP (on-device)

Semantic Similarity

Compare two texts by meaning, not words, with the embeddings that power search and RAG.

Production proof: The core operation behind semantic search and trustworthy RAG, running on-device with the same model I use for offline clinical search. Read the case study →

How it’s engineered
  • A ~23 MB sentence-transformer (all-MiniLM-L6-v2) turns each text into a 384-dimension vector in your browser; similarity is the cosine angle between them.
  • Two sentences that mean the same thing score high even with no shared words. That is exactly why embeddings beat keyword matching for search and retrieval.
  • This is the retrieval primitive under RAG: rank passages by meaning, then ground the answer in the closest ones.