What you will be able to do
- Explain how Vector Search measures similarity and why cosine similarity requires normalised embeddings
- Describe how the Vector Search endpoint, the index and the embedding model endpoint relate to each other
- Choose between a Delta Sync index and a Direct Vector Access index, and between managed and self-managed embeddings
- Pick ANN, full-text or hybrid queries, and know when to add filters or the reranker
Key concept
Vector Search index — A Unity Catalog object built from a source table that holds embeddings plus metadata and answers nearest-neighbour queries. An endpoint serves it. If Databricks computes the embeddings, an embedding model endpoint also feeds it.
1.What Vector Search does and how it measures similarity
Mosaic AI Vector Search is the retrieval engine built into Databricks. A RAG application uses it to find the passages that best answer a question. Databricks has since renamed the product Databricks AI Search, so the SDK is databricks-ai-search and the client class is AISearchClient. The concepts and the REST paths (/api/2.0/vector-search/...) are the same.
The search runs over embeddings. An embedding is a vector of numbers that represents what a piece of text or an image means. Two passages that mean similar things get vectors that lie close together, even if they share no words. A query is embedded the same way, and the search returns the stored vectors nearest to it, together with the documents they came from.
Similarity has a fixed definition: L2 (Euclidean) distance between the query vector and each indexed vector. There is no setting to pick another metric. Comparing a query against every vector would be too slow at scale, so Vector Search runs an approximate nearest neighbor (ANN) search over a Hierarchical Navigable Small World (HNSW) graph. The trade is a tiny chance of missing the exact nearest vector in return for fast queries over millions of rows.
Cosine similarity is the one case that needs work from you. If your embedding model expects it, normalise every vector before it reaches the index. For normalised vectors, ranking by L2 distance gives the same order as ranking by cosine, so the results match what the model intended.
Checkpoint 1 of 9· Check yourself
A teammate is reviewing your RAG retrieval setup. Which statement correctly describes how Mosaic AI Vector Search finds and ranks the passages it returns?
Vector Search uses an approximate nearest neighbor (ANN) search over an HNSW graph, so it gives up a tiny chance of exactness in return for speed. It always measures similarity with L2 distance, and there is no setting to pick another metric.
“AI Search uses the Hierarchical Navigable Small World (HNSW) algorithm for its approximate nearest neighbor (ANN) searches and the L2 distance metric”Source: docs.databricks.com
Sources1
2.Endpoint, index and embedding model endpoint
A working Vector Search setup has two required parts and one conditional part. The endpoint is the compute that serves indexes. It scales up on its own as an index grows or concurrent requests increase, and it scales down when an index is deleted. The index holds the embedded data and metadata. It is built from a Delta Lake table, a streaming table or a managed Iceberg v3+ table, and it is a Unity Catalog object with a three-level name like catalog.schema.index. One endpoint can serve several indexes.
The third part, an embedding model endpoint, is needed only when Databricks computes the embeddings for you. It can be a pre-configured Foundation Model APIs endpoint or your own model serving endpoint. The index calls it twice in a document's life: once to embed source rows during sync, and again to embed each query text. Which model to choose belongs to Choosing the embedding model for a RAG app. Inside Vector Search it is simply a dependency the index needs to reach. Two settings matter in practice. If the embedding endpoint scales to zero, the first query after an idle period can time out while it warms up. A CPU endpoint can make index initialisation time out on a large dataset, so use CPU only for small datasets and tests.
Each part has its own access controls. Endpoint create and manage permissions use access control lists. Creating an index needs CREATE TABLE on the target schema. A user who does not own the index needs USE CATALOG, USE SCHEMA and SELECT to query it.
You choose the endpoint type when you create the endpoint, and that choice limits what its indexes can do. The table lists the differences that change how an index behaves. Sizing an endpoint for a given workload is covered elsewhere.
| Property | Standard (STANDARD) | Storage-optimized (STORAGE_OPTIMIZED) |
|---|---|---|
| Capacity at dimension 768 | 320 million vectors | Over one billion vectors |
| Sync modes for Delta Sync indexes | Continuous or Triggered | Triggered only |
| Source table requirement | Change data feed required | No change data feed requirement |
| Indexing and query speed | High QPS option available | 10-20x faster indexing; about 250 ms extra query latency |
| Filter syntax | Dictionary, e.g. {"status": "active"} | SQL-like string, e.g. "status = 'active'" |
| Dedicated full-text index (no embeddings) | Not supported | Supported (Beta) |
Checkpoint 2 of 9· Check yourself
Your support-ticket index must reflect new tickets within seconds, and the source Delta table holds about 50 million vectors at dimension 768. Which setup can deliver this?
Only a standard endpoint supports continuous sync, and an index on a standard endpoint needs change data feed on its source table. Storage-optimized endpoints support only triggered sync, and high QPS is a standard-only throughput option, not a sync setting.
“For storage-optimized endpoints, only Triggered sync mode is supported.”Source: docs.databricks.com
Checkpoint 3 of 9· Match them up
Match each part of a Vector Search setup to its role
Tap a term, then the definition that fits it.
The endpoint and the index are always required. The embedding model endpoint is needed only for Databricks-computed embeddings, and change data feed is a source-table requirement on standard endpoints.
“if you choose to have Databricks compute the embeddings, you can use a pre-configured Foundation Model APIs endpoint”Source: docs.databricks.com
3.Delta Sync and Direct Vector Access indexes
There are two index types, and the difference is who keeps the index up to date. A Delta Sync index follows a source table. When rows in the table change, the index updates incrementally to match, and you never write to the index yourself. A Direct Vector Access index has no source table to follow. Your code writes vectors and metadata into it through the REST API or the Python SDK (upsert, delete-data), and whenever the data changes you have to push the change. You also cannot create a Direct Vector Access index from the UI; only the SDK or REST API can create one.
If your chunks already land in a Delta table, as they do in most Databricks RAG pipelines, Delta Sync is the right choice. Picking Direct Access in that case means writing and maintaining sync code that Delta Sync gives you for free. Direct Access suits vectors that come from outside any table, written by an application that wants full control over each write.
Sync mode applies only to Delta Sync indexes. Direct Access has no sync because you are the sync. The SDK sets it with pipeline_type, and there are two modes:
- Continuous keeps the index within seconds of the source table. A compute cluster stays provisioned to run the streaming pipeline, which costs more. Only standard endpoints support it.
- Triggered updates the index only when you start a sync with
index.sync(), the REST API or the Sync now button. Nothing runs between syncs. - On a standard endpoint, both modes process only the rows that changed. On a storage-optimized endpoint, which supports Triggered only, every sync partially rebuilds the index, but managed embeddings for unchanged rows are reused rather than recomputed.
How to weigh freshness against cost for a given workload is covered in Triggered vs continuous sync. The combinations themselves are fixed. A catalogue that must show a price change within seconds needs a standard endpoint, continuous sync, and change data feed on the source table. A knowledge base reloaded by a nightly batch fits triggered sync: call sync() when the ETL job finishes and pay nothing in between. Storage-optimized endpoints support exactly that pattern.
Both index types fix their schema at creation. Adding or changing a column in the source table means building a new index, moving traffic to it, and then deleting the old one.
Checkpoint 4 of 9· Put it in order
Product wants a new region column added to the source table behind a live Delta Sync index, with no search downtime. Put the steps in the order that makes this work.
- 1.Add the new column to the source table
- 2.Create a new index from the updated table schema
- 3.Delete the original index
- 4.Once the new index is ready, switch query traffic to it
An index's schema is fixed when it is created, so changing the source table's columns means building a new index. To avoid downtime, the old index keeps serving queries until the new one is ready and traffic has moved to it. Only then is the old index deleted.
“After the new index is ready, switch traffic to the new index.”Source: docs.databricks.com
Checkpoint 5 of 9· Exam question
A data engineering team is building a RAG index over an internal knowledge base that is refreshed only twice a day by a batch ETL job. Cost efficiency matters more than index freshness, and the team does not need a continuously running sync process. Which AI Search endpoint and sync configuration best fits these requirements?
Correct answer: C — Create the index on a storage-optimized endpoint with triggered sync, invoking a sync operation after each ETL batch completes
- A. Continuous sync runs a pipeline that stays active around the clock to pick up changes. The source table changes only twice a day and the team wants no continuously running sync, so this adds ongoing compute cost for freshness that is not needed.
- B. A Delta Sync index reads row-level changes from the source table's Change Data Feed. With it turned off, a sync cannot detect what changed, so the index would not update correctly after an ETL batch. Triggered sync alone does not make this setup work.
- C. A storage-optimized endpoint only supports triggered sync, which matches a workload that updates a couple of times a day, and triggering the sync right after the ETL batch keeps the index current without paying for always-on compute. This combination minimizes cost while still refreshing the index on the required cadence.
- D. A Direct Vector Access index is not synced from the source table. The team would have to compute embeddings and upsert vectors in custom ETL code, and it would lose the managed sync from the Delta table. That adds engineering and maintenance work and brings no cost advantage for a twice-daily refresh.
Checkpoint 6 of 9· Exam question
An e-commerce team's product catalog table changes dozens of times per minute, and their RAG-based shopping assistant must reflect price and availability updates within seconds of a Delta table write. Which configuration should they choose?
Correct answer: A — Use a standard endpoint and a Delta Sync index in continuous mode, with Change Data Feed enabled on the source product catalog table
- A. A Delta Sync index in continuous mode on a standard endpoint streams changes from the source table into the index as they are written, typically within seconds. That meets the freshness target for a table changing dozens of times per minute. Change Data Feed on the source table is what lets the index pick up those row-level changes.
- B. Triggered mode only updates the index when a sync is started, and each sync is a batch run that takes time to finish. With dozens of catalog changes per minute, manual syncs trail the writes or overlap, so prices and availability would not appear within seconds. Choosing a storage-optimized endpoint does not change how a triggered sync behaves.
- C. Even with Change Data Feed enabled, triggered mode only refreshes the index when a sync runs. Syncing at five-minute intervals leaves the assistant serving prices and stock levels that can be minutes old, well outside the seconds-level freshness required for a fast-moving catalog.
- D. A Direct Vector Access index is not synced from the Delta table, so the team would have to re-embed and reload the data themselves. Rebuilding it after each batch of changes takes far longer than a few seconds, and changes arrive faster than rebuilds can finish. It cannot give the freshness required here.
Sources2
4.Managed and self-managed embeddings
A Delta Sync index can get its vectors in one of two ways, and you choose when you create it. With managed embeddings ("Compute embeddings" in the UI), you point the index at a text column with embedding_source_column and at a model with embedding_model_endpoint_name. Databricks embeds each new or changed row during sync and embeds query text at query time. With self-managed embeddings ("Use existing embeddings"), the source table already has a vector column of type array[float]. You name it with embedding_vector_column and give embedding_dimension, and Databricks indexes those vectors without recomputing them.
index = client.create_delta_sync_index(
endpoint_name="vector_search_demo_endpoint",
source_table_name="vector_search_demo.vector_search.en_wiki",
index_name="vector_search_demo.vector_search.en_wiki_index",
pipeline_type="TRIGGERED",
primary_key="id",
embedding_dimension=1024,
embedding_vector_column="text_vector"
)Self-managed is the right choice when your vectors come from a model Databricks does not serve, such as a proprietary fine-tuned embedder. You keep that model and still get automatic syncing. The cost is at query time: because the index has no model attached, each query must arrive as a query_vector that you embedded yourself with the same model. A managed index takes plain query_text.
Managed embeddings come with two extras. Save computed embeddings writes the generated vectors to a Unity Catalog table named after the index with _writeback_table appended. You can query that table but should not modify it, and it is deleted along with the index. model_endpoint_name_for_query lets queries use a separate endpoint serving the same model, so a high-throughput endpoint can handle ingestion while a low-latency one handles queries.
The embedding source cannot be changed after creation. A self-managed index cannot be converted to a managed one. Switching means creating a new index and recomputing every embedding. A third option skips embeddings entirely: a dedicated full-text index (Beta) is a Delta Sync index with no embedding columns, supports keyword search only, and requires a storage-optimized endpoint with triggered sync.
Checkpoint 7 of 9· Fill the gap
Your source Delta table already stores 1024-dimension vectors in a text_vector column, produced by a fine-tuned embedder that Databricks does not serve. You want the index to keep following the table. Which parameter completes this index definition?
index = client.create_delta_sync_index(
endpoint_name="vector_search_demo_endpoint",
source_table_name="vector_search_demo.vector_search.en_wiki",
index_name="vector_search_demo.vector_search.en_wiki_index",
pipeline_type="TRIGGERED",
primary_key="id",
embedding_dimension=1024,
? ="text_vector"
)For self-managed embeddings, a Delta Sync index uses embedding_vector_column (with embedding_dimension) to name the precomputed array[float] column, and it still syncs with the source table. embedding_source_column and embedding_model_endpoint_name are for managed embeddings, where Databricks computes the vectors from a text column. query_vector is a query argument, not an index setting.
Source: docs.databricks.comCheckpoint 8 of 9· Exam question
A GenAI engineering team has already computed embeddings for their documents using a proprietary fine-tuned embedding model and stores the resulting vectors as a column in a Delta table alongside the document text. They want the index to automatically pick up new rows as the Delta table changes, without Databricks recomputing embeddings. Which index configuration should they use?
Correct answer: B — Create a Delta Sync index with self-managed embeddings, using the table's existing vector column as the embedding source and setting its dimension
- A. With managed embeddings, Databricks calls the chosen endpoint to embed the text column on each sync, even when that endpoint hosts the fine-tuned model. That recomputes embeddings, and the team wants Databricks to reuse the vectors already stored in the table.
- B. A Delta Sync index with self-managed embeddings reads vectors from an existing column in the source table, so the team's own vectors are used as they are. The index still syncs automatically as the Delta table changes. The embedding dimension must match the vectors in that column.
- C. A Direct Vector Access index is not tied to a Delta table. The team would have to push every insert and update themselves with a scheduled job, and that job, not the index, would detect changes. The team wants the index itself to follow the Delta table.
- D. Change Data Feed only records row-level changes in the Delta table and does not build a searchable index. Similarity queries over the raw column are not backed by an index, so there is nothing to keep in step with the table. The team asked for an index configuration.
5.ANN, full-text and hybrid queries, with filters and reranking
You query an index through the Python SDK (similarity_search), the REST API or the SQL vector_search() function. The query_type parameter chooses the retrieval algorithm, and ANN is the default.
| query_type | How it retrieves | Wins when | Struggles when |
|---|---|---|---|
| ann (default) | Nearest embeddings by L2 distance | Queries are conceptual or use different words from the documents | Queries rely on exact codes, proper nouns or jargon |
| FULL_TEXT (Beta) | Keyword matching scored with Okapi BM25; up to 10,000 results | Queries contain identifiers, product names or error codes | Queries paraphrase or use synonyms |
| hybrid | ANN and full-text in parallel, merged with Reciprocal Rank Fusion; up to 200 results | The workload mixes conceptual and keyword-heavy queries | Rarely; the recommended starting point |
Pure vector search breaks down on identifiers. To an embedding model, SKU-48213 and SKU-48231 look almost the same, but to a shopper they are different products. Full-text search scans every text column, tokenises at word boundaries, lowercases, strips punctuation, and finds exact hits. Hybrid search runs both searches. RRF then rescores each document by its rank in each result list and merges the two, so a document ranked high by either method rises to the top. Use hybrid whenever the source data contains SKUs, ticket numbers or similar keys that a question might quote word for word.
Filters narrow any query to rows matching conditions on indexed columns, such as language, product line or date. Only columns that were synced into the index can be filtered on. Standard endpoints take a dictionary such as {"status": "active"}. Storage-optimized endpoints take a SQL-like string such as "language = 'en' AND country = 'us'". If you leave out the query text, vector and query type and pass only filters, you get a filter-only query: matching rows with no retrieval scoring, which also works as a primary-key lookup.
The reranker is a second, optional pass that runs after any query type. Its theory is covered in Re-ranking in the retrieval pipeline. In Vector Search it is just a query argument. A cross-encoder rescores the retrieved results against the query, typically improving quality by about 10% at the cost of extra latency. That trade suits a RAG chatbot more than a high-throughput search box. columns_to_rerank sets which columns the reranker reads, in order, and it only reads the first 2,000 characters it finds. num_results sets how many results come back and does not change how many the reranker scores.
results = index.similarity_search(
query_text = "How to create an AI Search index",
columns = ["id", "text", "parent_doc_summary", "date"],
num_results = 10,
query_type = "hybrid",
reranker=DatabricksReranker(columns_to_rerank=["text", "parent_doc_summary", "other_column"])
)No. Results still come back, but they are in the original retrieval order without reranking. The warning in debug_info is the only sign, so a production agent should check for it instead of assuming every result was reranked.
Checkpoint 9 of 9· Match them up
You are tuning retrieval for a support assistant. Pair each Vector Search query option with the job it does best.
Tap a term, then the definition that fits it.
ANN matches on meaning, full-text matches exact terms, and hybrid runs both and merges them with RRF, which makes it the recommended starting point. The reranker is a second pass that can follow any query type. A query with only filters returns matching rows without any retrieval scoring.
“Full-text | Keyword search that matches on exact terms. | Queries with specific terms, proper nouns, product IDs, or technical jargon.”Source: docs.databricks.com
Sources
(3)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Databricks AI Search (formerly Databricks Vector Search)”
↩︎ What Vector Search does and how it measures similarity“Embeddings are mathematical representations of the semantic content of data, typically text or image data.”
↩︎ What Vector Search does and how it measures similarity“Hierarchical Navigable Small World (HNSW) algorithm for its approximate nearest neighbor (ANN) searches”
↩︎ What Vector Search does and how it measures similarity“If you want to use cosine similarity you need to normalize your datapoint embeddings before feeding them into the vector search algorithm.”
↩︎ What Vector Search does and how it measures similarity“Endpoints scale up automatically to support the size of the index or the number of concurrent requests.”
↩︎ Endpoint, index and embedding model endpoint“AI Search indexes appear in and are governed by Unity Catalog.”
↩︎ Endpoint, index and embedding model endpoint“you can use a pre-configured Foundation Model APIs endpoint or create a model serving endpoint to serve the embedding model of your choice”
↩︎ Endpoint, index and embedding model endpoint“For standard endpoints, the source table must use a change data feed.”
↩︎ Endpoint, index and embedding model endpoint“Queries on storage-optimized endpoints have a slightly increased latency of about 250msec.”
↩︎ Endpoint, index and embedding model endpoint“Databricks calculates the embeddings, using a model that you specify, and optionally saves the embeddings to a table in Unity Catalog.”
↩︎ Managed and self-managed embeddings“It is not possible to convert a self-managed embedding index to a Databricks-managed index.”
↩︎ Managed and self-managed embeddings“The similarity search and keyword search results are combined using the Reciprocal Rank Fusion (RRF) function.”
↩︎ ANN, full-text and hybrid queries, with filters and reranking“where source data has unique keywords such as SKUs or identifiers that are not well suited to pure similarity search”
↩︎ ANN, full-text and hybrid queries, with filters and reranking“With an AI Search index, you can use real-time approximate nearest neighbor (ANN) searches on a source table or view.”
↩︎ Key concept“the L2 distance metric to measure embedding vector similarity”
↩︎ Exam trap 1“With this option, you must manually update the index using the REST API when the embeddings table changes.”
↩︎ Exam trap 3“It is not possible to convert a self-managed embedding index to a Databricks-managed index.”
↩︎ Exam trap 4“AI Search uses the Hierarchical Navigable Small World (HNSW) algorithm for its approximate nearest neighbor (ANN) searches and the L2 distance metric”
↩︎ Checkpoint“if you choose to have Databricks compute the embeddings, you can use a pre-configured Foundation Model APIs endpoint”
↩︎ Checkpoint - 2.
“Databricks recommends that you remove the default selection of Scale to zero.”
↩︎ Endpoint, index and embedding model endpoint“You should only use CPU endpoints for small datasets and tests.”
↩︎ Endpoint, index and embedding model endpoint“Delta Sync Index automatically syncs with a source table, incrementally updating the index as the underlying data in the source table changes.”
↩︎ Delta Sync and Direct Vector Access indexes“The user is responsible for updating this table using the REST API or the Python SDK.”
↩︎ Delta Sync and Direct Vector Access indexes“This type of index cannot be created using the UI.”
↩︎ Delta Sync and Direct Vector Access indexes“Continuous keeps the index in sync with seconds of latency.”
↩︎ Delta Sync and Direct Vector Access indexes“a compute cluster is provisioned to run the continuous sync streaming pipeline”
↩︎ Delta Sync and Direct Vector Access indexes“For storage-optimized endpoints, only Triggered sync mode is supported.”
↩︎ Delta Sync and Direct Vector Access indexes“The index schema is fixed at creation time, so any schema changes require creating a new index to take effect.”
↩︎ Delta Sync and Direct Vector Access indexes“The format of the precomputed embedding column should be array[float].”
↩︎ Managed and self-managed embeddings“The name of the table is the name of the AI Search index, appended by _writeback_table.”
↩︎ Managed and self-managed embeddings“Must use Triggered sync mode. Continuous sync is not supported.”
↩︎ Managed and self-managed embeddings“Only indexed columns can be returned in search results or used as filters.”
↩︎ ANN, full-text and hybrid queries, with filters and reranking“For storage-optimized endpoints, only Triggered sync mode is supported.”
↩︎ Exam trap 2“For storage-optimized endpoints, only Triggered sync mode is supported.”
↩︎ Checkpoint“After the new index is ready, switch traffic to the new index.”
↩︎ Checkpoint - 3.
“USE SCHEMA on the schema that contains the AI Search index.”
↩︎ Endpoint, index and embedding model endpoint“The default query type is ann (approximate nearest neighbor).”
↩︎ ANN, full-text and hybrid queries, with filters and reranking“You can only query the AI Search index using the Python SDK, the REST API, or the SQL vector_search() AI function.”
↩︎ ANN, full-text and hybrid queries, with filters and reranking“By default, hybrid search includes all text metadata columns and returns a maximum of 200 results.”
↩︎ ANN, full-text and hybrid queries, with filters and reranking“A filter-only query returns rows that match a filter without performing vector or keyword retrieval.”
↩︎ ANN, full-text and hybrid queries, with filters and reranking“The reranker typically improves quality by approximately 10% but adds latency.”
↩︎ ANN, full-text and hybrid queries, with filters and reranking“num_results is the final number of results to return. This does not affect the number of results used for reranking.”
↩︎ ANN, full-text and hybrid queries, with filters and reranking“Full-text | Keyword search that matches on exact terms. | Queries with specific terms, proper nouns, product IDs, or technical jargon.”
↩︎ Checkpoint