AI engineering glossary · RAG vector search

What is cosine distance?

Cosine distance: A distance measure defined as 1 minus cosine similarity, so vectors pointing the same way have distance 0. Many vector databases report it instead of similarity, and smaller values mean the items are closer in meaning.

Level: beginnerTopic: RAG vector search

Cosine distance: an example

Two vectors with cosine similarity 0.8 have cosine distance 0.2.

Related terms

More RAG vector search terms

Where you learn it

Cosine distance is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.