Ploba logo

Find the right AI tool for the job: apps, agents, APIs, MCP servers and datasets, explained plainly.

Get the AI Digest

Discover

  • Explore
  • Top Charts
  • Categories
  • Agents
  • MCP servers
  • Developer tools

Learn & community

  • Learn AI
  • AI Glossary
  • Blog
  • Hackathons
  • People
  • AI Digest

For makers

  • List your tool
  • Docs
  • Claim a listing
  • Advertise
  • Write for us

Company

  • About
  • Careers
  • Changelog
  • Trust
  • Security
  • Contact

© 2026 Ploba. All rights reserved.

  • Privacy
  • Terms
  • Cookies
  • Advertising
  • All policies
llms.txt
AI glossary
Development

Cosine Similarity

A mathematical measure used to determine how similar two vectors are, often used to compare the semantic meaning of text.

What is Cosine Similarity?

Cosine similarity is a mathematical formula used to measure the angle between two vectors in a multi-dimensional space. In AI, it is commonly used to estimate how similar two pieces of text are based on their embeddings.

How does it work?

When text is converted into an embedding (a list of numbers), it becomes a point in space. Cosine similarity calculates the angle between a line drawn to the first point and a line drawn to the second.

  • A cosine similarity of 1 means the vectors point in the exact same direction (highly similar).
  • A value of 0 means they are perpendicular (unrelated).
  • A value of -1 means they point in opposite directions.

What is a common misconception?

Do not claim that a high cosine similarity directly proves that two pieces of text have the exact same factual meaning. It only means they use similar language in similar contexts. "The dog chased the cat" and "The cat chased the dog" might have very high cosine similarity despite meaning different things.

Why does it matter?

Cosine similarity is the mathematical engine behind most semantic search and RAG applications. It provides a fast, computationally efficient way to rank thousands of documents based on their relevance to a user's prompt.

Category
Development
Last reviewed
Sep 24, 2026

Sources

  • TensorFlow: Cosine Similarity

Related terms

  • DevelopmentEmbeddingA mathematical representation of data designed so that related meanings can be compared computationally.
  • DevelopmentSemantic SearchA search technique that attempts to find results based on meaning and context rather than only exact keyword matches.
  • DevelopmentVector DatabaseA specialized database designed to store and rapidly search high-dimensional embeddings.