Index Ai Academy
Glossary · Phase 1 · Building with LLMs

Cosine similarity

How alike two vectors' directions are, from 1 (same direction) through 0 (unrelated) to -1 (opposite).

You have two vectors. How alike are they? The standard measure is cosine similarity. It compares the directions two arrows point in and ignores how long they are. Think of two hikers reading their compasses. You care which way each one faces, not how far each has walked.

Try it now

That's why embedding search finds what keyword search misses.

Learn it properly

Embeddings · Meaning as a list of numbers, so text can be compared. About 25 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write