Akselera Tech
SEO
AI

Vector Embeddings and Semantic Retrieval: Foundation of AI Search in 2026

A
Akselera Tech Team
AI & Technology Research
May 28, 2026
12 min read

When you search "best project management tool for remote teams," Google no longer scans for those seven words. It converts your query into a 3072-dimensional numerical vector — a point in geometric space that encodes semantic meaning — and finds content whose own vector sits closest to yours. The gap between a page that answers the question and a page that just contains the keywords is now measurable in radians.

This is the architecture powering Google AI Overviews, ChatGPT's retrieval layer, and Perplexity's citation engine. They all run a variant of the same pipeline: encode the query, encode candidate content, retrieve by similarity, feed the closest matches to an LLM to generate the final answer. Understanding this system requires rethinking two assumptions that governed SEO for 20 years. Matching keywords is a different operation than matching intent. Writing for humans and writing for algorithms now collapse into the same activity.

This guide on vector embeddings semantic search walks through the full pipeline: how to audit your content against embedding similarity, pick the right embedding model for a multilingual corpus, deploy a working pgvector schema, and run a semantic site search that mirrors how Google understands your domain.

What Are Vector Embeddings

An embedding is a fixed-length array of floating-point numbers that represents the meaning of a piece of text. The numbers themselves are uninterpretable to humans. The geometry between them is the point. Two embeddings that sit close in vector space represent texts with similar meaning.

The Transformation from Text to Numbers

Tokenization breaks the input string into subword tokens, each with a vocabulary ID. The model runs these IDs through a stack of transformer layers, producing a high-dimensional output per token. A pooling layer collapses those per-token vectors into a single fixed-length vector for the whole input.

Dimensionality varies by model. OpenAI text-embedding-ada-002 produced 1536 dimensions and held the production default for two years. text-embedding-3-large now produces 3072 dimensions with Matryoshka truncation down to 256 or 512 at minimal quality loss. Cohere embed-v3 outputs 1024 dimensions. Voyage AI voyage-3-large produces 1024 dimensions and tops the BEIR leaderboard as of Q1 2026.

The distance metric is cosine similarity — the dot product of two vectors divided by the product of their magnitudes, yielding a value between -1 and 1. The practical range for embeddings is 0 (orthogonal) to 1 (semantically equivalent). A cosine similarity of 0.85 between two text fragments means they occupy nearly the same semantic neighborhood.

Why This Replaced Keyword Matching

BM25, the algorithm that dominated retrieval for two decades, matches strings. It rewards documents whose tokens overlap with the query tokens, weighted by term frequency and inverse document frequency. The output is a lexical score with no representation of meaning beyond surface text.

Embeddings match meaning. "Cheap flights to Bali" and "affordable Bali airfare" land in the same region of embedding space with zero shared content tokens. The model learned that "cheap" and "affordable" are interchangeable in travel contexts and that "flights" and "airfare" describe the same concept. The cosine similarity between these two phrases lands around 0.86 with text-embedding-3-large.

This is the technical realization of Google's "Things, Not Strings" strategy. The Knowledge Graph handles symbolic entity matching. Neural retrieval handles meaning-based matching. Together they replaced the lexical-only retrieval model that defined search until 2019.

import openai
from numpy import dot
from numpy.linalg import norm

client = openai.OpenAI()

response = client.embeddings.create(
    model="text-embedding-3-large",
    input=["cheap flights to Bali", "affordable Bali airfare"]
)

vec_a = response.data[0].embedding
vec_b = response.data[1].embedding

print(f"Vector dimensions: {len(vec_a)}")
print(f"First 5 values: {vec_a[:5]}")

cosine_sim = dot(vec_a, vec_b) / (norm(vec_a) * norm(vec_b))
print(f"Cosine similarity: {cosine_sim:.4f}")
# Output: Vector dimensions: 3072
# First 5 values: [-0.0123, 0.0341, -0.0089, 0.0211, -0.0156]
# Cosine similarity: 0.8612

How RAG Works — The Retrieval Pipeline

Retrieval-Augmented Generation lets an LLM answer questions about content it has never seen during training. The model stays frozen. The retrieval layer feeds it relevant context at query time. This is how AI Overviews cite fresh articles and how Perplexity quotes documentation published yesterday.

The Four-Stage Pipeline

Ingestion runs offline. Source content splits into chunks (usually by H2 boundary or fixed token window), and each chunk runs through an embedding model. Vectors get written to a vector database alongside metadata: source URL, language, published date, author, category.

Query runs at request time. The user's question is embedded using the same model. A different model breaks the geometric assumption — query vectors must occupy the same space as the indexed content vectors.

Retrieval finds the top-k nearest neighbors. Exact search at billion-vector scale is computationally infeasible, so production systems use ANN (approximate nearest neighbor) algorithms. HNSW (Hierarchical Navigable Small World) is the dominant choice — a multi-layer graph supporting sub-millisecond queries with 95%+ recall.

Generation feeds the retrieved chunks to an LLM as prompt context. The model synthesizes an answer grounded in the retrieved passages, often with inline citations.

Hybrid Search — The 2026 Standard

Pure vector search has a known weakness: exact entity matches. Product codes, SKUs, proper nouns, and rare technical terms appear too infrequently in training data to receive good embeddings. A user searching for "ESP32-S3-WROOM-1" wants the literal string. Pure vector search returns documents about "microcontroller modules" instead.

The 2026 production standard is hybrid retrieval. BM25 handles the lexical layer, catching exact matches. Dense vector search handles the semantic layer, catching paraphrases. The results merge and re-score through a cross-encoder reranker — a model that reads the full query and candidate passage together and produces a precise relevance score. Cross-encoders are too slow for first-stage retrieval over millions of documents; they are ideal for reranking 50 to 100 candidates from the merged pool.

Metadata filtering sits in front of vector scoring. A query for "Indonesian tax law 2025" applies language = 'id' and published_date >= 2024-01-01 as pre-filters, narrowing the candidate set before any embedding comparison runs. This is where structured data intersects retrieval — well-structured metadata makes your content addressable inside the filter.

def hybrid_retrieve(query: str, top_k: int = 5) -> list[dict]:
    # Stage 1: lexical retrieval via BM25
    bm25_hits = bm25_index.search(query, limit=50)

    # Stage 2: dense retrieval via cosine similarity
    query_vec = embed_model.encode(query)
    vector_hits = vector_db.search(query_vec, limit=50)

    # Stage 3: merge and deduplicate
    candidate_pool = merge_and_dedupe(bm25_hits, vector_hits)

    # Stage 4: cross-encoder reranking
    pairs = [(query, doc["text"]) for doc in candidate_pool]
    scores = cross_encoder.predict(pairs)

    ranked = sorted(
        zip(candidate_pool, scores),
        key=lambda x: x[1],
        reverse=True
    )
    return [doc for doc, _ in ranked[:top_k]]

How AI Overviews Use This

Google's retrieval layer for AI Overviews runs hybrid search across the indexed web. Candidate passages get pulled from pages that already rank for the query, then re-scored against the query embedding and metadata signals. The generation model receives 5 to 20 retrieved passages and writes the overview by synthesizing across them.

Three properties drive higher retrieval rates. Clean chunk boundaries — H2 sections that each resolve one specific intent — produce coherent vectors. Schema-structured content gives the retrieval layer typed entities to match against. Metadata richness (author entity, published date, topic taxonomy) clears pre-filter thresholds that gate vector comparison entirely. For deeper coverage of how AI Overviews select source content, the selection mechanics involve all three signals operating in sequence.

Embedding Models in 2026 — Which to Use

Model selection drives retrieval quality more than any other architectural decision.

ModelDimensionsCost / 1M tokensMultilingualBest Use Case
OpenAI text-embedding-3-large3072 (truncatable to 256/512)$0.13GoodEnglish-primary general RAG
OpenAI text-embedding-3-small1536$0.02AdequateBudget-constrained, high volume
Cohere embed-v31024$0.10Excellent (100+ languages)Multilingual corpora
Voyage AI voyage-3-large1024$0.18 (33% off via Batch API)GoodMaximum retrieval quality

OpenAI text-embedding-3-large

The general-purpose default for English-primary content. The 3072-dimension output supports Matryoshka truncation — the first N dimensions of the full vector remain useful on their own. A 256-dimension truncation outperforms Ada 002 at full 1536 dimensions on most benchmarks while reducing storage and compute costs by 6x. The OpenAI ecosystem delivers the strongest tooling story: native Assistants API integration, Batch API for 50% bulk discounts, and consistent SDK support across languages.

Cohere embed-v3

The production choice for multilingual content. Cohere's training emphasized cross-lingual alignment — the model produces vectors where "machine learning" in English and "pembelajaran mesin" in Indonesian sit near each other in the same embedding space. MTEB Multilingual benchmark results from Q4 2025 show Cohere embed-v3 outperforming OpenAI text-embedding-3-large by 4 to 9 points on non-English retrieval. For Arabic content the gap widens to 11 points — Cohere handles morphological variations (root-and-pattern grammar) that confuse OpenAI models.

Voyage AI voyage-3-large

The leader on the BEIR benchmark as of Q1 2026, with state-of-the-art performance on code retrieval, scientific documents, and mixed corpora. Voyage trained the model with explicit attention to contrastive learning over hard negatives — topically similar documents that answer different questions. The Batch API offers a 33% discount for bulk indexing operations tolerating 24-hour completion windows, eliminating most of the cost gap with OpenAI for one-time indexing.

Decision Framework

English-only blog under 100k vectors: text-embedding-3-small balances cost and quality. Multilingual SEO corpus (the Akselera Tech case): Cohere embed-v3 — multilingual parity matters more than marginal English advantage. Technical documentation where retrieval precision drives revenue: Voyage voyage-3-large justifies its premium. Greenfield projects without strong constraints: OpenAI text-embedding-3-large remains the safe production default.

Vector Databases — The Right Tool for Your Scale

The vector database stores embeddings and serves ANN queries. Three options dominate production deployments in 2026.

DatabaseTypeScale CeilingHybrid SearchBest For
pgvectorPostgres extension~10M vectorsManual (via tsvector column)Blogs, SaaS on existing Postgres
PineconeManaged serverlessBillionsBuilt-in (sparse + dense)Large-scale RAG without ML ops
WeaviateOpen source / cloud100M+Built-inTeams needing data control

pgvector

The PostgreSQL extension that adds a vector type and ANN indexing through HNSW or IVFFlat. Marginal cost on existing Postgres infrastructure approaches zero — the same database server handles transactional, analytical, and vector workloads. Queries integrate with existing SQL: joins, filters, and pagination work identically to any other column. The scale ceiling sits around 10M vectors with good performance on a single node. A 5M vector corpus at 1024 dimensions uses approximately 20 GB of RAM for the HNSW index. Beyond that, sharding or migration to a purpose-built vector store becomes the pragmatic path.

Pinecone

The managed serverless option. Pinecone handles infrastructure, sharding, and scaling automatically. Pricing scales with stored vectors and query volume. The built-in hybrid index — sparse (BM25-like) and dense (vector) representations in one index — eliminates the manual integration work pgvector requires for hybrid search. The trade-off is data residency and lock-in: Pinecone is proprietary, and exporting indexed data requires re-embedding. For teams without ML ops capacity needing to scale past 10M vectors quickly, Pinecone removes operational complexity.

Weaviate

Open source with both self-hosted and managed cloud options. Weaviate ships with a built-in vectorization pipeline — point it at content, configure an embedding model, and ingestion runs automatically. The architecture supports custom modules for reranking, generative steps, and external LLM integration. Weaviate fits when full data control matters, when the team has Kubernetes operational maturity, or when reranking logic needs to live close to the database. It scales to hundreds of millions of vectors on properly sized clusters.

-- Enable the pgvector extension
CREATE EXTENSION IF NOT EXISTS vector;

-- Create the content chunks table
CREATE TABLE content_chunks (
    id SERIAL PRIMARY KEY,
    slug TEXT NOT NULL,
    section_title TEXT NOT NULL,
    chunk TEXT NOT NULL,
    language TEXT NOT NULL CHECK (language IN ('en', 'id', 'ar')),
    published_date DATE NOT NULL,
    embedding vector(1024) NOT NULL
);

-- HNSW index for fast approximate nearest neighbor search
CREATE INDEX content_chunks_embedding_idx
    ON content_chunks
    USING hnsw (embedding vector_cosine_ops)
    WITH (m = 16, ef_construction = 64);

-- Supporting indexes for metadata pre-filtering
CREATE INDEX content_chunks_language_idx ON content_chunks (language);
CREATE INDEX content_chunks_published_idx ON content_chunks (published_date DESC);
CREATE INDEX content_chunks_slug_idx ON content_chunks (slug);

Building a Semantic Site Search That Mirrors Google

The most underused application of embeddings is as a diagnostic tool. Running your own embedding search over your own content surface answers a question no third-party SEO tool can: does my site have a chunk that would retrieve for query X, and how well? Treat this as part of an entity-based content architecture audit.

Why This Matters for SEO

Search Console shows what queries already drive traffic. It cannot show what queries should drive traffic and do not — because the relevant chunk does not exist, or exists with the wrong framing. A semantic site search lets you query your corpus with the language users actually use and see what returns.

The diagnostic operates in two directions. Run target queries you want to rank for and inspect the top-5 results. High similarity scores with thin traffic mean the content exists yet retrieval signals (internal links, crawlability, schema) are broken. Low similarity scores for queries you should rank for confirm a content gap.

Architecture

Four steps. Chunk every article at H2 boundaries — one section equals one chunk. Embed each chunk with Cohere embed-v3 for cross-lingual parity across EN, ID, and AR. Store the embeddings in pgvector with slug, section title, language, and published date as metadata. Build a query interface that returns the top 5 semantically similar sections with similarity scores. The function below uses psycopg2 and runs a cosine similarity search with language and date pre-filters.

import psycopg2
from psycopg2.extras import RealDictCursor
import cohere

co = cohere.Client()

def semantic_search(
    query: str,
    lang: str = "en",
    top_k: int = 5,
    min_date: str = "2023-01-01"
) -> list[dict]:
    # Embed the query with the same model used for indexing
    response = co.embed(
        texts=[query],
        model="embed-v3.0",
        input_type="search_query"
    )
    query_vec = response.embeddings[0]

    # Connect and execute the hybrid filtered search
    conn = psycopg2.connect(dsn="postgresql://...")
    with conn.cursor(cursor_factory=RealDictCursor) as cur:
        cur.execute("""
            SELECT
                slug,
                section_title,
                chunk,
                published_date,
                1 - (embedding <=> %s::vector) AS similarity
            FROM content_chunks
            WHERE language = %s
              AND published_date >= %s
            ORDER BY embedding <=> %s::vector
            LIMIT %s
        """, (query_vec, lang, min_date, query_vec, top_k))

        results = cur.fetchall()

    conn.close()
    return [
        {
            "slug": r["slug"],
            "section": r["section_title"],
            "score": round(r["similarity"], 4),
            "snippet": r["chunk"][:200]
        }
        for r in results
    ]

# Usage
hits = semantic_search("how do LLMs cite sources", lang="en", top_k=5)
for hit in hits:
    print(f"{hit['score']:.3f} — {hit['slug']} — {hit['section']}")

Interpreting Your Results

A similarity score above 0.85 between a target query and a returned chunk indicates strong semantic coverage. If that page has low traffic, the diagnosis points to retrieval-path problems: broken internal links, poor crawl frequency, missing schema, or stale published dates filtering the page out of AI Overview retrieval pools.

A similarity score below 0.65 for a query you want to rank for confirms a content gap. The relevant chunk either does not exist or exists with framing too distant from the user's mental model. Write the missing section, embed it, and re-run the diagnostic.

The middle band — scores between 0.65 and 0.85 — represents partial coverage. The topic is touched yet the resolution is incomplete. These are the highest-leverage rewrites because the existing page already has authority signals; sharpening the chunk improves both human readability and retrieval ranking.

What This Means for Content Strategy

Write for Embedding Similarity

The mental model of "write for humans, sprinkle in keywords for machines" maps poorly to embedding-based retrieval. Embeddings reward conceptual completeness — coverage of all the adjacent concepts in the same region of embedding space as the query. An article on "RAG architecture" that never mentions retrieval, chunking, vector databases, or context windows produces a vector that sits far from "how does RAG work."

Synonym variation matters less than topical completeness. The embedding model already knows that "vector search" and "semantic retrieval" are interchangeable. It cannot know that your article on RAG omits the chunking stage entirely. Write the missing concepts in. Trust the model on the synonyms.

Chunk-Level Optimization

Each H2 section should resolve one specific query intent. Sections that cover three unrelated concepts produce vectors that average across conflicting signals — the resulting embedding is mediocre for all three queries. This is the structural reason behind the chunk-level content optimization discipline: pages that hit AI citations consistently are built from coherent, focused sections. Tactical rule: one question per H2 for FAQ pages, one scenario per H2 for case studies, one concept per H2 for explainers. Sections longer than 400 words benefit from H3 subdivision.

Metadata as a Retrieval Pre-Filter

Published date, author entity, category, and language gate vector scoring entirely. An article from 2019 with no updated dateModified gets filtered out of AI Overview retrieval pools for time-sensitive queries regardless of embedding strength. Refreshed publish dates with substantive content updates restore eligibility. For structured data as a retrieval pre-filter, the goal is to make every filterable property machine-readable through JSON-LD. Articles with Person author entities resolving via sameAs to LinkedIn, Google Scholar, or Wikidata clear E-E-A-T thresholds inside AI Mode retrieval. Anonymous bylines fail those thresholds and get deprioritized regardless of content quality.

Key Takeaways

Vector embeddings convert text into geometric points where semantic distance is measurable. Cosine similarity is the universal distance metric; the practical range for related content sits between 0.65 and 0.95.

RAG operates as a four-stage pipeline: chunk and embed content, embed the query, retrieve nearest neighbors, generate an answer grounded in the retrieved context. Hybrid retrieval (BM25 plus vector plus cross-encoder reranking) is the 2026 production standard.

Model selection depends on language scope and budget. Cohere embed-v3 is the multilingual default. OpenAI text-embedding-3-large is the English general-purpose default. Voyage voyage-3-large is the premium retrieval-quality choice. Vector database choice depends on scale: pgvector handles under 10M vectors on existing Postgres, Pinecone handles billions without ML ops overhead, Weaviate handles 100M+ with full data control.

Build a semantic site search over your own corpus and use it as an SEO diagnostic. High similarity with low traffic exposes retrieval-path problems. Low similarity for target queries confirms content gaps. Chunk-level optimization and metadata richness drive retrieval quality more than keyword density ever did.

For coverage of how the retrieval layer translates into citation strategy, see GEO and AI citation strategy, ChatGPT's retrieval layer, Perplexity's citation engine, and the broader AI-native search engines in 2026 landscape. The mechanics of what AI crawlers ingest determine whether your content reaches the embedding stage at all.

Vector Embeddings
Semantic Search
RAG
AI Search
SEO Engineering