Vector Search: Storing and Querying Embeddings for RAG

    Who this is for:

    Architecture / Concept Overview: Vector Search: Storing and Querying Embeddings for RAG

    Vector Search syncs embeddings from Delta tables into an optimised index served by a dedicated endpoint.

    %%{init: {"theme":"base","themeVariables":{"background":"#0B0E14","primaryTextColor":"#E0E6ED","lineColor":"#5D6470","darkMode":true,"primaryColor":"#2E4A4A","secondaryColor":"#374151","secondaryTextColor":"#E0E6ED","tertiaryColor":"#111827","tertiaryTextColor":"#E0E6ED","edgeLabelBackground":"#1f2937"}}}%% flowchart LR classDef source fill:#3F4B59,stroke:#9CA3AF,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef ingestion fill:#5A4B36,stroke:#C9A86B,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef processing fill:#535072,stroke:#8E82B4,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef storage fill:#2E4A4A,stroke:#5FAFA8,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef serving fill:#3D5550,stroke:#6BB7AA,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef governance fill:#5A3F52,stroke:#C28BB0,stroke-width:2px,rx:8,ry:8,color:#E0E6ED DELTA[Delta Table] -->|Sync| PIPELINE[Embedding Pipeline] PIPELINE -->|Embed| EMB_MODEL[Embedding Model Endpoint] EMB_MODEL -->|Store| INDEX[Vector Search Index] QUERY[Query Text] -->|Embed| EMB_MODEL QUERY -->|Search| INDEX INDEX -->|Top-K Results| APP[Application / RAG Chain] DELTA:::source PIPELINE:::ingestion EMB_MODEL:::processing INDEX:::storage QUERY:::source APP:::serving

    *Vector Search syncs from Delta, computes embeddings automatically, and serves similarity queries.*

    %%{init: {"theme":"base","themeVariables":{"background":"#0B0E14","primaryTextColor":"#E0E6ED","lineColor":"#5D6470","darkMode":true,"primaryColor":"#2E4A4A","secondaryColor":"#374151","secondaryTextColor":"#E0E6ED","tertiaryColor":"#111827","tertiaryTextColor":"#E0E6ED","edgeLabelBackground":"#1f2937"}}}%% graph TD classDef source fill:#3F4B59,stroke:#9CA3AF,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef ingestion fill:#5A4B36,stroke:#C9A86B,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef processing fill:#535072,stroke:#8E82B4,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef storage fill:#2E4A4A,stroke:#5FAFA8,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef serving fill:#3D5550,stroke:#6BB7AA,stroke-width:2px,rx:8,ry:8,color:#E0E6ED classDef governance fill:#5A3F52,stroke:#C28BB0,stroke-width:2px,rx:8,ry:8,color:#E0E6ED INDEX_TYPES[Index Types] --> DELTA_SYNC[Delta Sync Index] INDEX_TYPES --> DIRECT[Direct Access Index] DELTA_SYNC --> TRIGGERED[Triggered Pipeline] DELTA_SYNC --> CONTINUOUS[Continuous Pipeline] DELTA_SYNC --> AUTO_EMB[Auto-Computed Embeddings] DIRECT --> MANUAL[Manual Upsert] DIRECT --> PRE_EMB[Pre-Computed Embeddings] INDEX_TYPES:::governance DELTA_SYNC:::processing DIRECT:::storage TRIGGERED:::ingestion CONTINUOUS:::ingestion AUTO_EMB:::source MANUAL:::serving PRE_EMB:::source

    *Vector Search index types: Delta Sync (automatic) and Direct Access (manual).*

    Key Terms

    Prerequisites and Setup

    • Unity Catalog enabled.
    • A Vector Search endpoint created in the workspace.
    • For auto-embedding: a Foundation Model embedding endpoint (e.g., databricks-bge-large-en).
    • SELECT on the source table and CREATE on the target schema.

    Step-by-Step Implementation

      Configuration Reference

      Vector Search: Storing and Querying Embeddings for RAG configuration options
      ParameterDefaultDescription
      endpoint_typeSTANDARDVector Search endpoint type
      index_typeDELTA_SYNCIndex type: DELTA_SYNC or DIRECT_ACCESS
      pipeline_typeTRIGGEREDSync mode: TRIGGERED or CONTINUOUS
      embedding_dimensionmodel-dependentDimension of embedding vectors
      num_results10Number of nearest neighbours to return
      filtersNoneMetadata filters as SQL-like predicates
      score_thresholdNoneMinimum similarity score to include

      Monitoring, Cost, and Security Considerations

      Common Pitfalls and Recommended Patterns

        Frequently Asked Questions