Loading…

Vector Search Playground (Semantic Search)

This playground shows semantic search: finding documents by meaning instead of by exact words. You write a few documents, type a query, and see which documents are closest in meaning.

The starter query "cozy jacket for cold weather" shares almost no words with the winter coat document, but vector search still ranks it near the top. That is the main idea behind vector databases and RAG systems.

Things to try

  • Run the starter query and compare the ranking with what keyword search would find.
  • Rephrase the query with completely different words that mean the same thing.
  • Add your own documents on a new topic and search them.
  • Look at the similarity scores to see how close each document is.

How it works

Each document and your query are turned into an embedding — a list of numbers that represents meaning — by a real embedding model (all-MiniLM-L6-v2) running in your browser through transformers.js. Documents are then ranked by how close their numbers are to the query's.

The first time you press Run, your browser downloads the model, which is about 90 MB. After that, everything runs on your computer. No API key is needed and your text is not sent to an AI service.

Frequently asked questions

What is vector search?

Vector search turns text into numbers called embeddings and finds the items whose numbers are closest to your query. This lets it match by meaning, even when the words are different.

Why is the first run slow?

Your browser downloads the embedding model the first time, which is about 90 MB. Later runs are much faster.

Is my text sent to OpenAI or another AI service?

No. The model runs inside your browser, so your documents and queries stay on your computer.

How is this related to RAG?

RAG (retrieval-augmented generation) uses this same kind of search to find relevant text before an AI model writes an answer. This playground shows the retrieval step on its own.