# Vector similarity

> Vector similarity is a numeric measure of how close two vectors are. When the vectors are embeddings that represent text, images or companies, the measure works as a proxy for how alike the underlying items are. The common measures are cosine similarity, dot product and Euclidean distance, and they are used to rank the nearest items to a query.

Source: https://similariq.ai/glossary/vector-similarity · Updated 2026-11-25

## What vector similarity is

A vector is an ordered list of numbers. Vector similarity is a function that takes two vectors of the same length and returns a single number describing how close they are. On its own that is plain geometry. It becomes useful when the vectors are [embeddings](https://similariq.ai/glossary/embeddings), which are produced by a model so that items with related meaning sit near each other. Then closeness of vectors stands in for likeness of the things they represent.

The phrase covers two families of measure. Similarity measures get larger as vectors get more alike; cosine similarity and dot product are the usual ones. Distance measures get smaller as vectors get more alike; Euclidean distance is the usual one. They are used the same way in practice: compute the number between a query vector and every candidate, sort, and take the top results.

## Why it matters

Vector similarity is what makes search by meaning possible. Once content is represented as vectors, finding related content reduces to finding nearby points, and that is a problem computers solve fast and at scale. The same operation powers semantic search, recommendations, duplicate detection, clustering and the retrieval step that feeds relevant passages to an AI assistant before it answers.

It also gives you a graded answer instead of a yes or no. Keyword matching tells you whether a term is present. A similarity value tells you how close two items are, which means you can rank results, set a cut-off and decide how much loose matching you are willing to accept. That graded quality is what lets one technique serve both a strict task such as duplicate detection and a loose one such as discovery.

## The main measures

**Cosine similarity** measures the angle between two vectors and ignores their length. It ranges from 1 for vectors pointing the same way, through 0 for vectors at right angles, to -1 for opposite directions. Because it ignores length, a short document and a long document on the same subject can still score as very close. It is the default choice for text.

**Dot product** multiplies matching positions and adds the results. It rewards both alignment and length, so a longer vector scores higher than a shorter one pointing the same way. When all vectors have been scaled to length one, which many embedding models do, dot product and cosine similarity give identical rankings, and dot product is cheaper to compute.

**Euclidean distance** is the straight-line distance between two points. It is sensitive to length as well as direction: two vectors pointing the same way but of different lengths are far apart by this measure. For vectors scaled to length one, Euclidean distance and cosine similarity produce the same ordering, so the choice only changes results when lengths vary.

## A worked example

Use two-number vectors so the arithmetic is visible. Let A be (3, 4), B be (6, 8), C be (4, 3) and D be (4, -3). The length of A is 5, since 3 squared plus 4 squared is 25. B has length 10. C and D each have length 5. B points in exactly the same direction as A and is twice as long.

Cosine similarity between A and B is the dot product, 18 plus 32, which is 50, divided by 5 times 10, giving 1.0. Between A and C it is 24 divided by 25, giving 0.96. Between A and D it is 12 minus 12, which is 0, so those two are unrelated by this measure. Now take Euclidean distance. From A to B it is 5. From A to C it is the square root of 2, about 1.41. Cosine says B is the closest match to A. Euclidean says C is. Neither is wrong; they answer different questions, which is why you should use the measure your embedding model was designed for.

## Nearest-neighbour search

The standard use of vector similarity is nearest-neighbour search: given a query vector, return the k stored vectors that are closest. With a few thousand items you can compare the query against every one. This is exact and simple. With millions of items that becomes slow, so systems use approximate nearest-neighbour indexes, which organise vectors in advance so that a search only examines a small fraction of them.

Approximate search trades a little accuracy for a large gain in speed. It will occasionally miss an item that an exact search would have returned. For most applications that is acceptable, and the miss rate can be tuned. The practical point is that similarity search has two sources of error: the embedding may place items badly, and the index may fail to return the true nearest ones. They need to be diagnosed separately.

## Common mistakes

The first mistake is reading a similarity value as an absolute quantity. A cosine similarity of 0.8 has no fixed meaning. In one model, unrelated texts might routinely score 0.7, so 0.8 is barely above noise. In another, 0.8 is a strong match. Values are only comparable within the same model and the same kind of content. Set thresholds from examples you have labelled, never from intuition about the number.

The second is using a measure the model was not trained for. If a model was trained with cosine similarity and you rank by Euclidean distance on unscaled vectors, results degrade quietly. The third is assuming the top result is correct because it is the top result. Nearest-neighbour search always returns something, even when nothing relevant exists. Without a minimum threshold, a query about an unknown subject still gets ten confident-looking answers. The fourth is treating closeness as equivalence: near vectors indicate related content, which is weaker than the same entity or a true competitor.

## How to evaluate it

Build a labelled test set: a few dozen queries, each with the items that should be returned. Run the search and measure recall at k, the share of known-correct items appearing in the top k, and precision at k, the share of the top k that are correct. Check these at the depth your application uses. If users see five results, the top five are what count.

Then examine the score distribution. Plot or list similarity values for known matches and known non-matches. If the two groups overlap heavily, no threshold will separate them and the fix lies upstream, in the model or the content being embedded. If they separate cleanly, place the threshold in the gap. The entry on [precision and recall](https://similariq.ai/glossary/precision-and-recall) explains the trade-off a threshold controls.

## How vector similarity relates to SimilarIQ

SimilarIQ does not offer vector search, and the numbers it returns are not vector similarity values. Its `matchScore` is a 0 to 100 score stating how close a look-alike a company is to the seed domain you searched. Its `confidence` score, also 0 to 100, states how certain the engine is, independent of similarity, and reflects cross-validation across multiple independent intelligence sources. Do not interpret either as a cosine value or map one onto the other.

The habits you learn from vector similarity still apply to a look-alike list. A score is for ranking and thresholding, so pick a cut-off from results you have reviewed; the guide on [how to choose a match score threshold](https://similariq.ai/guides/how-to-choose-a-match-score-threshold) walks through it. A ranked list is always returned, so read the lower rows critically. And if you maintain your own vector index of companies, an independently produced list of up to 100 look-alikes for $0.25 a search is a cheap reference set for testing it. See [match score](https://similariq.ai/features/match-score) for what the field means.

## Related terms

Embeddings are the vectors that similarity is computed on; the two terms are halves of one technique. [Company similarity](https://similariq.ai/glossary/company-similarity) is the business concept being approximated when the vectors represent companies. A [match score](https://similariq.ai/glossary/match-score) is a product-level number expressing closeness to a seed, which may be produced by any method.

Entity resolution and deduplication use similarity with strict thresholds to decide whether two records are the same thing. Look-alike modeling uses it loosely, to find things that resemble a seed without being identical to it.

## Frequently asked questions

### What is vector similarity?

It is a number describing how close two vectors are. When the vectors are embeddings of text, images or other content, the number acts as a proxy for how alike the underlying items are, and it is used to rank results in semantic search and recommendations.

### What is the difference between cosine similarity and Euclidean distance?

Cosine similarity measures the angle between two vectors and ignores their length. Euclidean distance measures the straight-line gap between them and is affected by length. For vectors scaled to length one they produce the same ranking; otherwise they can disagree.

### What is a good cosine similarity score?

There is no universal answer. The range of typical values differs from one embedding model to another, so a figure that signals a strong match in one can be ordinary in another. Set a threshold using labelled examples from your own data.

### When should I use dot product instead of cosine similarity?

Use dot product when your vectors are already scaled to length one, since it gives the same ranking as cosine and is cheaper, or when the model was trained so that vector length carries meaning. Follow the recommendation of the embedding model you use.

### Does a high vector similarity mean two companies are competitors?

Not by itself. It means their descriptions are alike according to one model. They might compete, serve different buyers with a similar product, or simply use the same vocabulary. Competition needs evidence about both offering and audience.

### Is the SimilarIQ match score a cosine similarity?

No. The match score is a 0 to 100 value stating how close a look-alike a company is to your seed. It is a product score for ranking and thresholding, and SimilarIQ does not expose vectors or vector search.
