Skip to main content
Technical Guide

The Met Search Lab Technical Guide

The Met Search Lab is a working technical reference for The Met's collection-search approach. Rather than publishing the production application code, the lab provides a reproducible environment for inspecting, comparing, and adapting its search architecture.

It documents keyword retrieval, generated visual evidence, embeddings, hybrid scoring, semantic thresholds, and collection-navigation facets over roughly 11,000 Open Access Met objects.

AI coding agents helped build the project, including this technical guide, under human direction, review, and validation. See About This Guide for the disclosure and usage boundary.

Production, Lab, And Experimental Scope

The guide distinguishes the documented production approach, the current public lab default, and options exposed specifically for experimentation. The lab reproduces architectural decisions rather than the complete production application, evidence set, or undistributed prompts.

Comparison of The Met production search, the public lab default, and experimental options
AreaDocumented Production ApproachPublic Lab DefaultExperimental Options
Collection scope536,294 object records, with embeddings for roughly 360,000 objects that have images.A reproducible sample of roughly 11,000 Open Access Met objects.Drawn from the same lab corpus so search variants can be compared on shared collection evidence.
Generated visual evidenceThe Met's internal Agentic Vision v4 visual-description generator; the exact production prompt is not distributed here.The Medium field from the public visual-description-lengths-v1 generator.Short and Long compressions from the same visual reading.
Text embeddingGemini Embedding 001 at 768 dimensions.Medium Visual Description with Gemini Embedding 001 at 768 dimensions.Short, Medium, and Long descriptions with Gemini Embedding 001 or Gemini Embedding 2.
Query embedding cacheUpstash Redis caches embeddings for normalized query text so repeated Semantic and Hybrid queries can reuse a compatible vector.No cross-request query-embedding cache; the API generates a live vector unless the request supplies one.Measure cache hit rate, provider latency, and end-to-end latency separately from Elasticsearch took.
Direct image embeddingOutside the production recipe documented by this lab.Not part of the default search variant.Gemini Embedding 2 at 768 or 3072 dimensions, plus OpenAI CLIP ViT-L/14 at 768 dimensions.
Vector executionExhaustive script-score cosine comparison across the eligible vector-bearing scope.The same script-score execution; approximate kNN is documented but not implemented.Alternate evidence, dimensions, thresholds, and weights within the same execution model.
Hybrid defaults50% saturated BM25, 50% thresholded semantic evidence, with similarity calibrated to 0.65.The same 50 / 50 weights and a 0.65 starting threshold, with disjunctive facets.Adjustable keyword balance, minimum similarity, generated keyword evidence, and fuzziness.

Overview

Each search variant can use keyword search, semantic search, or a hybrid of both.

Keyword

Keyword search over object catalog metadata. Use it when you know the words likely appear in the record and/or want interpretable results.

Semantic

Looks for artworks that are visually or conceptually similar to the meaning of your query. Use it for visual or descriptive queries or when exact words may not appear.

Hybrid

Combines keyword and semantic evidence so literal matches and broader recall work together. Use it when you want keyword evidence to anchor results while semantic search broadens recall.

From collection object to search result

Elasticsearch stores the Met object record, generated text such as visual descriptions, and embeddings derived from generated visual descriptions or images. The pipeline first prepares that evidence for the index, then combines it at search time to produce ranked results and navigable filter counts.

1 · Build and index collection evidence

Run when collection evidence is prepared.

Inputs

Collection record + image

A museum database or API supplies catalog metadata and an object image.

Prepare

Complementary evidence

Catalog: preserve the museum metadata as literal evidence.
Generated: image + selected metadata → VLM + prompt → visual description.
Direct image: carry the image forward for multimodal embedding.

Represent

Embedding models

Text model: visual description → text vector.
Multimodal model: primary image → image vector.

Catalog and generated text also remain searchable without embedding.

Index

Elasticsearch object document

One document stores catalog fields, generated searchable text, and multiple named vector fields.

Human editorial review path

Human review can identify recurring errors and omissions, refine the prompt, and trigger regeneration. The live lab does not currently require per-description approval before indexing.

review → revise prompt → regenerate ↺

2 · Search and navigate the collection

Run for each visitor query.

Request

User query + filters

The same query text feeds literal and semantic retrieval, using the selected embedding strategy and filters.

Retrieve

Parallel evidence

Keyword: BM25 over catalog and optional generated text.
Semantic: query embedding compared with the selected vector field.

Rank

Execute + fuse

Keyword uses BM25. Semantic and Hybrid use exhaustive script score; Hybrid combines saturated BM25 with thresholded semantic similarity.

Respond

Results + navigation

Ranked hits flow through the post-filter; disjunctive aggregations populate filter counts for collection navigation and comparison.
The upper lane happens while the collection is prepared and indexed, including an editorial feedback loop before generated descriptions become search evidence; the lower lane happens for each search. Ranking and aggregations share one script-score query context, so the returned hits and disjunctive counts describe the same threshold-defined universe.

Replicate The Met Approach

The live lab keeps The Met's script-score execution and 50 / 50 hybrid weights, while its default evidence recipe is intentionally simplified. A Lab default badge marks the active Medium Visual Description recipe; changing one of its settings removes the badge.

1. Prepare complementary evidence

Keep concise catalog metadata as the primary literal signal. Generate an objective visual description for each artwork image, then embed that description as the semantic signal. The production pipeline currently uses The Met's internal Agentic Vision v4 visual-description generator and a 768-dimensional Gemini text embedding. This public lab instead defaults to the Medium field from its reproducible visual-description generator. The internal v4 strategy remains documented as the historical production-aligned baseline used to calibrate the completed study, but it is not an active search option or field in the current lab index.

Use the same embedding model, dimensions, normalization, and task conventions for indexed documents and live queries. Store the model and source-text version with each vector so a reindex cannot silently mix incompatible embeddings.

2. Map the vector field

Set index: false because script score reads stored vector values directly and does not need an approximate vector index. The lab indexer also excludes embeddings from _source to avoid retaining and returning large arrays there; scripts can still access the vector values.

{
  "mappings": {
    "_source": {
      "excludes": ["embeddings.*"]
    },
    "properties": {
      "embeddings": {
        "properties": {
          "embedding__visual_description_lengths_v1_medium_gemini_768": {
            "type": "dense_vector",
            "dims": 768,
            "index": false
          }
        }
      }
    }
  }
}

3. Build a complete match universe

The lexical clause saturates BM25 with score / (score + 8). The vector clause rejects documents below the similarity threshold, rescales the remaining cosine range to 0–1, and applies its weight. A bool.should union means a document can enter through either literal or semantic evidence.

bounded contribution1.0 ceiling — never reached_score 8 → 0.5 · half-saturation k = 8081624324000.51raw BM25 _scorekeyword clause = saturated score × 0.5
BM25 saturation with k = 8. Raw BM25 scores are unbounded, so one strong field match could otherwise drown out the semantic clause. score / (score + 8) maps any raw score into 0–1: a score of 8 lands at exactly 0.5, and further increases approach 1.0 with diminishing effect. The bounded value is then multiplied by the keyword weight (0.5).

Abridged structural example: the production and lab implementations use the larger field set documented below, plus eligibility and facet clauses appropriate to their collections.

{
  "query": {
    "bool": {
      "should": [
        {
          "script_score": {
            "query": { "multi_match": { "query": "<query>", "fields": ["title^4", "artistDisplayName^3", "medium^1.5"] } },
            "script": {
              "source": "(_score / (_score + params.saturation_k)) * params.weight",
              "params": { "saturation_k": 8, "weight": 0.5 }
            }
          }
        },
        {
          "script_score": {
            "query": { "bool": { "filter": [{ "exists": { "field": "embeddings.embedding__visual_description_lengths_v1_medium_gemini_768" } }] } },
            "script": {
              "source": "double c = cosineSimilarity(params.vector, 'embeddings.embedding__visual_description_lengths_v1_medium_gemini_768'); if (c < params.threshold) return 0; return ((c - params.threshold) / (1 - params.threshold)) * params.weight;",
              "params": { "vector": "<query vector>", "threshold": 0.65, "weight": 0.5 }
            },
            "min_score": 0.000001
          }
        }
      ],
      "minimum_should_match": 1
    }
  }
}

Elasticsearch documents the per-match scoring and linear vector scan behavior in its script-score query reference.

Put collection-wide hard constraints—rights, publication state, date bounds, or mandatory AND filters—inside both scoring clauses. Keep ordinary navigational facet selections out of the base query so aggregations can still calculate alternatives.

4. Add disjunctive facets

Elasticsearch calculates the scored query first, aggregations second, and post_filter last. Apply every selected facet to returned hits in the post-filter. For each facet aggregation, apply all selected facets except that facet itself. This is AND across facets and, in a multi-select interface, normally OR within one facet.

1 · Scored query — the match universehard constraints only, no facet selections2 · Aggregations → facet countsrun on the complete match setDepartment counts apply ClassificationClassification counts apply Departmenteach facet skips its own selection3 · post_filter → hitsapplies every selected facetruns after counts are computedhits narrow — counts do not moveFilter dropdown countsdisjunctive — alternatives stay visibleResult listonly objects matching every selection
One request, two outputs. Aggregations and post_filter both start from the same scored match universe, but aggregations run first: each facet count applies the other selected facets and skips its own, so the Department dropdown keeps showing alternatives even while a Department is selected. The post filter then narrows only the visible hits, without changing any counts. Example selections: Department = European Paintings, Classification = Paintings.
{
  "aggs": {
    "department": {
      "filter": {
        "bool": {
          "filter": [
            { "term": { "classification.keyword": "Paintings" } },
            { "term": { "isHighlight": true } }
          ]
        }
      },
      "aggs": {
        "values": {
          "terms": {
            "field": "department.keyword",
            "size": 50,
            "show_term_doc_count_error": true
          }
        }
      }
    }
  },
  "post_filter": {
    "bool": {
      "filter": [
        { "term": { "department.keyword": "European Paintings" } },
        { "term": { "classification.keyword": "Paintings" } },
        { "term": { "isHighlight": true } }
      ]
    }
  }
}

Repeat that filtered aggregation for every facet. Preserve selected values with an explicit filter bucket when they may fall outside the top terms. In a multi-shard index, inspect doc_count_error_upper_bound; script score gives a complete query match universe, but a distributed terms aggregation can still report bounded bucket-count error. The lab index uses one shard, so its local terms counts report an error bound of zero. See Elasticsearch’s post-filter guide and terms aggregation count-error guidance.

5. Benchmark before production

Vector functions in script score linearly scan the documents admitted by each clause. Disjunctive facets deliberately keep navigational filters out of the scored query, so they can cost more than a query that pushes every selected facet into the vector filter. Measure empty, broad, and narrow queries against the full collection, with production shard counts and concurrent traffic.

Start with similarity-threshold and relevance evaluation, then measure latency. If your institution prototypes kNN separately, compare it only after the exhaustive script-score baseline is stable: its bounded top-k window is not a substitute for complete collection-navigation counts.

Keyword Search

Keyword search is lexical search: it ranks documents by matching the words in your query against indexed text fields. Elasticsearch scores those matches with BM25, a relevance formula that rewards query words appearing in a document while accounting for field length and term frequency.

Multi-word queries use a minimum-match rule: two terms must both match, three to five terms may miss one term, and longer queries must match 75% of terms. Adjacent phrase matches still get a smaller boost, so phrases like pink textile are treated as phrase intent without overwhelming the term match.

Optional fuzzy keyword matching is conservative: one-to-five-character terms get no edits, six-to-ten get one edit, and longer terms get two edits. That keeps short-name searches like monet from drifting into broad typo expansions.

Queries that look like accession numbers, such as 1979.486, are boosted heavily for exact accession matches and can also match by prefix.

Keyword Fields And Weights

The list below is sorted by effective boost, not by source-code declaration order.

  1. title^4
  2. artistDisplayName^3
  3. objectName^2.5
  4. constituents.name^2
  5. classification^2
  6. medium^1.5
  7. tags.term^1.5
  8. culture^1.25
  9. period, dynasty, reign, artistNationality, and portfolio
  10. department^0.75, country^0.75
  11. region^0.5, city^0.5
  12. creditLine^0.25

The ^ number is a boost. Higher numbers make a match in that field count more. For example, a title match matters much more than a credit-line match.

Each metadata field searches both a stemmed English-analyzed version, such as title.en, and a lower-weight raw text version, such as title.

Fuzzy keyword matching is on by default for minor spelling mistakes. It uses a conservative prefix and edit-distance window so a query like qumrat can recover a close spelling such as qumran without drifting into broader neighbors like quart. Turn it off when you want stricter keyword comparisons.

Visual descriptions

medium_description^0.5

Generated-field boosts are intentionally modest. Generated visual descriptions help recall visual subjects that are missing from museum metadata, but concise museum fields should still anchor keyword ranking.

Semantic Search

Semantic search turns your query into an embedding and compares it with stored artwork embeddings. Instead of requiring the same words to appear in the object record, it looks for objects that are close to the meaning or visual idea of the query.

This is useful for descriptive searches like person looking into a mirror, scene searches like sparsely furnished interior, or subject searches where catalog metadata may not use the words you typed.

The semantic side depends on the selected embedding strategy, which controls whether the search uses generated-description vectors or image-only vectors. Min similarity controls how strict the semantic match must be before a result is shown.

Min similarity 0 — cutoff at 0Min similarity 0.5threshold 0.5remaining range rescales to 0–100.250.50.751cosine similarity between query and document← less relevantmore relevant →counted in hits and facet countsscored 0 — excluded
The same ten positive-cosine vector matches under two Min similarity settings. With the cutoff at 0, all ten illustrated matches enter the results. At 0.5, matches below the line are scored 0 and drop out of hits and facet counts, while the surviving range is rescaled to 0–1 before the semantic weight applies.

Semantic variants always use script score, evaluating the similarity threshold across the complete eligible vector-bearing query scope. Their variants can still compare embeddings, thresholds, filters, generated evidence, and other settings within that exhaustive execution model.

Embeddings can also support cross-language searches because the query and indexed artwork evidence are compared by meaning rather than by shared words. That is why queries such as floresor 猫 can retrieve visually relevant objects even when the catalog text is in English.

Hybrid Search

Hybrid search combines keyword and semantic retrieval. It is useful when you want literal catalog evidence to anchor the ranking while still allowing semantic search to find visually or conceptually relevant objects that use different words.

Hybrid variants always use a plain script-score query that combines a saturated BM25 keyword clause with a thresholded cosine-similarity clause. It is more expensive than approximate retrieval, but it gives Elasticsearch a complete hybrid match set for collection navigation.

How script score differs from other fusion approaches

The lab implements only script score, but Linear and RRF are useful reference points when evaluating another architecture. Script score combines fixed transformed scores across the complete query scope. Linear generally combines scores normalized relative to bounded keyword and kNN windows; RRF combines rank positions instead of raw scores. A 50 / 50Linear sum therefore is not equivalent to this project's fixed 50 / 50 script-score formula.

Script score

Fixed score scales

Met default

Keyword evidence

Saturate every BM25 match with score / (score + 8).

Semantic evidence

Keep cosine similarity ≥ 0.65, then rescale the surviving range to 0–1.
0.5K + 0.5S

What matters: match strength across the complete query scope.

Linear retriever

Window-relative score scales

Keyword evidence

Retrieve the keyword window, then Min-Max normalize its BM25 scores.

Semantic evidence

Retrieve the kNN window, then Min-Max normalize its similarity scores.
0.5K + 0.5S

What matters: match strength relative to each bounded result window.

RRF retriever

Rank positions, not score scales

Keyword evidence

Record each document's rank in the keyword window.

Semantic evidence

Record each document's rank in the kNN window.
Σ 1 / (60 + rank)
Ranked #2 in both lists: 2/62
Ranked #1 in one list: 1/61

What matters: agreement across the two lists; their raw score scales are ignored.

Only the script-score path is implemented in this project. Linear and RRF are shown as architectural reference points: they fuse bounded keyword and kNN result windows instead of combining fixed score transforms across the complete threshold-defined query scope.

Elasticsearch describes Linear as a weighted sum of normalized child-retriever scores and RRF as a sum of reciprocal-rank contributions. See the Linear retriever reference and RRF retriever reference. For the broader execution tradeoff and the HNSW and DiskBBQ controls, see Elastic's kNN search documentation.

Approximate kNN contributes a bounded top-k semantic result set rather than every object above a semantic threshold. For HNSW-backed fields, num_candidates sets how many nearest neighbors each shard gathers before the top k is chosen. Raising it improves recall, which can change which documents make the top k and, when the similarity cutoff leaves fewer than k, find more that qualify, but the top k remains the limit. k cannot exceed num_candidates, which is capped at 10000. DiskBBQ instead exposes visit_percentage. kNN's own similarity parameter can only remove documents from that top k. Aggregations therefore count at most k semantic matches (globally for a top-level knn search, per shard for a knn query), not every collection object that might satisfy a semantic threshold. Disjunctive hybrid retrieval adds every keyword match: a query beside top-level knn, or knn and keyword queries as bool should clauses with minimum_should_match: 1. Combining them under bool mustcounts only their intersection. With RRF, aggregations likewise cover every child retriever's matches; rank_window_size limits ranking and paging, not aggregations. A separate keyword aggregation cannot repair the gap because it cannot count semantic-only matches. Script score evaluates the semantic threshold in the query itself, so aggregations can count keyword matches plus semantic matches in one query context.

The primary variant's hits and shared filter counts therefore come from the same script-score or keyword request. There is no secondary aggregation query, top-k window count, or cross-variant bucket merge.

The tradeoff is that script score scans matching vector-bearing documents instead of using the approximate nearest-neighbor index. This is reasonable for the default 768-dimensional embedding strategy, but higher dimensional strategies should be treated as benchmark targets before relying on them for broad script-score comparisons.

Script score compared with approximate kNN

Neither execution strategy is universally better. Script score buys a complete, threshold-defined search universe for navigation; kNN buys efficient top-neighbor retrieval. Choose against the product requirement, then benchmark with the institution's own index, filters, traffic, and hardware.

Script score — exhaustivesimilarity thresholdevery vector scored; all 12 matches countedApproximate kNN — HNSWnum_candidates = 18similarity thresholdtop k = 6only the top k counted: 6 of 12 matchesquerycountedmatch, not countedscored, below thresholdoutside candidate pool
The same eligible vector-bearing collection and the same similarity threshold under both execution strategies; distance from the query stands for cosine similarity. Script score computes every document's similarity, so all threshold matches enter hits and aggregations. HNSW kNN keeps the nearest num_candidates it finds on each shard, returns the top k, and drops any of those below the similarity threshold. Aggregations count that top k, so a larger num_candidates can improve which documents are returned but never counts more than k. Single-shard schematic drawn with perfect recall; a real HNSW search can also miss true neighbors.
Comparison of script-score and kNN semantic search execution
ConsiderationScript scoreApproximate kNN
Search scopeEvaluates every eligible vector-bearing document in the query scope, alongside the keyword matches in hybrid search.Uses an indexed approximate-nearest-neighbor structure to retrieve a bounded top-k result set.
Facet countsAggregations run over the complete threshold-defined match set, enabling disjunctive collection navigation.Aggregations describe the bounded top-k result set, not every document that could pass a semantic threshold.
Latency and computeDoes per-document vector scoring, so cost grows with eligible vector documents, vector dimensions, and concurrent traffic.Usually much faster for top-neighbor retrieval; k bounds results, while index-specific search controls tune speed and recall.
Vector indexReads non-indexed dense vectors and does not require the memory, storage, or construction cost of an approximate vector index.Requires indexed vectors and pays the costs of an approximate structure such as HNSW or DiskBBQ.
Hybrid rankingMakes the lexical saturation, cosine threshold, and weights explicit in one scored query.Works well with Linear or RRF fusion, but the result depends on k, rank windows, and fusion settings.
Good fitCollection discovery where complete, navigable facet counts matter and the measured response time meets the product requirement.Large-scale or high-throughput retrieval where low latency and the best top results matter more than a complete semantic facet universe.

Use hybrid for searches like pink textile, woman and child, or ship in a storm, where catalog metadata and visible description can both carry useful evidence.

Embeddings

An embedding is a numeric representation of text, an image, or both. Similar meanings or visual patterns end up near each other in vector space, which lets semantic search retrieve objects even when the query and catalog record do not share exact words.

1 dimensiondarklightdifferent artworkscollide on one value2 dimensionssceneportraitlighta second attributeseparates them3 dimensionslightsubjectcoloreach new axis capturesanother attribute768 dimensions…[0.12, −0.44, 0.83, …]room for subject, palette,mood, style, setting…similar meaning lands nearby — cosine similarity measures that closeness
Why hundreds of dimensions? Follow the two blue artworks — say, a dark seascape and a dark portrait. With one dimension there is a single number per artwork, so they collide on the same value. A second dimension separates them, and every added dimension makes room for another distinction. At 768 dimensions there is room to encode subject, composition, palette, mood, and style at once. Real embedding dimensions are learned by the model rather than hand-labeled — these named axes are an analogy — but the geometry is the point: similar meaning lands close together, and cosine similarity measures that closeness.

Semantic and hybrid variants search one stored vector field at a time in Elasticsearch.

Google's published dimension results show why 768 is a practical default: its MTEB score is 67.99, only 0.18 points below the best listed score, while using one-quarter as many raw vector values as 3072 dimensions. See the official Gemini Embeddings documentation.

Gemini Embedding 001 MTEB scores and relative raw vector sizes by dimension
DimensionsMTEB scoreRaw vector values vs. 3072
204868.1667%
153668.1750%
76867.9925%
51267.5517%
25666.198%
12863.314%

The percentages compare raw vector length, not total Elasticsearch index storage, which also includes document and mapping overhead; an approximate-search design would add vector-index overhead as well. MTEB is a broad text-embedding benchmark rather than a museum-search relevance test, and Google's dimension table does not report a separate 3072 score; institutions should still evaluate dimensions with their own collections and queries.

Text Embeddings

Text embeddings represent generated visual descriptions or composed metadata as vectors. They are useful when generated text captures visible subjects, style, composition, or context that users may search for.

Each Short, Medium, and Long description is available through two parallel embedding strategies: Gemini Embedding 001 and Gemini Embedding 2 at 768 dimensions. Hold the model fixed to compare description length, or hold the description field fixed to compare the two models. Their vector spaces are incompatible, so every stored document vector is queried with its matching model and retrieval format.

Google's model lifecycle table lists Gemini Embedding 2 as the recommended replacement for Gemini Embedding 001. The lab keeps the existing 001 strategies and default intact so the new vectors can be evaluated in parallel before any migration decision.

Short Visual Description

Embeds only the 15–35-word output.short_description from the shared Long-to-Medium-to-Short response.

Medium Visual Description

Embeds only the 50–150-word output.medium_description. This is also the one generated field shared by all three variants on the hybrid keyword side.

Long Visual Description

Embeds only the detailed 150–300-word output.long_description from the same Gemini response.

Image Embeddings

Image embeddings represent object images directly. They can help with visual queries where the best evidence is in the image rather than the written record.

The current multimodal model used here is Gemini Embedding 2, which maps text and images into a shared embedding space. The app indexes the same image-only input at 768 and 3072 dimensions. Live text queries use the model's search-query prompt formatting, and hybrid keyword evidence still comes from the shared Medium description. The historical baseline uses a pinned OpenAI CLIP ViT-L/14 checkpoint locally for image vectors and Replicate for matching raw-text query vectors. Because CLIP cosine scores occupy a different range, selecting it applies its calibrated 0.225 default threshold; explicit threshold edits still take precedence.

Image Only (Gemini 2 768)

Embeds only the primary view, preferring primaryImageSmall and falling back to primaryImage. additionalImages, generated text, and catalog metadata are not included.

Image Only (Gemini 2 3072)

Uses the same primary-only image input as the 768-dimensional version, but stores the full 3072-dimensional Gemini Embedding 2 vector.

Image Only (OpenAI CLIP ViT-L/14)

Uses the same primary-only image input with the original OpenAI CLIP ViT-L/14 checkpoint through local Transformers/MPS. Replicate supplies matching live text-query vectors. Raw 768-dimensional vectors are normalized before cosine search. Its calibrated default similarity threshold is 0.225.

Why Embed Generated Descriptions?

A generated description inserts an inspectable textual representation between an artwork image and its retrieval vector. That intermediate layer changes what can be understood, governed, reused, and tested even when the final text embedding is still a learned and imperfect representation.

Direct image embedding

image → opaque vector representation

Generated-description embedding

image → inspectable description → vector representation

Inspectable, governable evidence

Descriptions can be reviewed, corrected, regenerated, and versioned. Prompts and descriptive policies can constrain which claims and terminology become explicit search evidence, making errors and omissions easier to locate and repair.

Natural-language alignment

A vision-language model can verbalize visible actions, positions, relationships, materials, and forms that a text embedding can match compositionally. The generation prompt also controls which level of visual abstraction the representation emphasizes.

Reusable retrieval evidence

One durable description can contribute modestly to BM25 and be re-embedded with later text models without repeating visual inference over the collection. This separates visual interpretation from the retrieval model and can simplify future migrations and reindexing.

Controlled comparison

Hold a description constant while changing embedding models, or hold the embedding model constant while changing description length. The lab supports both comparisons, making retrieval differences easier to attribute.

AI Generation

The Met Search Lab uses AI-generated text to make parts of the collection searchable in ways that catalog metadata alone may not support. For selected Open Access objects, the pipeline generates structured descriptions from object images and metadata, then stores that generated text alongside the original Met object record.

The generated visual descriptions in this lab are produced by vision-language models. The current prompts use Agentic Vision in Gemini 3 Flash, a capability that combines visual reasoning with code execution so the model can zoom, inspect, and ground answers in visual evidence.

Description Principles

Each description is the result of a prompt that asks the model to look carefully and report what it sees. We strive for objective, useful visual description while recognizing that every description involves choices about what to notice, name, order, and omit. The prompts try to make those choices explicit and conservative rather than pretending that generated language is neutral.

Visible Evidence First

The model is asked to describe what is visibly present: form, subject matter, composition, materials, colors, decoration, surface, condition, and distinctive details. Metadata may help disambiguate visible features, but it should not add unseen history, biography, maker knowledge, or symbolic meaning.

Structured Looking

Descriptions start with the object type or main visual form, then move through important visible content and details in a consistent spatial order. This follows the same general discipline encouraged by museum image-description practice: begin with what matters most, then branch outward without creating spatial confusion.

Plain, Searchable Language

Concrete nouns and visually justified terms are preferred over broad summaries or specialist language. The descriptions include enough detail to support search queries such as materials, objects, figures, settings, colors, and spatial relationships, while avoiding prose that reads like interpretation or evaluation.

Responsible Limits

Prompts discourage subjective judgment, emotional diagnosis, social assumptions, and claims about race, ethnicity, nationality, religion, identity, or narrative significance unless they are visually clear or explicitly supported. When something is uncertain, the description should use broader, qualified language.

Human Review Boundary And Prompt Refinement

The live lab treats generated descriptions as experimental search evidence, not individually approved museum records. Its index accepts provider-successful rows that match the active schema, prompt hash, and primary-image scope; it does not currently require a per-description human approval field.

Human review remains essential for evaluating unsupported claims, missed visible details, inconsistent terminology, overconfident identification, and patterns that could distort retrieval. Findings should feed back into the versioned prompt and regeneration workflow rather than remaining only as one-off corrections to individual records.

This approach is informed by image-description guidance such as the Cooper Hewitt Guidelines for Image Description, which treats description as an accessibility practice and emphasizes visible content, structure, spatial relationships, color, medium, and context-sensitive language. The Met Search Lab adapts those principles for search: the descriptions are not replacement catalog records, but generated visual evidence that can make visually present features easier to find.

Generated text is treated as search evidence, not museum catalog data. It feeds the keyword query alongside catalog fields and serves as source text for selected embedding strategies. The controls let you compare variants with generated keyword content on or off, and generated content panels in results help show what the model contributed.

Controlled Description-Length Study

The public visual-description prompt asks one pinned Gemini model to create Long, then Medium, then Short descriptions in a single structured response. The three fields are embedded separately with the same Gemini Embedding 001 model at 768 dimensions. Only description length changes; all three hybrid variants share Medium as their generated keyword field.

The outputs are correlated compressions of one visual reading, not independent prompt samples. Each embedding needs its own calibrated similarity threshold: the evaluation matches median result breadth to the historical V4 baseline at 0.65 on a fixed calibration split, then freezes thresholds before the held-out test. On the frozen 10,000-object study cohort, that procedure selected 0.655 for Short and 0.650 for both Medium and Long. These values are calibration results, not transferable defaults. The blind held-out pool is frozen, but its human relevance judgments remain pending, so the study does not yet establish a description-length winner. Medium remains the active lab default.

The public reference prompt lives in a versioned Markdown file. Historical Agentic Vision artifacts remain in repository history and the frozen evaluation record, but they are not indexed or exposed by the live lab and their exact production prompts are not distributed in the current tree.

Generator Reference

The executable public reference prompt below is loaded from its versioned generator Markdown file. It is a simplified, reproducible experiment inspired by The Met's production principles, not the exact production prompt.

Search Controls

These controls are the main levers for changing retrieval behavior. Use them to decide which evidence is searched, how strict the result set should be, and how keyword and semantic signals are combined.

Core controls

Keyword / Semantic Balance

One control defines the search behavior. 100 / 0 runs ordinary Keyword search, 0 / 100runs Semantic script score, and intermediate values run Hybrid script score. New variants start at The Met's 50 / 50 balance.

Between the endpoints, the percentages weight saturated BM25 and thresholded cosine similarity. This keeps both signals bounded per document so strong semantic matches can interleave with weaker keyword matches.

Embedding Strategy

Chooses whether semantic and hybrid search use the Short, Medium, or Long generated-description vector from Gemini Embedding 001 or Gemini Embedding 2, an image-only Gemini 2 vector at 768 or 3072 dimensions, or the image-only OpenAI CLIP ViT-L/14 baseline. New variants default to Medium Visual Description with Gemini Embedding 001.

Tuning

Min Similarity

The Met default is 0.65. This threshold was calibrated for descriptions from The Met's internal Agentic Vision v4 visual-description generator, embedded with Gemini Embedding 001 at 768 dimensions. The active Medium and Long Visual Description strategies independently calibrated to the same numeric value, while Short selected 0.655. Neither value is universal: higher thresholds are stricter and lower thresholds allow broader matches.

The new Gemini Embedding 2 description strategies start at 0.65 as a provisional interface default; calibrate them independently before treating result breadth or relevance as comparable to Gemini Embedding 001.

In Script score, this value also controls which semantic-only objects are included in facet counts. Tune it conservatively when using script-score facets for drill-down decisions.

Fusion Min Score

Accepts 0–1 and defaults to 0, matching the bounded composite score range. Prefer Min similarity for defining the semantic set that facets count. This top-level cutoff excludes lower-scoring documents from both hits and aggregations, so a nonzero value is recorded as part of the facet-count definition.

Toggles

Generated Keyword Content

On by default. When enabled, the shared Medium visual description participates in the same keyword query as museum metadata. Turn it off to test whether generated text helped or introduced noise.

Fuzzy Keyword Matching

On by default. Allows conservative spelling tolerance on the keyword side. Turn it off when you want stricter lexical comparisons.

Result Set

Filters

Department, Classification, Object Type, Tag, and Highlight are shared across variants. They narrow hits without changing scores. Counts come from the primary variant's complete threshold-defined query universe, and each facet excludes its own current selection while applying the other selected facets.

Reset

The Reset button clears the querystring, resets shared filters, returns to one default variant, and runs the default browse search again.

Object Pages

Result cards link to an object detail page that keeps the search context in the URL, including the query, variant, rank, and score. The page is meant for inspecting why an object appeared in a result set, not only for viewing the artwork record.

Object Record

Shows the primary image, title, date, artist or constituent lines, collection metadata, tags, measurements, and a link back to the object on metmuseum.org.

Generated Content

Displays indexed generated visual descriptions by generator version, including provider, model, schema, prompt file, and run metadata when available.

Similar Objects

Uses the current object's stored vector as the query vector, then runs an exhaustive script-score cosine search for each selected embedding strategy, matching the production execution pattern. This is object-to-object similarity, not a rerun of the text query.

Source Data

Provides expandable field summaries and raw indexed JSON so search behavior can be traced back to the exact ES document.

Similar Objects is useful for comparing embedding strategies directly. Text-description embeddings often group works by depicted subjects and visual language, while image-only embeddings can emphasize composition, medium, or visual appearance. Results are filtered to objects with images and should be read as model neighborhoods rather than curated related works. Object-page similarity scans the eligible vector-bearing documents with script_score, using the same exhaustive execution approach as semantic collection search.

Example Test Queries

These queries are useful for checking whether a search change improves the right behavior without causing regressions elsewhere.

Good For Keyword Search

These depend on exact words, names, titles, credit lines, or multi-word catalog phrases.

Good For Semantic Search

These describe visual ideas, cross-language concepts, or subjects that may not appear literally in catalog metadata.

Good For Hybrid Search

These mix literal catalog evidence with visual or conceptual intent, so both signals can help.

Mixed Literal And Visual Queries

Use these when tuning keyword/semantic balance.

Compact Smoke Test

Run this set first when changing keyword/semantic weights, keyword fields, generated fields, or embeddings.

Comparison Examples

These examples open the search page with multiple variants already configured so one search question can be compared across embedding strategies.

Controlled Description Length Study

Compares one Gemini visual reading compressed into Short, Medium, and Long descriptions, using the study's frozen equal-breadth thresholds.

looking into a mirror
  • A: Short, normally 15–35 words · 0.655
  • B: Medium, normally 50–150 words · 0.650
  • C: Long, normally 150–300 words · 0.650

Description Length And Incidental Detail

Explores whether a longer information budget retrieves visible details that Short omits. A common threshold is useful for inspecting score-scale changes, but it does not equalize result breadth.

cat
  • A: Short should favor primary subjects and forms
  • B: Medium retains more supporting visual evidence
  • C: Long can retain small, background, or incidental details

Gemini Embedding 001 → Gemini Embedding 2

Uses the same English Medium visual descriptions and identical 50/50 hybrid settings with a Chinese query meaning “people looking in a mirror.” Only the embedding model changes, making this a useful probe of multilingual retrieval. Compare rankings, coverage, and overlap rather than raw scores because the models use incompatible vector spaces.

照镜子的人
  • A: Gemini Embedding 001 · Medium description · 50% keyword / 50% semantic · sim ≥ 0
  • B: Gemini Embedding 2 · Medium description · 50% keyword / 50% semantic · sim ≥ 0

Comparison Of Image And Description Embeddings

Compares two direct-image embeddings with two text embeddings of the same Medium descriptions. For this relationship-sensitive query, Gemini Embedding 001 more consistently ranks narrative depictions involving a severed head, while Gemini Embedding 2 over Medium descriptions tends to retrieve isolated sculptural heads. This is a diagnostic comparison of how evidence and model choice affect retrieval, not a general benchmark.

decapitated head
  • A: OpenAI CLIP ViT-L/14 · direct image · 768 dimensions
  • B: Gemini Embedding 2 · direct image · 768 dimensions
  • C: Gemini Embedding 2 · Medium description · 768 dimensions
  • D: Gemini Embedding 001 · Medium description · 768 dimensions

CLIP → Gemini Embedding 2

Compares the historical OpenAI CLIP ViT-L/14 baseline with the newer Gemini Embedding 2 using the same primary images and 768-dimensional semantic search. Compare rankings and overlap rather than raw scores, because each model has a different similarity distribution.

people dancing in a circle
  • A: OpenAI CLIP ViT-L/14 · historical baseline · sim ≥ 0
  • B: Gemini Embedding 2 · newer multimodal model · sim ≥ 0

Image Embedding Dimensions

Compares text-to-image semantic results from the same Gemini Embedding 2 model and image input at two vector dimensions.

looking into a mirror
  • A: Image Only with 768 dimensions
  • B: Image Only with 3072 dimensions

About This Guide

The Met Search Lab is built using AI coding agents. Their contributions include application code, tests, evaluation tooling, technical documentation, and this technical guide. Human collaborators set the goals, provide institutional and production context, review changes, validate behavior, and decide what is published.

The guide draws on The Met's production code to explain architectural decisions and implementation details that others can reproduce and adapt without access to the production application source. AI coding agents may continue to help update the lab and guide as the project and The Met's practices evolve.

Treat this as a working technical reference, not a universal recipe. Models, prompts, thresholds, infrastructure, latency observations, and governance practices must be evaluated against each institution's collection, policies, editorial capacity, and users.

Download Technical Guide For Agents (.md)