Skip to content
Mon, 23 Nov 202613:53:38 CET
AI-News

AI-News

Menu
  • Home
  • Basics
  • Posts
Searching...
No results found
  • Home
  • Basics
  • What Are Embeddings and Vector Databases?
  • Basics

What Are Embeddings and Vector Databases?

EditorialNovember 6, 2026Last reviewed: November 6, 20267 min read
Transparent acrylic cube with blue and orange glass beads in clusters, illustrating embeddings and vector databases

Contents

  • TL;DR
  • What an embedding is
  • Where the idea comes from
  • How you get an embedding
  • How similarity is measured
  • What a vector database does
  • What the search papers report
  • Embeddings in retrieval
  • What embeddings do not do
  • What this article does not cover
  • Sources

TL;DR

An embedding is a vector, a list of numbers, that stands for a piece of content such as a text. Related content gets vectors that lie close together, and a vector database stores these vectors and finds the nearest ones to a query. Its main limit is speed against accuracy: approximate search trades some recall for speed.

  • Purpose: Embeddings measure how related two pieces of content are, so that software can search by meaning.
  • Parts: An embedding model turns content into a vector, and a vector database stores vectors and answers nearest neighbor queries.
  • Size: OpenAI's text-embedding-3-small returns 1536 numbers by default, and Google's Gemini embedding models return 3072.
  • Origin: Mikolov and co-authors proposed word vectors in January 2013, and Karpukhin and co-authors tested dense retrieval in 2020.
  • Limit: The pgvector documentation says approximate search trades some recall for speed.

What an embedding is

OpenAI writes that its text embeddings “measure the relatedness of text strings”. An embedding “is a vector (list) of floating point numbers”.

The distance between two vectors carries the meaning. In OpenAI's words: “Small distances suggest high relatedness and large distances suggest low relatedness.”

OpenAI lists six uses: search, clustering, recommendations, anomaly detection, diversity measurement and classification.

Google's Gemini documentation adds that embeddings are not limited to text. The Gemini API offers models for “text, images, video, and other content”. Google says embeddings give “more accurate, context-aware results than keyword-based approaches”.

Where the idea comes from

The first step was word vectors. In January 2013, Tomas Mikolov and three co-authors proposed two model architectures “for computing continuous vector representations of words from very large data sets”.

They report that it takes “less than a day to learn high quality word vectors from a 1.6 billion words data set”. The paper also describes an earlier finding. Simple algebra on word vectors gave a result: vector(“King”) - vector(“Man”) + vector(“Woman”) “results in a vector that is closest to the vector representation of the word Queen”.

To find the closest word, the paper searches the vector space “measured by cosine distance”.

How you get an embedding

You send content to an embedding model. OpenAI's documentation says to send your text string to its embeddings API endpoint, along with “the embedding model name”. The response “contains the embedding vector (list of floating point numbers) along with some additional metadata”.

The vector has a fixed length. OpenAI states: “By default, the length of the embedding vector is 1536 for text-embedding-3-small or 3072 for text-embedding-3-large.” Its table lists a maximum input of 8192 for each model. Our explainer on tokens covers what that unit is: Tokens and Context Windows: What the Numbers Mean

Google's models also return 3072 numbers by default. The Gemini documentation says you can truncate this to a smaller size “to save storage space”. It recommends 768, 1536 or 3072 dimensions.

Not every model maker offers embeddings. Anthropic's documentation says: “Anthropic does not offer its own embedding model.” It points to Voyage AI as one provider and adds that you “should assess a variety of embeddings vendors to find the best fit”.

How similarity is measured

OpenAI recommends cosine similarity. It adds: “The choice of distance function typically doesn't matter much.”

OpenAI embeddings are normalized to length 1. That has two effects, according to the documentation. Cosine similarity can be computed with just a dot product, and cosine similarity and Euclidean distance give identical rankings.

Google makes a similar point about direction. Its documentation says normalized embeddings ensure that “semantic similarity is calculated via vector direction rather than magnitude”.

The pgvector documentation lists six distance types: L2 distance, inner product, cosine distance, L1 distance, Hamming distance and Jaccard distance.

What a vector database does

A search needs a way to compare one vector with many. OpenAI's answer: “For searching over many vectors quickly, we recommend using a vector database.”

pgvector is one example. It describes itself as “Open-source vector similarity search for Postgres”. The idea is to “Store your vectors with the rest of your data”.

A search can run in two ways. The pgvector documentation says: “By default, pgvector performs exact nearest neighbor search, which provides perfect recall.” You can add an index to use approximate nearest neighbor search, “which trades some recall for speed”.

The documentation warns that “you will see different results for queries after adding an approximate index”.

It supports two index types, HNSW and IVFFlat. An HNSW index “creates a multilayer graph”. The documentation says it has better query performance than IVFFlat, but slower build times and more memory use.

What the search papers report

The HNSW paper, submitted on March 30, 2016, presents an approach for approximate K-nearest neighbor search “based on navigable small world graphs with controllable hierarchy”. Its authors say the structure allows “a logarithmic complexity scaling”.

The FAISS paper, submitted on February 28, 2017, is about similarity search on graphics processors. The authors report a nearest neighbor implementation that is “8.5x faster than prior GPU state of the art”.

They also report that their implementation builds “a graph connecting 1 billion vectors in less than 12 hours on 4 Maxwell Titan X GPUs”. These are the authors' own measurements.

Embeddings in retrieval

Embeddings are also used to find passages. The DPR paper, submitted on April 10, 2020, shows that retrieval “can be practically implemented using dense representations alone”.

The authors say their dense retriever outperforms a strong Lucene-BM25 system “largely by 9%-19% absolute in terms of top-20 passage retrieval accuracy”. That is their result on their test sets.

The RAG paper, submitted on May 22, 2020, uses a vector index as memory. Its non-parametric memory is “a dense vector index of Wikipedia”.

Google's documentation calls RAG “a common use case for AI products”. Our explainer shows the full chain: What Is RAG? Retrieval-Augmented Generation Explained

OpenAI's search example shows the pattern. To find the most relevant documents, it uses “the cosine similarity between the embedding vectors of the query and each document”. In its code search example, the query is embedded with the same model that indexed the functions.

What embeddings do not do

The pgvector documentation shows one limit in the open. An approximate index can return different results than an exact search.

The documentation of the providers is open about choice. Anthropic names criteria such as inference performance and customization. It says larger or more domain-specific data “generally produces better in-domain embeddings”.

Benchmark figures come from the makers. OpenAI lists 62.3% on the MTEB evaluation for text-embedding-3-small. That is OpenAI's own listing.

What this article does not cover

We did not build an index and we did not run any search. We read the abstracts of the papers, not their full texts, except for the word vector paper.

We do not compare vector database products or their prices. Model names and defaults change, so check the provider's page before you build.

Sources

  • OpenAI, Vector embeddings (API documentation): https://platform.openai.com/docs/guides/embeddings
  • Google, Embeddings (Gemini API documentation): https://ai.google.dev/gemini-api/docs/embeddings
  • Anthropic, Embeddings (Claude Platform Docs): https://docs.anthropic.com/en/docs/build-with-claude/embeddings
  • pgvector, README (open-source vector similarity search for Postgres): https://github.com/pgvector/pgvector
  • Mikolov et al., Efficient Estimation of Word Representations in Vector Space (arXiv:1301.3781): https://arxiv.org/abs/1301.3781
  • Malkov and Yashunin, Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs (arXiv:1603.09320): https://arxiv.org/abs/1603.09320
  • Johnson, Douze and Jégou, Billion-scale similarity search with GPUs (arXiv:1702.08734): https://arxiv.org/abs/1702.08734
  • Karpukhin et al., Dense Passage Retrieval for Open-Domain Question Answering (arXiv:2004.04906): https://arxiv.org/abs/2004.04906
  • Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (arXiv:2005.11401): https://arxiv.org/abs/2005.11401

Share this article

Add AI-News as a preferred source on Google

Add AI-News as a preferred source on Google

Post navigation

Previous: What Is Fine-Tuning? How a Model Is Adapted
Next: What Are Reasoning Models? How They Differ From Standard LLMs

Related stories

Brass magnifying glass on dark slate, illustrating retrieval-augmented generation (RAG)
  • Basics

What Is RAG? Retrieval-Augmented Generation Explained

EditorialNovember 5, 2026
A wall of closed metal drawers with a single drawer pulled open, suggesting a tool library opened only when needed, with the
  • Tools

Google adds Tool Retrieval to Gemini API to trim tool schemas

EditorialNovember 23, 2026
Compact automotive computing module with a heat sink on a workbench beside a camera lens, with a city street behind at dusk
  • Models

NVIDIA Releases Alpamayo 2 Edge, a Compact Open Driving Model

EditorialNovember 23, 2026

Never miss an article

Subscribe via RSS

Add the feed address to a feed reader and new articles arrive on their own.

Related categories

  • Basics
  • Business
  • Hardware
  • Models
  • Policy
  • Safety
  • Science
  • Tools

ABB RoboticsAcquisitionsAcrobatAdobeAgent harnessAgentic AIAgentic CommerceAgentsAI AgentsAI chipsAI Data CentersAI InvestmentAI ModeAI ModelsAI RegulationAI securityAI stocksAI ValuationAir Traffic ControlAlpamayoAlphabetAlphaGenomeAMDAndroid GoAnthropicAPIApiiroApplied ComputeAuditingAutonomous DrivingAutopilotAzureBallot MeasuresBankingCaliforniaCapitalGCarbon EmissionsCaterpillarCEO SuccessionCerebrasChatGPT WalletChinaChina ChipsChip smugglingCitibankClaudeClaude CodeCodingColette KressCompilersComputer UseConfidential ComputingCopilotCorporate GovernanceCrusoeCyberattacksCybersecurityData Center CPUsData CentersDDR6DeciderDecision ModelsDeepMindDeepSeekDeveloper APIDrug DiscoveryDynamoEarningsElon MuskEmbeddingsEPYCEUExport controlsFAAFine-tuningFlight DisruptionFRCFunction CallingFundingGas turbinesGeminiGemini 4 CarbonGemini 4 HydrogenGemini 4 NeonGemini APIGemini appGemini for healthcareGemini RoboticsGenie 4GenomicsGitHubGoogleGoogle AntigravityGoogle ClassroomGoogle CloudGoogle DeepMindGoogle SearchGoogle Threat IntelligenceGoogle TPUGPT-6 AstraGPUGrokHallucinationHBMHealthcare AIHistoryHugging FaceHumanoid robotsHy4HyperscalersIBMInferenceIntelIntel FoundryInteractive ConnectorsIPOIsomorphic LabsJavaJEDECJensen HuangJet enginesKimiKPMGKV CacheL3HarrisLangChainLanguage ModelsLeanLLMLocateLuxmacOSMCPMCP AppsMegaspeedMemoryMetaMeta AIMicrosoftMicrosoft 365Microsoft CopilotMidterm electionsMLCommonsMLPerfMobile AIMoratoriumMultimodalNasdaqNational SecurityNet ZeroNetwork OutageNighthawkNVIDIAOffice in CopilotOpen DataOpen weight modelsOpen-weightOpenAIOpenJDKOutageOutlookPalo Alto NetworksPerplexityPetitionPower generationProject GeniePromptingQuantum ComputingQuantum HardwareQwenRAGReasoningRegulationRiemann hypothesisRobot SafetyRoboticsRubin HPCSafetySearchSEC InvestigationSecuritySingle-cell biologySMART SystemSoftBankSoutheast AsiaStationeryBenchSupercomputersSupercomputingTencentTogether AITokensTool RetrievalTOP500TransformerTSMCUS CongressUS MidtermsValuationVera RubinVision Language ActionWeather ForecastingWeatherNextWells FargoWorld ModelsWyomingxAIZen 6

You may have missed

A dim server room aisle with dark racks and a single rack glowing red status lights, with the Google logo in the lower left
  • Safety

Google says hackers automated vulnerability hunting with no human

EditorialNovember 23, 2026
Heavy closed steel bank vault door in a dim marble hall with a small brass key on a stone counter
  • Business

Wells Fargo and Citi Tell Customers AI Agent Risk Is Theirs

EditorialNovember 23, 2026
Rows of equipment racks with network routers and cables in a dim telecommunications room
  • Safety

FAA Ground Stop Traced to Router Work, Cause Still Disputed

EditorialNovember 23, 2026
Close-up of a copper heat sink with fine fins and a black fan
  • Hardware

JEDEC previews DDR6 memory with shorter, much faster modules

EditorialNovember 22, 2026
AI-News

AI-News for the web

Navigation

  • Home
  • Basics
  • Posts

Subscribe

  • RSS feed
  • Add AI-News as a preferred source on Google

    Add AI-News as a preferred source on Google

About

A blog about software, design, and the occasional stray thought.

© 2026 AI-News.