Workflows를 통해 배포되는 Spanner To Vertex AI Vector Search 워크플로를 사용하여 임베딩을 내보내고 벡터 검색 색인으로 업로드합니다. Cloud Scheduler를 사용하여 이 워크플로를 주기적으로 예약해 벡터 검색 색인을 Spanner의 임베딩에 대한 최신 변경사항이 포함된 최신 상태로 유지할 수 있습니다.
벡터 검색 색인을 사용하여 벡터 유사성 검색을 수행합니다.
벡터 검색 색인을 쿼리하여 의미상 유사한 항목의 결과를 검색하고 찾습니다. 공개 엔드포인트를 사용하거나 VPC 피어링을 통해 쿼리할 수 있습니다.
사용 사례
벡터 검색 사용 사례 예시는 수십만 개 항목의 인벤토리가 있는 온라인 소매업체입니다. 이 시나리오에서는 온라인 소매업체 개발자는 Spanner에서 제품 카탈로그에 대한 벡터 유사성 검색을 사용하여 고객이 검색어 기반으로 관련 제품을 찾는 데 도움을 주려고 합니다.
일반 워크플로에 제공된 1단계와 2단계를 수행하여 제품 카탈로그의 벡터 임베딩을 생성하고 이러한 임베딩을 벡터 검색에 동기화합니다.
이제 고객이 애플리케이션에서 탐색하는 동안 '물에서 착용할 수 있는 가장 빨리 마르는 스포츠 반바지'와 같은 검색을 수행한다고 가정해 보겠습니다. 애플리케이션에서 이 쿼리를 수신하면 개발자는 Spanner ML.PREDICT SQL 함수를 사용하여 이 검색 요청에 대한 요청 임베딩을 생성해야 합니다. 제품 카탈로그의 임베딩을 생성하는 데 사용된 모델과 동일한 임베딩 모델을 사용해야 합니다.
다음으로 해당 임베딩이 고객의 검색 요청에서 생성된 요청 임베딩과 유사한 제품 ID에 대한 벡터 검색 색인을 쿼리합니다. 검색 색인에서 웨이크보딩 반바지, 서핑 의류, 수영복과 같이 의미상 비슷한 항목의 제품 ID를 추천할 수 있습니다.
벡터 검색에서 유사한 제품 ID를 반환하면 제품 설명, 인벤토리 수, 가격, 관련 기타 메타데이터에 대해 Spanner를 쿼리하여 고객에게 표시할 수 있습니다.
또한 생성형 AI를 사용하여 Spanner에서 반환된 결과를 처리한 후 고객에게 표시할 수도 있습니다. 예를 들어 Google의 대규모 생성형 AI 모델을 사용하여 추천 제품의 간결한 요약을 생성할 수 있습니다. 자세한 내용은 생성형 AI를 사용하여 전자상거래 애플리케이션에서 맞춤형 추천을 가져오는 방법을 설명하는 튜토리얼을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[],[],null,["# Export embeddings from Spanner to Vertex AI Vector Search\n\n[Vertex AI Vector Search](/vertex-ai/docs/vector-search/overview)\nallows users to search for semantically similar items using vector embeddings.\nUsing the [Spanner To Vertex AI Vector Search\nWorkflow](https://github.com/cloudspannerecosystem/spanner-ai/tree/main/vertex-vector-search/workflows#readme),\nyou can integrate your Spanner database with\nVector Search to perform a vector similarity search on your\nSpanner data.\n\nThe following diagram shows the end-to-end application workflow of how\nyou can enable and use Vector Search on your Spanner\ndata:\n\nThe general workflow is as follows:\n\n1. **Generate and store vector embeddings.**\n\n You can generate vector embeddings of your data, then store and\n manage them in Spanner with your operational data. You can\n generate embeddings with Spanner's `ML.PREDICT` SQL\n function to [access the Vertex AI text embedding model](/spanner/docs/ml-tutorial-embeddings#generate-store-embeddings)\n or [use other embedding models deployed to Vertex AI](/spanner/docs/ml-tutorial).\n2. **Sync embeddings to Vector Search.**\n\n Use the [Spanner To Vertex AI Vector Search Workflow](https://github.com/cloudspannerecosystem/spanner-ai/tree/main/vertex-vector-search/workflows#readme),\n which is deployed using [Workflows](/workflows/docs/overview) to\n export and upload embeddings into a Vector Search index. You can use\n Cloud Scheduler to periodically schedule this workflow to keep your\n Vector Search index up to date with the latest changes to your\n embeddings in Spanner.\n3. **Perform vector similarity search using your Vector Search index.**\n\n Query the Vector Search index to search and find results for\n semantically similar items. You can query using a [public endpoint](/vertex-ai/docs/vector-search/query-index-public-endpoint)\n or through [VPC peering](/vertex-ai/docs/vector-search/query-index-vpc).\n\nExample use case\n----------------\n\nAn illustrative use case for Vector Search is an online\nretailer who has an inventory of hundreds of thousands of items. In this\nscenario, you are a developer for an online retailer, and you would\nlike to use vector similarity search on your product catalog in\nSpanner to help your customers find relevant products based on\ntheir search queries.\n\nFollow step 1 and step 2 presented in the general workflow to generate vector\nembeddings for your product catalog, and sync these embeddings to\nVector Search.\n\nNow imagine a customer browsing your application performs a search such as\n\"best, quick-drying sports shorts that I can wear in the water\". When your\napplication receives this query, you need to generate a request embedding for\nthis search request using the Spanner [`ML.PREDICT`](/spanner/docs/reference/standard-sql/ml-functions#mlpredict)\nSQL function. Make sure to use the same embedding model used to generate the\nembeddings for your product catalog.\n\nNext, query the Vector Search index for product IDs whose\ncorresponding embeddings are similar to the request embedding generated from\nyour customer's search request. The search index might recommend product IDs for\nsemantically similar items such as wakeboarding shorts, surfing apparel, and\nswimming trunks.\n\nAfter Vector Search returns these similar product IDs, you can query\nSpanner for the products' descriptions, inventory count, price,\nand other metadata that are relevant, and display them to your customer.\n\nYou can also use [generative AI](/vertex-ai/generative-ai/docs/overview)\nto process the returned results from Spanner before displaying\nthem to your customer. For example, you might use Google's large generative AI\nmodels to generate a concise summary of the recommended products. For more\ninformation, see this tutorial on how to\n[use Generative AI to get personalized recommendations in an ecommerce application](/spanner/docs/ml-tutorial-generative-ai).\n\nWhat's next\n-----------\n\n- Learn how to [generate embeddings](/spanner/docs/ml-tutorial-embeddings) using Spanner.\n- Learn more about [AI's multitool: Vector embeddings](https://cloud.google.com/blog/topics/developers-practitioners/meet-ais-multitool-vector-embeddings)\n- Learn more about machine learning and embeddings in our [crash course on embeddings](https://developers.google.com/machine-learning/crash-course/embeddings/video-lecture).\n- Learn more about the Spanner To Vertex AI Vector Search Workflow, see the [GitHub repository](https://github.com/cloudspannerecosystem/spanner-ai/tree/main/vertex-vector-search/workflows).\n- Learn more about the [open source spanner-analytics package](https://github.com/cloudspannerecosystem/spanner-analytics/) that facilitates common data-analytic operations in Python and includes integrations with Jupyter Notebooks."]]