Embedding

BytapaScript

Also known as: Embeddings, Vector Embedding

In a nutshell

Turning text or images into numbers that capture meaning.

What it means

A numerical representation of information, such as text or images, that captures aspects of its meaning.

💡 Giving each book a numerical address based on its subject so similar books can be found together.

Code example

import OpenAI from "openai";
const openai = new OpenAI();
const res = await openai.embeddings.create({
  model: "text-embedding-3-small",
  input: "How does RAG work?",
});
console.log(res.data[0].embedding);

Why it matters

Embeddings enable semantic search, similarity matching, recommendations and RAG.

Common misconception

Beginners often confuse an embedding (the numbers) with the vector database that stores and searches them.

When to use it

  • Semantic search
  • Recommendation systems
  • Clustering similar documents

Further reading

Related terms

Learn Full Stack

with tapaScript

By clicking Sign Up you re confirming that you agree with our Terms and Conditions.

newsletter

Don't forget to connect with us on