用途:该技能用于在 Databricks 上构建 RAG(检索增强生成)与语义搜索应用,包括从 Delta 表创建向量索引、选择端点类型、带过滤条件查询索引。使用前需先参考父级 databricks-core 技能了解 CLI 基础、认证与 profile 选择。
主要能力:提供托管向量相似度搜索,支持自动生成嵌入并与 Delta Lake 集成。组件包括端点(承载索引的计算资源)、索引、Delta Sync(自动同步源表)和 Direct Access(手动 CRUD)。端点分 Standard(20-50ms,约 3.2 亿向量)与 Storage-Optimized(300-500ms,10 亿+ 向量,成本更低)。索引类型有 Delta Sync 托管嵌入、Delta Sync 自管理嵌入、Direct Access。支持 ANN 语义搜索与混合搜索(向量相似度 + BM25 关键词),支持过滤、触发同步、扫描全部条目。内置嵌入模型如 databricks-gte-large-en(1024 维,8192 tokens)与 databricks-bge-large-en(1024 维,512 tokens)。
使用方式:通过 databricks.sdk 的 WorkspaceClient 创建端点与索引,例如 create_endpoint、create_index、query_index、sync_index、scan_index;Direct Access 索引可用 upsert_data_vector_index 与 delete_data_vector_index 手动增删。也可用 CLI:databricks vector-search-endpoints create-endpoint my-endpoint STANDARD、databricks vector-search-indexes list-indexes my-endpoint、get-index、sync-index、delete-index。查询时可用 query_text 或 query_vector,混合搜索设 query_type="HYBRID"。过滤语法因端点而异:Standard 用字典格式 filters_json,Storage-Optimized 用 SQL 风格字符串 filters(经 databricks-vectorsearch 包)。运行时供智能体工具调用应使用 VectorSearchRetrieverTool。
适用场景:RAG 应用、语义搜索与相似度匹配、从 Delta 表建向量索引、大规模成本敏感部署、含精确术语(SKU、错误码、专有名词)的混合检索。
限制:端点创建为异步,需用 get_endpoint() 查状态;TRIGGERED 管道需手动 sync_index();查询与索引嵌入维度须一致;columns_to_sync 决定查询结果可用列;大向量(如 1024 维)以 JSON 序列化时可能被截断,建议用 query_text 或 SDK 传原始向量;容量不足需升级到 Storage-Optimized。参考文件包括 index-types.md、end-to-end-rag.md、search-modes.md、troubleshooting-and-operations.md。