Here is the short version: all minilm l6 v2 is a sensible first dense-retrieval baseline for English-language semantic search. The model turns text into 384-dimensional vectors, so you can compare a query with documents by similarity. It is small enough to make a local experiment approachable, but its usefulness depends on your documents, chunking, and evaluation set—not its vector size alone.
The model’s published identifier is sentence-transformers/all-MiniLM-L6-v2. It is a bi-encoder: documents and queries are encoded independently, allowing document vectors to be computed ahead of time. That makes it a useful starting point for finding passages to feed a retrieval-augmented generation, or RAG, pipeline.
What the model does—and where it stops
A dense embedding represents the meaning of a piece of text as a list of numbers. A similarity function can then put a query near passages with related wording or concepts. For example, a search for “reset my login” might retrieve a passage about recovering account access even if it does not contain the exact query.
That flexibility comes with a trade-off. Dense retrieval can miss exact identifiers, version strings, error codes, and unusual names. A lexical baseline such as BM25 is worth keeping beside it, particularly for developer documentation. Neither method checks whether an answer generated from a retrieved passage is correct.
The model card describes it as intended for sentences and short paragraphs. Inputs longer than 256 word pieces are truncated by default. A word piece is a tokenizer unit, not necessarily a whole word, so do not assume a 256-word passage fits. Long documents should be split into passages before embedding; otherwise, useful text near the end may never reach the model.

Build a small local search example
Start in a fresh Python environment and install the sentence-transformers package. In a Python session, import SentenceTransformer from sentence_transformers, then create a model with SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2'). The first load normally downloads model files; subsequent offline use requires those files to be cached or available locally.
Create a Python list of short document passages, such as one paragraph about password recovery and another about changing billing details. Store the query as a separate string. Call model.encode(passages, normalize_embeddings=True) for the passages and model.encode(query, normalize_embeddings=True) for the query. Use the query vector’s dot product with each passage vector to rank the passages from highest score to lowest.
Normalization matters here: when both vectors have unit length, their dot product equals cosine similarity. A larger score means the vectors point in more similar directions; it is not a calibrated probability that a passage answers the question. Inspect the actual passages, not just their scores.
For a repeatable run, record the Python and sentence-transformers versions, the model revision, the exact passage text, and whether normalization was enabled. Also record the device used for encoding. Model files and dependencies can change, so pin versions and revisions when you turn a trial into a benchmark.
Choose chunks before choosing a vector database
Begin with passages that preserve a complete thought: a documentation section, a support answer, or a few related paragraphs. Add the document title or section heading when it provides context, but count that text against the model’s input limit. Use the model tokenizer to check lengths rather than estimating from characters.
Overlap between neighboring chunks can prevent an answer from being cut in half. It can also create near-duplicate results that crowd out other documents. Test a small overlap against no overlap, and keep the original document ID and passage offsets so you can trace every hit back to its source.
For a small collection, an in-memory matrix and dot products are enough to validate the workflow. A vector database becomes useful when persistence, filtering, concurrent queries, or approximate nearest-neighbor search justify the extra moving parts. First establish whether the embeddings retrieve useful passages at all; infrastructure will not repair poor chunk boundaries or missing content.

Measure retrieval quality without inventing a leaderboard
Make a held-out set of real or representative queries and label the passages that answer each one. Include exact error messages, paraphrased questions, acronyms, and queries with no answer in the collection. Keep labels separate from any examples used to tune chunk size or search settings.
Recall at 10 asks whether relevant material appears among the first 10 results; define in advance whether you are counting relevant passages or queries with at least one relevant hit. Mean reciprocal rank rewards putting the first relevant result near the top. Both are useful, but neither measures whether a language model uses the passage correctly. For unanswerable queries, inspect false hits and decide separately how your application should abstain.
Compare dense retrieval with BM25 using the same corpus, query set, and relevance labels. A hybrid experiment can combine their ranked lists, for example with reciprocal rank fusion, then return the top passages. Record the fusion settings and inspect cases where the methods disagree. This is where the simple baseline earns its keep: an exact error code may favor lexical search, while a paraphrase may favor dense retrieval.
If you also want an EmbeddingGemma comparison, verify whether EmbeddingGemma 2 has been released and check its specifications before using it as a baseline. Follow its documented query and document encoding instructions, and do not assume vectors from different models can share an index. No comparative quality or speed result follows from model names alone.
Account for speed, storage, and privacy
A 384-dimensional vector stored as float32 uses 1,536 bytes for the raw values, before index structures, metadata, and database overhead. Multiply that by your number of passages—not source documents—to estimate the minimum vector payload. Different storage types and index settings change the final footprint.
Measure indexing and query latency separately. Record CPU or GPU model, available memory, operating system, batch size, passage lengths, and whether model loading is included. Report warm and cold runs separately, and distinguish a single query from a batch. On a small machine, model loading, tokenization, or disk access may matter as much as vector comparison.
Local inference can keep document text off a hosted embedding API, but downloading a model still involves a network request. Review the model’s license and your dependency supply chain, protect cached files and indexes, and avoid putting sensitive passages into logs. The benchmark is the conversation starter, not the verdict: run it on the data and hardware you actually expect to maintain.

No feedback yet — submit the first.