ragdesk by Raj Muthachari

Embeddings

An embedding turns a sentence into 384 numbers so that similar meanings land close together. This is the engine under every RAG system. Here it runs on your device, and it shows where it goes wrong.

Starting…

    Similarity

    Cosine similarity, 1.00 means same direction. Darker is closer.

      Run a comparison to see the closest pair.

      Map

      384 dimensions squashed to 2 with PCA. Good for a feel of the clusters. Trust the grid for the numbers.

      How it works

      • Model: all-MiniLM-L6-v2, quantised to about 23 MB, served from this site. Your browser downloads it once, caches it, and runs it on the CPU in background threads, so the page never freezes. I tried WebGPU too. For batches this small it was slower and blocked the page while loading.
      • Vectors are normalised, so similarity is a plain dot product. Search is a loop over every line. At a few thousand chunks you do not need a vector database.
      • No text leaves your browser. The server only hands out static files.

      In production I would

      • Pick a multilingual model for APAC. English-only models quietly fail on Japanese and Chinese tickets.
      • Never use vector search alone. Combine it with keyword search, rerank the top results, and let a model read them before answering. The negation example is why.
      • Test retrieval on its own with known question-and-article pairs before blaming the LLM for a wrong answer.
      • Re-embed when the model changes. Vectors from two models cannot be compared.