Frontier Foundry

Embeddings

The Library · Context Engineering & Memory

Vectors that place similar meanings near each other, used for search and clustering.

Also called: embedding model, text embedding, vector embedding. In the glossary.

Embeddings is cooling this week (×0.37 against the eight weeks before). What is moving.

How it works, as a machineThe Survey Office and its Pin Map · paper abstracts

Follow one paper abstract from a database row to a pin a question lands beside, in a survey office with a framed pin map.

  1. Add the task prefix
  2. Embed the text
  3. Cut to 256 dimensions
  4. Add it to the index
  5. Find the nearest vectors
Play Embeddings

Embeddings in plain words

An embedding turns a piece of text or an image into a list of numbers, placed so that things with similar meaning land close together. Search then becomes finding the nearest neighbours of a question. It is the usual way to find relevant material by meaning instead of by exact words.

An analogy

A map where towns are placed by what they are like, not by where they are. Fishing villages gather on one shore and mining towns in one valley, so finding somewhere like a given town means looking at what stands beside it. The map never says why two towns ended up together.

How Embeddings connects

3 typed relations in the knowledge graph

Builds on

  • Agent Memory: A memory store is pins of this kind, and it moves between devices only while the same embedding model is kept.
  • Retrieval-Augmented Generation: The pins nearest a question are the passages a retrieval-augmented answer is built from.

Built on by

Often in the same sources

Retrieval-Augmented Generation, Quantization

See Embeddings in the knowledge graph

What the sources say

3 parts · 11 sources · updated 2026-11-27

An embedding model turns a text, an image or a clip into one list of numbers, a point placed so that similar things land near each other; search then finds the points nearest to a question. The sources show the catch: one point per text blurs rare names and clauses, long texts are cut before they are plotted, and points made under different settings cannot be compared. Fixes (a vector per token, a pinned format) cost index size or a second index.

How an abstract becomes a point

A text is joined, stamped with the document prompt, turned into one list of numbers by an encoder, and trimmed to a width the index can afford. Anything past the encoder's length limit is never seen.

  1. The label press joins title and abstract, adds the document prompt and stamps a content hash.
  2. The plotting table turns the stamped text into one list of numbers: a point in a space of meaning.
  3. The nesting rack keeps the first 256 numbers of the list and rescales them to unit length.
256 or 512 tokens
Length at which many popular dense embedding models stop reading a document; the rest is dropped before scoring (limit of the plotting table) Hugging Face
768 to 128 dimensions, up to 6x
Width an open embedding model can be cut to by Matryoshka training, and the storage saved Google DeepMind
75 papers per second
Speed of the document pass on one GPU at 1024 dimensions in a 5,000-paper pilot Hugging Face
  • Each paper is embedded from its normalized title and normalized abstract joined into one text. Hugging Face
  • Each stored vector also keeps the normalization method and a content hash of the source title and abstract. Hugging Face
  • The embedding model takes a document prompt for the texts that are stored and a query prompt for the questions. Hugging Face

When it breaksThe long abstract cut at 512. On a medical test set whose passages averaged 941 tokens, retrieval models that stop reading at 180 to 512 tokens threw most of each passage away without a warning. Measured loss: up to 0.24 NDCG@10, more than the gap between model designs. Hugging Face

How the points are filed

Vectors are checked against one format, filed in a graph index built beside the live one, and switched on whole. Keeping the index true to the text as it changes is the hard part.

  1. The dimension gate refuses a vector whose model, width, scale or content hash does not match the live format.
  2. The pin board files each vector in a graph index, built beside the live one and switched on whole.
more than 110,000 papers
Number of current papers whose vectors the search keeps up to date Hugging Face
12.8 KB per document
Quantized size of 200 vectors of 128 dimensions for one document in a per-token index, or 12.8 GB for a million documents Hugging Face
about 42x the storage
Size of a vector-per-token index against a one-vector-per-passage index of the same passages (62 KiB per passage) Hugging Face
  • Before loading, an importer rechecks schemas, checksums, dimensions, normalization, unique paper ids and current content hashes. Hugging Face
  • A separate graph index (HNSW) is built for each new generation of vectors and marked active only once every eligible paper is covered. Hugging Face
  • New vector generations are imported beside the current one, indexed on their own, checked and switched on at once; rollback is a configuration change. Hugging Face

When it breaksVectors that no longer match. The post lists how embedding pipelines fail in subtle ways: a model revision changes, query and document prompts get mixed up, vectors are truncated differently, or an updated abstract no longer matches its stored vector. Nothing errors; the nearest points are simply the wrong ones. Hugging Face

How a question finds its neighbours

The question is plotted with the same model and the nearest pins are listed. A single point can blur a rare name or a second requirement; keeping a vector per token, or adding a keyword branch, wins that detail back at a price.

  1. The question booth plots the question with the query prompt, in the same space as the pins.
  2. The pin compass lists the pins nearest the question by cosine distance.
94.6% to 97.8% kept
Share of unpooled retrieval quality kept with 4x fewer document vectors, for a normally trained model and for a pooling-aware one Hugging Face
39x smaller, over 99% kept
Page-image index shrunk 39 times by pooling and int8 values while keeping over 99% of the baseline nDCG@10 Hugging Face
+2.6% code retention
Change in code retention in large codebases when semantic code search was allowed, in an online A/B test the speaker cites (reported; small because few queries need it) Kuba Rogut
  • A user query is embedded at request time under the same model contract as the stored papers. Hugging Face
  • The nearest stored vectors come from a cosine-distance search over the active generation, fifty at a time. Hugging Face
  • Multi-vector models are asymmetric: queries and documents take different prefixes and length caps, so the query encoder and the document encoder must each be used. Hugging Face

When it breaksThe green sofa with the wrong legs. A dense model squeezes a whole text into one vector, so a rare name, an exact identifier or one clause must compete for room. For a query asking for a green sofa with wooden legs and rounded cushions, the four requirements blend into one point and a green sofa with the wrong legs lands beside the right one. Hugging Face

Open questionDoes an agent need a pre-built vector index, or is grep enough?

  • Embeddings are cached compute: pay once to chunk, embed and index, then every agent session queries the index instead of grepping again, and it finds files related by behaviour. Kuba Rogut
  • For code, grep and read worked without any index: code is small, text, on disk and full of breadcrumbs, and a pre-built vector index is hard to keep in sync as the code changes. George He

Sources

11 in all

More in Context Engineering & Memory

The Library: the whole area
  • Context EngineeringDeciding what goes into a model's limited context window, when, and in what form.
  • Long ContextModels that read very long inputs (hundreds of thousands to millions of tokens).
  • Retrieval-Augmented GenerationFetching relevant documents at question time and putting them in the prompt.
  • Agent MemoryLetting agents keep and recall information across sessions.
  • Prompt EngineeringWriting instructions and examples that steer a model's behavior.
  • Prompt CachingReusing computation for repeated prompt prefixes to cut cost and latency.
  • Knowledge GraphsStoring facts as linked entities so agents can traverse relationships.