1. 소개
이 Codelab에서는 벡터 검색과 Vertex AI 임베딩을 결합하여 AlloyDB AI를 사용하는 방법을 알아봅니다. 이 실습은 AlloyDB AI 기능을 위한 실습 모음의 일부입니다. 자세한 내용은 문서의 AlloyDB AI 페이지를 참고하세요.

기본 요건
- Google Cloud, 콘솔에 관한 기본적인 이해
- 명령줄 인터페이스 및 Cloud Shell의 기본 기술
학습할 내용
- AlloyDB 클러스터 및 기본 인스턴스를 배포하는 방법
- Google Compute Engine VM에서 AlloyDB에 연결하는 방법
- 데이터베이스를 만들고 AlloyDB AI를 사용 설정하는 방법
- 데이터베이스에 데이터를 로드하는 방법
- AlloyDB Studio 사용 방법
- AlloyDB에서 Gemini Enterprise Agent Platform 임베딩 모델을 사용하는 방법
- Gemini Enterprise Agent Platform Studio 사용 방법
- Gemini Enterprise Agent Platform 생성형 모델을 사용하여 결과를 보강하는 방법
- 벡터 색인을 사용하여 성능을 개선하는 방법
필요한 항목
- Google Cloud 계정 및 Google Cloud 프로젝트
- 웹브라우저(예: Chrome)
2. 설정 및 요구사항
프로젝트 설정
- Google Cloud 콘솔에 로그인합니다. 아직 Gmail이나 Google Workspace 계정이 없는 경우 계정을 만들어야 합니다.
직장 또는 학교 계정 대신 개인 계정을 사용하세요.
- 새 프로젝트를 만들거나 기존 프로젝트를 재사용합니다. Google Cloud 콘솔에서 새 프로젝트를 만들려면 헤더에서 프로젝트 선택 버튼을 클릭하여 팝업 창을 엽니다.

프로젝트 선택 창에서 새 프로젝트 버튼을 누르면 새 프로젝트 대화상자가 열립니다.

대화상자에서 원하는 프로젝트 이름을 입력하고 위치를 선택합니다.

- 프로젝트 이름은 이 프로젝트 참가자의 표시 이름입니다. 프로젝트 이름은 Google API에서 사용되지 않으며 언제든지 변경할 수 있습니다.
- 프로젝트 ID는 모든 Google Cloud 프로젝트에서 고유하며, 변경할 수 없습니다 (설정된 후에는 변경할 수 없음). Google Cloud 콘솔에서 고유 ID를 자동으로 생성하지만 이를 맞춤설정할 수 있습니다. 생성된 ID가 마음에 들지 않으면 다른 임의 ID를 생성하거나 자체 ID를 제공하여 사용 가능 여부를 확인할 수 있습니다. 대부분의 Codelab에서는 프로젝트 ID를 참조해야 합니다. 프로젝트 ID는 일반적으로 PROJECT_ID 자리표시자로 식별됩니다.
- 참고로 세 번째 값은 일부 API에서 사용하는 프로젝트 번호입니다. 이 세 가지 값에 대한 자세한 내용은 문서를 참고하세요.
결제 사용 설정
개인 결제 계정 설정
Google Cloud 크레딧을 사용하여 결제를 설정한 경우 이 단계를 건너뛸 수 있습니다.
개인 결제 계정을 설정하려면 Cloud 콘솔에서 여기에서 결제를 사용 설정하세요.
참고 사항:
- 이 실습을 완료하는 데 드는 Cloud 리소스 비용은 미화 3달러 미만입니다.
- 이 실습이 끝나면 단계에 따라 리소스를 삭제하여 추가 요금이 발생하지 않도록 할 수 있습니다.
- 신규 사용자는 미화$300 상당의 무료 체험판을 이용할 수 있습니다.
Cloud Shell 시작
Google Cloud를 노트북에서 원격으로 실행할 수 있지만, 이 Codelab에서는 Cloud에서 실행되는 명령줄 환경인 Google Cloud Shell을 사용합니다.
Google Cloud Console의 오른쪽 상단 툴바에 있는 Cloud Shell 아이콘을 클릭합니다.

또는 G를 누른 다음 S를 누릅니다. Google Cloud 콘솔에 있거나 이 링크를 사용하는 경우 이 시퀀스를 통해 Cloud Shell이 활성화됩니다.
환경을 프로비저닝하고 연결하는 데 몇 분 정도 소요됩니다. 완료되면 다음과 같이 표시됩니다.

가상 머신에는 필요한 개발 도구가 모두 들어있습니다. 영구적인 5GB 홈 디렉터리를 제공하고 Google Cloud에서 실행되므로 네트워크 성능과 인증이 크게 개선됩니다. 이 Codelab의 모든 작업은 브라우저 내에서 수행할 수 있습니다. 아무것도 설치할 필요가 없습니다.
3. 시작하기 전에
API 사용 설정
출력:
AlloyDB, Compute Engine, 네트워킹 서비스, Gemini Enterprise Agent Platform을 사용하려면 Google Cloud 프로젝트에서 각 API를 사용 설정해야 합니다.
API 사용 설정
터미널의 Cloud Shell 내에 프로젝트 ID가 설정되어 있는지 확인합니다.
gcloud config set project [YOUR-PROJECT-ID]
환경 변수 PROJECT_ID를 설정합니다.
PROJECT_ID=$(gcloud config get-value project)
필요한 모든 API를 사용 설정합니다.
gcloud services enable alloydb.googleapis.com \
compute.googleapis.com \
cloudresourcemanager.googleapis.com \
servicenetworking.googleapis.com \
aiplatform.googleapis.com
예상 출력
student@cloudshell:~ (test-project-001-402417)$ gcloud config set project test-project-001-402417
Updated property [core/project].
student@cloudshell:~ (test-project-001-402417)$ PROJECT_ID=$(gcloud config get-value project)
Your active configuration is: [cloudshell-14650]
student@cloudshell:~ (test-project-001-402417)$
student@cloudshell:~ (test-project-001-402417)$ gcloud services enable alloydb.googleapis.com \
compute.googleapis.com \
cloudresourcemanager.googleapis.com \
servicenetworking.googleapis.com \
aiplatform.googleapis.com
Operation "operations/acat.p2-4470404856-1f44ebd8-894e-4356-bea7-b84165a57442" finished successfully.
사용 설정된 각 API에 대한 자세한 내용은 문서를 참고하세요.
4. AlloyDB 배포
AlloyDB 클러스터를 만들기 전에 향후 AlloyDB 인스턴스에서 사용할 수 있는 비공개 IP 범위를 VPC에 할당합니다. 이 계정이 없으면 계정을 만들어 내부 Google 서비스에서 사용하도록 할당해야 클러스터와 인스턴스를 만들 수 있습니다.
비공개 IP 범위 만들기
VPC에서 AlloyDB용 비공개 서비스 액세스 구성을 설정해야 합니다. 여기서는 프로젝트에 '기본' VPC 네트워크가 있고 이 네트워크가 모든 작업에 사용된다고 가정합니다.
비공개 IP 범위를 만듭니다.
gcloud compute addresses create psa-range \
--global \
--purpose=VPC_PEERING \
--prefix-length=24 \
--description="VPC private service access" \
--network=default
할당된 IP 범위를 사용하여 비공개 연결을 만듭니다.
gcloud services vpc-peerings connect \
--service=servicenetworking.googleapis.com \
--ranges=psa-range \
--network=default
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-402417)$ gcloud compute addresses create psa-range \
--global \
--purpose=VPC_PEERING \
--prefix-length=24 \
--description="VPC private service access" \
--network=default
Created [https://www.googleapis.com/compute/v1/projects/test-project-402417/global/addresses/psa-range].
student@cloudshell:~ (test-project-402417)$ gcloud services vpc-peerings connect \
--service=servicenetworking.googleapis.com \
--ranges=psa-range \
--network=default
Operation "operations/pssn.p24-4470404856-595e209f-19b7-4669-8a71-cbd45de8ba66" finished successfully.
student@cloudshell:~ (test-project-402417)$
AlloyDB 클러스터 만들기
us-central1 리전에 AlloyDB 클러스터 만들기
postgres 사용자의 비밀번호를 정의합니다. 비밀번호를 직접 정의하거나 무작위 함수를 사용하여 생성할 수 있습니다.
export PGPASSWORD=`openssl rand -hex 16`
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-402417)$ export PGPASSWORD=`openssl rand -hex 12`
나중에 사용할 수 있도록 PostgreSQL 비밀번호를 기록해 둡니다.
echo $PGPASSWORD
나중에 postgres 사용자로 인스턴스에 연결하려면 이 비밀번호가 필요합니다. 후속 단계에서 사용할 수 있도록 이 비밀번호를 저장합니다.
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-402417)$ echo $PGPASSWORD bbefbfde7601985b0dee5723 (Note: Yours will be different!)
무료 체험판 클러스터 만들기
AlloyDB를 사용해 본 적이 없는 경우 무료 체험 클러스터를 만들 수 있습니다.
리전 및 클러스터 이름의 환경 변수를 설정합니다.
export REGION=us-central1
export ADBCLUSTER=alloydb-aip-01
명령어를 실행하여 클러스터를 만듭니다.
gcloud alloydb clusters create $ADBCLUSTER \
--password=$PGPASSWORD \
--network=default \
--region=$REGION \
--subscription-type=TRIAL
예상되는 콘솔 출력:
export REGION=us-central1
export ADBCLUSTER=alloydb-aip-01
gcloud alloydb clusters create $ADBCLUSTER \
--password=$PGPASSWORD \
--network=default \
--region=$REGION \
--subscription-type=TRIAL
Operation ID: operation-1697655441138-6080235852277-9e7f04f5-2012fce4
Creating cluster...done.
동일한 Cloud Shell 세션에서 클러스터의 AlloyDB 기본 인스턴스를 만듭니다. 연결이 해제되면 리전 및 클러스터 이름 환경 변수를 다시 정의해야 합니다.
gcloud alloydb instances create $ADBCLUSTER-pr \
--instance-type=PRIMARY \
--cpu-count=8 \
--region=$REGION \
--cluster=$ADBCLUSTER
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-402417)$ gcloud alloydb instances create $ADBCLUSTER-pr \
--instance-type=PRIMARY \
--cpu-count=8 \
--region=$REGION \
--availability-type ZONAL \
--cluster=$ADBCLUSTER
Operation ID: operation-1697659203545-6080315c6e8ee-391805db-25852721
Creating instance...done.
AlloyDB Standard 클러스터 만들기
프로젝트의 첫 번째 AlloyDB 클러스터가 아닌 경우 표준 클러스터 생성을 진행합니다. 무료 체험판 클러스터를 이미 만든 경우 이 단계를 건너뛰세요.
리전 및 클러스터 이름의 환경 변수를 설정합니다.
export REGION=us-central1
export ADBCLUSTER=alloydb-aip-01
명령어를 실행하여 클러스터를 만듭니다.
gcloud alloydb clusters create $ADBCLUSTER \
--password=$PGPASSWORD \
--network=default \
--region=$REGION
예상되는 콘솔 출력:
export REGION=us-central1
export ADBCLUSTER=alloydb-aip-01
gcloud alloydb clusters create $ADBCLUSTER \
--password=$PGPASSWORD \
--network=default \
--region=$REGION
Operation ID: operation-1697655441138-6080235852277-9e7f04f5-2012fce4
Creating cluster...done.
동일한 Cloud Shell 세션에서 클러스터의 AlloyDB 기본 인스턴스를 만듭니다. 연결이 해제되면 리전 및 클러스터 이름 환경 변수를 다시 정의해야 합니다.
gcloud alloydb instances create $ADBCLUSTER-pr \
--instance-type=PRIMARY \
--cpu-count=2 \
--region=$REGION \
--cluster=$ADBCLUSTER
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-402417)$ gcloud alloydb instances create $ADBCLUSTER-pr \
--instance-type=PRIMARY \
--cpu-count=2 \
--region=$REGION \
--availability-type ZONAL \
--cluster=$ADBCLUSTER
Operation ID: operation-1697659203545-6080315c6e8ee-391805db-25852721
Creating instance...done.
5. AlloyDB에 연결
AlloyDB는 비공개 전용 연결을 사용하여 배포되므로 데이터베이스를 사용하려면 PostgreSQL 클라이언트가 설치된 Compute Engine VM이 필요합니다.
GCE VM 배포
AlloyDB 클러스터와 동일한 리전 및 VPC에 GCE VM을 만듭니다.
Cloud Shell에서 다음을 실행합니다.
export ZONE=us-central1-a
gcloud compute instances create instance-1 \
--zone=$ZONE \
--create-disk=auto-delete=yes,boot=yes,image=projects/debian-cloud/global/images/$(gcloud compute images list --filter="family=debian-13 AND family!=debian-13-arm64" --format="value(name)") \
--scopes=https://www.googleapis.com/auth/cloud-platform
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-402417)$ export ZONE=us-central1-a
gcloud compute instances create instance-1 \
--zone=$ZONE \
--create-disk=auto-delete=yes,boot=yes,image=projects/debian-cloud/global/images/$(gcloud compute images list --filter="family=debian-13 AND family!=debian-13-arm64" --format="value(name)") \
--scopes=https://www.googleapis.com/auth/cloud-platform
Created [https://www.googleapis.com/compute/v1/projects/test-project-402417/zones/us-central1-a/instances/instance-1].
NAME: instance-1
ZONE: us-central1-a
MACHINE_TYPE: n1-standard-1
PREEMPTIBLE:
INTERNAL_IP: 10.128.0.2
EXTERNAL_IP: 34.71.192.233
STATUS: RUNNING
Postgres 클라이언트 설치
배포된 VM에 PostgreSQL 클라이언트 소프트웨어 설치
VM에 연결합니다.
gcloud compute ssh instance-1 --zone=us-central1-a
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-402417)$ gcloud compute ssh instance-1 --zone=us-central1-a Updating project ssh metadata...working..Updated [https://www.googleapis.com/compute/v1/projects/test-project-402417]. Updating project ssh metadata...done. Waiting for SSH key to propagate. Warning: Permanently added 'compute.5110295539541121102' (ECDSA) to the list of known hosts. Linux instance-1 6.12.101+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.101-1 (2026-08-05) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. student@instance-1:~$
VM 내에 명령어를 실행할 소프트웨어를 설치합니다.
sudo apt-get update
sudo apt-get install --yes postgresql-client
예상되는 콘솔 출력:
student@instance-1:~$ sudo apt-get update sudo apt-get install --yes postgresql-client Get:1 file:/etc/apt/mirrors/debian.list Mirrorlist [30 B] Get:2 file:/etc/apt/mirrors/debian-security.list Mirrorlist [39 B] Hit:3 https://deb.debian.org/debian trixie InRelease Get:4 https://deb.debian.org/debian trixie-updates InRelease [47.3 kB] Get:5 https://deb.debian.org/debian trixie-backports InRelease [54.0 kB] Get:6 https://deb.debian.org/debian-security trixie-security InRelease [43.4 kB] Hit:10 https://packages.cloud.google.com/apt google-compute-engine-trixie-stable InRelease ...redacted... update-alternatives: using /usr/share/postgresql/17/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode Setting up postgresql-client (17+278) ... Processing triggers for man-db (2.13.1-1) ... Processing triggers for libc-bin (2.41-12+deb13u3) ...
인스턴스에 연결
psql을 사용하여 VM에서 기본 인스턴스에 연결합니다.
instance-1 VM에 대해 SSH 세션이 열린 동일한 Cloud Shell 탭
언급된 AlloyDB 비밀번호 (PGPASSWORD) 값과 AlloyDB 클러스터 ID를 사용하여 GCE VM에서 AlloyDB에 연결합니다.
export PGPASSWORD=<Noted password>
export PROJECT_ID=$(gcloud config get-value project)
export REGION=us-central1
export ADBCLUSTER=alloydb-aip-01
export INSTANCE_IP=$(gcloud alloydb instances describe $ADBCLUSTER-pr --cluster=$ADBCLUSTER --region=$REGION --format="value(ipAddress)")
psql "host=$INSTANCE_IP user=postgres sslmode=require"
예상되는 콘솔 출력:
student@instance-1:~$ export PGPASSWORD=CQhOi5OygD4ps6ty student@instance-1:~$ export PROJECT_ID=$(gcloud config get-value project) export REGION=us-central1 export ADBCLUSTER=alloydb-aip-01 export INSTANCE_IP=$(gcloud alloydb instances describe $ADBCLUSTER-pr --cluster=$ADBCLUSTER --region=$REGION --format="value(ipAddress)") psql "host=$INSTANCE_IP user=postgres sslmode=require" psql (17.10 (Debian 17.10-0+deb13u1), server 17.9) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql) Type "help" for help. postgres=>
psql 세션을 닫습니다.
exit
6. 데이터베이스 준비
데이터베이스를 만들고, Agent Platform AI 통합을 사용 설정하고, 데이터베이스 객체를 만들고, 데이터를 가져옵니다.
AlloyDB에 필요한 권한 부여
AlloyDB 서비스 에이전트에 Gemini Enterprise Agent Platform 권한을 추가합니다.
맨 위에 있는 '+' 기호를 사용하여 다른 Cloud Shell 탭을 엽니다.

새 Cloud Shell 탭에서 다음을 실행합니다.
PROJECT_ID=$(gcloud config get-value project)
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:service-$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")@gcp-sa-alloydb.iam.gserviceaccount.com" \
--role="roles/aiplatform.user"
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-001-402417)$ PROJECT_ID=$(gcloud config get-value project) Your active configuration is: [cloudshell-11039] student@cloudshell:~ (test-project-001-402417)$ gcloud projects add-iam-policy-binding $PROJECT_ID \ --member="serviceAccount:service-$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")@gcp-sa-alloydb.iam.gserviceaccount.com" \ --role="roles/aiplatform.user" Updated IAM policy for project [test-project-001-402417]. bindings: - members: - serviceAccount:service-4470404856@gcp-sa-alloydb.iam.gserviceaccount.com role: roles/aiplatform.user - members: ... etag: BwYIEbe_Z3U= version: 1
탭에서 실행 명령어 'exit' 중 하나를 사용하여 탭을 닫습니다.
exit
데이터베이스 만들기
데이터베이스 만들기 빠른 시작
GCE VM 세션에서 다음을 실행합니다.
데이터베이스를 만듭니다.
psql "host=$INSTANCE_IP user=postgres" -c "CREATE DATABASE quickstart_db"
예상되는 콘솔 출력:
student@instance-1:~$ psql "host=$INSTANCE_IP user=postgres" -c "CREATE DATABASE quickstart_db" CREATE DATABASE student@instance-1:~$
Vertex AI 통합 사용 설정
데이터베이스에서 Vertex AI 통합 및 pgvector 확장 프로그램을 사용 설정합니다.
GCE VM에서 다음을 실행합니다.
psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "CREATE EXTENSION IF NOT EXISTS google_ml_integration CASCADE"
psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "CREATE EXTENSION IF NOT EXISTS vector"
예상되는 콘솔 출력:
student@instance-1:~$ psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "CREATE EXTENSION IF NOT EXISTS google_ml_integration CASCADE" psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "CREATE EXTENSION IF NOT EXISTS vector" CREATE EXTENSION CREATE EXTENSION student@instance-1:~$
데이터 가져오기
준비된 데이터를 다운로드하고 새 데이터베이스로 가져옵니다.
GCE VM에서 다음을 실행합니다.
gcloud storage cat gs://cloud-training/gcc/gcc-tech-004/cymbal_demo_schema.sql |psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db"
gcloud storage cat gs://cloud-training/gcc/gcc-tech-004/cymbal_products.csv |psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "\copy cymbal_products from stdin csv header"
gcloud storage cat gs://cloud-training/gcc/gcc-tech-004/cymbal_inventory.csv |psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "\copy cymbal_inventory from stdin csv header"
gcloud storage cat gs://cloud-training/gcc/gcc-tech-004/cymbal_stores.csv |psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "\copy cymbal_stores from stdin csv header"
예상되는 콘솔 출력:
student@instance-1:~$ gsutil cat gs://cloud-training/gcc/gcc-tech-004/cymbal_demo_schema.sql |psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" SET SET SET SET SET set_config ------------ (1 row) SET SET SET SET SET SET CREATE TABLE ALTER TABLE CREATE TABLE ALTER TABLE CREATE TABLE ALTER TABLE CREATE TABLE ALTER TABLE CREATE SEQUENCE ALTER TABLE ALTER SEQUENCE ALTER TABLE ALTER TABLE ALTER TABLE student@instance-1:~$ gsutil cat gs://cloud-training/gcc/gcc-tech-004/cymbal_products.csv |psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "\copy cymbal_products from stdin csv header" COPY 941 student@instance-1:~$ gsutil cat gs://cloud-training/gcc/gcc-tech-004/cymbal_inventory.csv |psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "\copy cymbal_inventory from stdin csv header" COPY 263861 student@instance-1:~$ gsutil cat gs://cloud-training/gcc/gcc-tech-004/cymbal_stores.csv |psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db" -c "\copy cymbal_stores from stdin csv header" COPY 4654 student@instance-1:~$
7. 임베딩 계산
데이터를 가져온 후에는 cymbal_products 테이블에 제품 데이터가, cymbal_inventory 테이블에 각 매장에서 구매 가능한 제품 수가 표시된 인벤토리가, cymbal_stores 테이블에 매장 목록이 있습니다. 제품 설명을 기반으로 벡터 데이터를 계산해야 하며, 이를 위해 google_ml.embedding와 같은 함수를 사용할 수 있습니다. 사용된 기술에 관한 자세한 내용은 문서를 참고하세요.
몇 개의 행에 대한 임베딩을 생성하는 것은 쉽지만 행이 수천 개라면 어떻게 효율적으로 만들 수 있을까요? 이 섹션에서는 대규모 테이블의 임베딩을 생성하고 관리하는 방법을 설명합니다. 다양한 옵션과 기법에 대한 자세한 내용은 가이드를 참고하세요.
빠른 임베딩 생성 사용 설정
AlloyDB 인스턴스 IP와 postgres 비밀번호를 사용하여 VM에서 psql을 사용하여 데이터베이스에 연결합니다.
psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db"
google_ml_integration 확장 프로그램의 버전을 확인합니다.
SELECT extversion FROM pg_extension WHERE extname = 'google_ml_integration';
버전은 1.5.2 이상이어야 합니다. 출력 예시는 다음과 같습니다.
quickstart_db=> SELECT extversion FROM pg_extension WHERE extname = 'google_ml_integration'; extversion ------------ 1.6 (1 row)
기본 버전은 1.6 이상이어야 하지만 인스턴스에 이전 버전이 표시되면 업데이트해야 할 수 있습니다. 인스턴스에 유지보수가 사용 중지되었는지 확인합니다.
google_ml_integration.enable_faster_embedding_generation 데이터베이스 플래그가 사용 설정되어 있는지 확인합니다. 동일한 psql 세션에서 플래그 값을 확인합니다.
show google_ml_integration.enable_faster_embedding_generation;
플래그가 올바른 위치에 있으면 예상 출력은 다음과 같습니다.
quickstart_db=> show google_ml_integration.enable_faster_embedding_generation; google_ml_integration.enable_faster_embedding_generation ---------------------------------------------------------- on (1 row)
플래그 값이 'off'로 표시되면 인스턴스를 업데이트해야 합니다. 문서에 설명된 대로 웹 콘솔 또는 gcloud 명령어를 사용하여 수행합니다.
psql 세션을 종료합니다.
exit;
gcloud를 사용하여 플래그를 업데이트하려면 다음을 실행하세요.
export PROJECT_ID=$(gcloud config get-value project)
export REGION=us-central1
export ADBCLUSTER=alloydb-aip-01
gcloud beta alloydb instances update $ADBCLUSTER-pr \
--database-flags google_ml_integration.enable_faster_embedding_generation=on \
--region=$REGION \
--cluster=$ADBCLUSTER \
--project=$PROJECT_ID \
--update-mode=FORCE_APPLY
몇 분 정도 걸릴 수 있지만 결국 플래그 값이 'on'으로 전환됩니다. 그런 다음 다음 단계를 진행할 수 있습니다.
임베딩 열 만들기
psql을 사용하여 데이터베이스에 연결하고 cymbal_products 테이블의 임베딩 함수에서 사용할 벡터 데이터 유형으로 가상 열을 만듭니다.
psql "host=$INSTANCE_IP user=postgres dbname=quickstart_db"
데이터베이스에 연결한 후 psql 세션에서 다음을 실행합니다.
ALTER TABLE cymbal_products ADD COLUMN embedding vector(768);
이 명령어는 향후 삽입을 위한 가상 열을 만듭니다.
예상되는 콘솔 출력:
quickstart_db=> ALTER TABLE cymbal_products ADD COLUMN embedding vector(768); ALTER TABLE quickstart_db=>
50개 행의 배치로 임베딩을 생성합니다. 동일한 psql 세션에서 다음을 실행합니다.
시간을 측정하여 얼마나 걸리는지 확인하려면 타이밍을 사용 설정하세요.
\timing
다음 명령어를 실행합니다.
CALL ai.initialize_embeddings(
model_id => 'text-embedding-005',
table_name => 'cymbal_products',
content_column => 'product_description',
embedding_column => 'embedding',
batch_size => 50
);
콘솔 출력에는 삽입 생성에 2초 미만이 걸린 것으로 표시됩니다.
quickstart_db=> CALL ai.initialize_embeddings(
model_id => 'text-embedding-005',
table_name => 'cymbal_products',
content_column => 'product_description',
embedding_column => 'embedding',
batch_size => 50
);
NOTICE: Initialize embedding completed successfully for table cymbal_products
CALL
Time: 1458.704 ms (00:01.459)
quickstart_db=>
다양한 배치 크기를 실험하여 실행 시간이 달라지는지 확인할 수 있습니다.
기본적으로 해당 product_description 열이 업데이트되거나 완전히 새로운 행이 삽입되는 경우 삽입이 새로고침되지 않습니다. 하지만 incremental_refresh_mode 매개변수를 설정하여 이 작업을 수행할 수 있습니다.
'product_embeddings' 열을 만들고 자동으로 업데이트되도록 설정합니다.
ALTER TABLE cymbal_products ADD COLUMN product_embedding vector(768);
CALL ai.initialize_embeddings(
model_id => 'text-embedding-005',
table_name => 'cymbal_products',
content_column => 'product_description',
embedding_column => 'product_embedding',
batch_size => 50,
incremental_refresh_mode => 'transactional'
);
테이블에 새 행을 삽입합니다.
INSERT INTO "cymbal_products" ("uniq_id", "crawl_timestamp", "product_url", "product_name", "product_description", "list_price", "sale_price", "brand", "item_number", "gtin", "package_size", "category", "postal_code", "available", "product_embedding", "embedding") VALUES ('fd604542e04b470f9e6348e640cff794', NOW(), 'https://example.com/new_product', 'New Cymbal Product', 'This is a new cymbal product description.', 199.99, 149.99, 'Example Brand', 'EB123', '1234567890', 'Single', 'Cymbals', '12345', TRUE, NULL, NULL);
표를 쿼리하여 두 임베딩 열을 비교합니다.
SELECT uniq_id,embedding, (product_embedding::real[])[1:5] as product_embedding FROM cymbal_products WHERE uniq_id='fd604542e04b470f9e6348e640cff794';
출력에 product_embedding는 자동으로 채워지지만 embedding는 비어 있는 것으로 표시됩니다.
quickstart_db=> SELECT uniq_id,embedding, (product_embedding::real[])[1:5] as product_embedding FROM cymbal_products WHERE uniq_id='fd604542e04b470f9e6348e640cff794';
uniq_id | embedding | product_embedding
----------------------------------+-----------+---------------------------------------------------------------
fd604542e04b470f9e6348e640cff794 | | {0.015003494,-0.005349732,-0.059790313,-0.0087091,-0.0271452}
(1 row)
Time: 3.295 ms
8. 유사성 검색 실행
AlloyDB AI를 사용하여 생성된 벡터 임베딩을 기반으로 유사성 검색을 실행합니다.
SQL 쿼리는 동일한 psql 명령줄 인터페이스에서 실행하거나 AlloyDB Studio에서 실행할 수 있습니다. 다중 행 및 복잡한 출력은 AlloyDB Studio에서 더 잘 작동합니다.
AlloyDB Studio에 연결
AlloyDB Studio를 열려면 다음 단계를 따르세요.
- Google Cloud 콘솔에서 PostgreSQL용 AlloyDB의 클러스터 페이지로 이동합니다.
- 기본 인스턴스를 선택하여 웹 인터페이스를 엽니다.
3. 그런 다음 왼쪽에서 AlloyDB Studio를 클릭합니다.

quickstart_db데이터베이스, 사용자 postgres를 선택하고 기록된 비밀번호를 입력한 후 '인증'을 클릭합니다.

이 작업을 실행하면 AlloyDB Studio 인터페이스가 열립니다.
- 제목 없는 쿼리 탭을 선택하여 SQL 편집기를 엽니다.

그러면 다음 이미지와 같이 SQL 명령어를 실행할 수 있는 편집기가 열립니다.

명령줄 psql을 사용하려면 대체 경로를 따라 이전 장에서 설명한 대로 VM SSH 세션에서 데이터베이스에 연결하세요.
유사성 검색 실행
클라이언트의 요청과 가장 관련성이 높은 사용 가능한 제품 목록을 가져오는 쿼리를 실행합니다. '여기에서 어떤 종류의 과일나무가 잘 자라나요?'의 벡터 값을 얻기 위해 Gemini Enterprise Agent Platform의 임베딩 모델에 전달된 검색어 (Google 제품의 임베딩을 생성하는 데 사용된 것과 동일)
쿼리를 실행합니다.
SELECT
cp.product_name,
left(cp.product_description,80) as description,
cp.sale_price,
cs.zip_code,
(cp.embedding <=> embedding('text-embedding-005','What kind of fruit trees grow well here?')::vector) as distance
FROM
cymbal_products cp
JOIN cymbal_inventory ci on
ci.uniq_id=cp.uniq_id
JOIN cymbal_stores cs on
cs.store_id=ci.store_id
AND ci.inventory>0
AND cs.store_id = 1583
ORDER BY
distance ASC
LIMIT 10;
예상되는 출력은 다음과 같습니다.
quickstart_db=> SELECT
cp.product_name,
left(cp.product_description,80) as description,
cp.sale_price,
cs.zip_code,
(cp.embedding <=> embedding('text-embedding-005','What kind of fruit trees grow well here?')::vector) as distance
FROM
cymbal_products cp
JOIN cymbal_inventory ci on
ci.uniq_id=cp.uniq_id
JOIN cymbal_stores cs on
cs.store_id=ci.store_id
AND ci.inventory>0
AND cs.store_id = 1583
ORDER BY
distance ASC
LIMIT 10;
product_name | description | sale_price | zip_code | distance
-------------------------+----------------------------------------------------------------------------------+------------+----------+---------------------
Cherry Tree | This is a beautiful cherry tree that will produce delicious cherries. It is an d | 75.00 | 93230 | 0.43922018972266397
Meyer Lemon Tree | Meyer Lemon trees are California's favorite lemon tree! Grow your own lemons by | 34 | 93230 | 0.4685112926118228
Toyon | This is a beautiful toyon tree that can grow to be over 20 feet tall. It is an e | 10.00 | 93230 | 0.4835677149651668
California Lilac | This is a beautiful lilac tree that can grow to be over 10 feet tall. It is an d | 5.00 | 93230 | 0.4947204525907498
California Peppertree | This is a beautiful peppertree that can grow to be over 30 feet tall. It is an e | 25.00 | 93230 | 0.5054166905547247
California Black Walnut | This is a beautiful walnut tree that can grow to be over 80 feet tall. It is a d | 100.00 | 93230 | 0.5084219510932597
California Sycamore | This is a beautiful sycamore tree that can grow to be over 100 feet tall. It is | 300.00 | 93230 | 0.5140519790508755
Coast Live Oak | This is a beautiful oak tree that can grow to be over 100 feet tall. It is an ev | 500.00 | 93230 | 0.5143126438081371
Fremont Cottonwood | This is a beautiful cottonwood tree that can grow to be over 100 feet tall. It i | 200.00 | 93230 | 0.5174774727252058
Madrone | This is a beautiful madrona tree that can grow to be over 80 feet tall. It is an | 50.00 | 93230 | 0.5227400803389093
검색어와 의미상 가까운 설명이 있는 제품 10개가 가장 유사한 제품이 상단에 오도록 거리 순으로 표시됩니다.
9. 대답 개선
쿼리 결과를 사용하여 클라이언트 애플리케이션에 대한 응답을 개선하고, 제공된 쿼리 결과를 파운데이션 생성형 언어 모델에 대한 프롬프트의 일부로 사용하여 의미 있는 출력을 준비할 수 있습니다.
이를 위해 벡터 검색의 상위 결과가 포함된 JSON을 생성한 다음, 생성된 JSON을 Agent Platform의 생성형 AI 모델에 대한 프롬프트에 추가하여 의미 있는 출력을 만듭니다. 첫 번째 단계에서는 JSON을 생성하고, 두 번째 단계에서는 에이전트 플랫폼 스튜디오에서 테스트하며, 마지막 단계에서는 모든 것을 애플리케이션에서 사용할 수 있는 하나의 SQL 문으로 통합합니다.
JSON 형식으로 출력 생성
JSON 형식으로 출력을 생성하고 Agent Platform에 전달할 행을 하나만 반환하도록 쿼리를 수정합니다.
쿼리를 실행합니다.
WITH trees as (
SELECT
cp.product_name,
left(cp.product_description,80) as description,
cp.sale_price,
cs.zip_code,
cp.uniq_id as product_id
FROM
cymbal_products cp
JOIN cymbal_inventory ci on
ci.uniq_id=cp.uniq_id
JOIN cymbal_stores cs on
cs.store_id=ci.store_id
AND ci.inventory>0
AND cs.store_id = 1583
ORDER BY
(cp.embedding <=> embedding('text-embedding-005','What kind of fruit trees grow well here?')::vector) ASC
LIMIT 1)
SELECT json_agg(trees) FROM trees;
출력의 JSON:
[{"product_name":"Cherry Tree","description":"This is a beautiful cherry tree that will produce delicious cherries. It is an d","sale_price":75.00,"zip_code":93230,"product_id":"d536e9e823296a2eba198e52dd23e712"}]
Vertex AI Studio에서 프롬프트 실행
생성된 JSON을 사용하여 Vertex AI Studio의 생성형 AI 모델에 프롬프트의 일부로 제공합니다.
Google Cloud 콘솔에서 Gemini Enterprise Agent Platform Studio를 엽니다.

인터페이스에 프롬프트를 작성합니다.

다음 프롬프트를 입력합니다.
You are a friendly advisor helping to find a product based on the customer's needs.
Based on the client request we have loaded a list of products closely related to search.
The list in JSON format with list of values like {"product_name":"name","description":"some description","sale_price":10,"zip_code": 10234, "produt_id": "02056727942aeb714dc9a2313654e1b0"}
Here is the list of products:
{"product_name":"Cherry Tree","description":"This is a beautiful cherry tree that will produce delicious cherries. It is an d","sale_price":75.00,"zip_code":93230,"product_id":"d536e9e823296a2eba198e52dd23e712"}
The customer asked "What tree is growing the best here?"
You should give information about the product, price and some supplemental information

프롬프트를 실행하면 다음과 같은 결과가 표시됩니다.

답변에는 나무와 위치에 관한 정보를 기반으로 모델이 외부 소스에서 가져온 가격, 설명, 추가 정보가 포함됩니다.
PSQL에서 프롬프트 실행
데이터베이스에서 직접 SQL을 사용하여 생성형 모델에서 동일한 응답을 얻기 위해 Gemini Enterprise Agent Platform과 AlloyDB AI 통합을 실행하여 유사한 결과를 얻을 수 있습니다. gemini-3.6-flash 모델을 사용하려면 먼저 등록해야 합니다.
gemini-3.6-flash 모델을 등록합니다.
AlloyDB Studio에서 다음을 실행합니다.
CALL google_ml.create_model(
model_id => 'gemini-3.6-flash',
model_request_url => 'https://aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/global/publishers/google/models/gemini-3.6-flash:generateContent',
model_provider => 'google',
model_type => 'llm'
);
언제든지 google_ml.model_info_view에서 정보를 선택하여 등록된 모델 목록을 확인할 수 있습니다.
SELECT model_id,model_type FROM google_ml.model_info_view WHERE model_id ILIKE '%flash%';
다음은 샘플 출력입니다.
quickstart_db=> SELECT model_id,model_type FROM google_ml.model_info_view WHERE model_id ILIKE '%flash%';
model_id | model_type
-----------------------+------------
gemini-3.6-flash | llm
gemini-2.0-flash | llm
gemini-2.5-flash | llm
gemini-2.0-flash-lite | llm
gemini-2.5-flash-lite | llm
(5 rows)
이제 SQL을 사용하여 하위 쿼리에서 생성된 JSON을 gemini-3.6-flash 모델의 프롬프트의 일부로 사용할 수 있습니다.
psql 또는 AlloyDB Studio 세션에서 다음 쿼리를 실행합니다.
WITH trees AS (
SELECT
cp.product_name,
cp.product_description AS description,
cp.sale_price,
cs.zip_code,
cp.uniq_id AS product_id
FROM
cymbal_products cp
JOIN cymbal_inventory ci ON
ci.uniq_id = cp.uniq_id
JOIN cymbal_stores cs ON
cs.store_id = ci.store_id
AND ci.inventory>0
AND cs.store_id = 1583
ORDER BY
(cp.embedding <=> embedding('text-embedding-005',
'What kind of fruit trees grow well here?')::vector) ASC
LIMIT 1),
prompt AS (
SELECT
'You are a friendly advisor helping to find a product based on the customer''s needs.
Based on the client request we have loaded a list of products closely related to search.
The list in JSON format with list of values like {"product_name":"name","product_description":"some description","sale_price":10}
Here is the list of products:' || json_agg(trees) || 'The customer asked "What kind of fruit trees grow well here?"
You should give information about the product, price and some supplemental information' AS prompt_text
FROM
trees),
response AS (
SELECT
google_ml.predict_row( model_id =>'gemini-3.6-flash',
request_body => json_build_object('contents',
json_build_object('role',
'user',
'parts',
json_build_object('text',
prompt_text))))->'candidates'->0->'content'->'parts'->0->'text' AS resp
FROM
prompt)
SELECT
REPLACE(resp::text, '\n', CHR(10))
FROM
response;
예상되는 출력은 다음과 같습니다. 생성형 AI 모델의 비결정론적 특성으로 인해 출력이 다를 수 있습니다.
"Hello there! I'd be delighted to help you pick out a wonderful fruit tree for your space. Based on our local selection, a fantastic option that grows very well is the **Cherry Tree**! Here are the details on this beautiful tree: * **Product:** Cherry Tree * **Price:** $75.00 ### Why it's a great choice: * **Delicious Harvest:** It produces tasty, fresh cherries right in your backyard. * **Size & Benefits:** It's a deciduous tree that grows to about 15 feet tall, making it ideal for providing both lovely shade and a bit of privacy. * **Year-Round Beauty:** It features lush, dark green leaves throughout the summer that transform into a stunning red in the autumn. * **Growing Requirements:** Cherry trees thrive best in cool, moist climates with sandy soil, and are perfectly suited for USDA hardiness zones 4 through 9. Please let me know if you have any questions about planting or if you'd like help adding this to your order!"
10. 벡터 색인 만들기
이 데이터 세트는 작기 때문에 응답 시간은 주로 Gemini Enterprise Agent Platform의 모델과의 상호작용에 따라 달라집니다. 하지만 수백만 개의 벡터를 쿼리하면 벡터 검색 자체가 응답 시간의 상당 부분을 차지하고 데이터베이스의 부하가 증가할 수 있습니다. 검색 성능을 개선하려면 벡터 색인을 빌드하면 됩니다.
ScaNN 색인 만들기
ScaNN 색인을 빌드하려면 추가 확장 프로그램을 사용 설정해야 합니다. alloydb_scann 확장 프로그램은 Google ScaNN 알고리즘을 사용하여 근사 최근접 이웃 (ANN) 벡터 색인을 사용하는 인터페이스를 제공합니다.
AlloyDB Studio에서 실행:
CREATE EXTENSION IF NOT EXISTS alloydb_scann;
색인은 MANUAL 또는 AUTO 모드로 만들 수 있습니다. MANUAL 모드는 기본적으로 사용 설정되어 있으며 다른 색인과 마찬가지로 색인을 생성하고 유지관리할 수 있습니다. 하지만 AUTO 모드를 사용 설정하면 유지보수가 필요하지 않은 색인을 만들 수 있습니다. 모든 옵션에 관한 자세한 내용은 문서를 참고하세요. 자동 모드로 색인을 만들 수 있는 행이 충분하지 않으므로 수동으로 만듭니다.
AlloyDB Studio에서 다음을 실행합니다.
CREATE INDEX cymbal_products_embeddings_scann ON cymbal_products
USING scann (embedding cosine)
WITH (num_leaves=10, max_num_levels = 1);
색인 매개변수 조정에 관한 자세한 내용은 문서를 참고하세요.
예상 출력:
quickstart_db=> CREATE INDEX cymbal_products_embeddings_scann ON cymbal_products USING scann (embedding cosine) WITH (num_leaves=10, max_num_levels = 1); CREATE INDEX quickstart_db=>
대답 비교
시맨틱 검색에서 상위 값을 가져오는 데 사용한 쿼리를 반복합니다.
WITH trees as (
SELECT
cp.product_name,
left(cp.product_description,80) as description,
cp.sale_price,
cs.zip_code,
cp.uniq_id as product_id
FROM
cymbal_products cp
JOIN cymbal_inventory ci on
ci.uniq_id=cp.uniq_id
JOIN cymbal_stores cs on
cs.store_id=ci.store_id
AND ci.inventory>0
AND cs.store_id = 1583
ORDER BY
(cp.embedding <=> embedding('text-embedding-005','What kind of fruit trees grow well here?')::vector) ASC
LIMIT 1)
SELECT json_agg(trees) FROM trees;
예상 출력:
[{"product_name":"Cherry Tree","description":"This is a beautiful cherry tree that will produce delicious cherries. It is an d","sale_price":75.00,"zip_code":93230,"product_id":"d536e9e823296a2eba198e52dd23e712"}]
출력에 동일한 'Cherry Tree'가 있습니다.
색인 사용을 확인합니다.
EXPLAIN (analyze)
WITH trees as (
SELECT
cp.product_name,
left(cp.product_description,80) as description,
cp.sale_price,
cs.zip_code,
cp.uniq_id as product_id
FROM
cymbal_products cp
JOIN cymbal_inventory ci on
ci.uniq_id=cp.uniq_id
JOIN cymbal_stores cs on
cs.store_id=ci.store_id
AND ci.inventory>0
AND cs.store_id = 1583
ORDER BY
(cp.embedding <=> embedding('text-embedding-005','What kind of fruit trees grow well here?')::vector) ASC
LIMIT 1)
SELECT json_agg(trees) FROM trees;
예상 출력 (명확히 하자면):
...
Aggregate (cost=27.24..27.25 rows=1 width=32) (actual time=0.964..0.965 rows=1 loops=1)
-> Subquery Scan on trees (cost=18.91..27.23 rows=1 width=142) (actual time=0.953..0.954 rows=1 loops=1)
-> Limit (cost=18.91..27.22 rows=1 width=158) (actual time=0.948..0.949 rows=1 loops=1)
-> Nested Loop (cost=18.91..7126.86 rows=855 width=158) (actual time=0.948..0.948 rows=1 loops=1)
-> Nested Loop (cost=18.63..7103.59 rows=855 width=907) (actual time=0.931..0.931 rows=1 loops=1)
-> Index Scan using cymbal_products_embeddings_scann on cymbal_products cp (cost=18.21..343.15 rows=942 width=903) (actual time=0.906..0.908 rows=2 loops=1)
Order By: (embedding <=> '[-0.106554024,0.035774965,-0.027267234,-0.045653425,-0.03286045,0.02124319...
출력에서 쿼리가 'cymbal_products에서 cymbal_products_embeddings_scann을 사용하는 색인 스캔'을 사용하고 있음을 확인할 수 있습니다.
이 쿼리는 색인을 빌드하기 전에 검색 결과 상단에 표시되었던 동일한 Cherry tree를 반환합니다. 근사 최근접 이웃 (ANN) 색인은 검색 속도를 위해 절대 정확도를 희생하므로 색인 기반 쿼리는 색인이 지정되지 않은 정확한 검색과 약간 다른 상위 결과를 반환할 수 있습니다. 하지만 벡터 색인은 높은 정확도를 유지하면서 성능을 크게 향상합니다.
자세히 알아보려면 다른 벡터 색인 유형을 사용해 보거나 문서 페이지에서 LangChain 통합을 사용한 실습과 예시를 찾아보세요.
11. 환경 정리
실습을 마치면 AlloyDB 인스턴스와 클러스터를 폐기합니다.
AlloyDB 클러스터 및 모든 인스턴스 삭제
클러스터는 옵션 force로 폐기되며, 클러스터에 속한 모든 인스턴스도 삭제됩니다.
터미널 연결이 끊어진 경우 다시 연결하고 Cloud Shell에서 프로젝트와 환경 변수를 정의합니다.
gcloud config set project <YOUR_PROJECT_ID>
export REGION=us-central1
export ADBCLUSTER=alloydb-aip-01
export PROJECT_ID=$(gcloud config get-value project)
다음과 같이 클러스터를 삭제합니다.
gcloud alloydb clusters delete $ADBCLUSTER --region=$REGION --force
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-001-402417)$ gcloud alloydb clusters delete $ADBCLUSTER --region=$REGION --force All of the cluster data will be lost when the cluster is deleted. Do you want to continue (Y/n)? Y Operation ID: operation-1697820178429-6082890a0b570-4a72f7e4-4c5df36f Deleting cluster...done.
AlloyDB 백업 삭제
클러스터의 모든 AlloyDB 백업을 삭제합니다.
for i in $(gcloud alloydb backups list \
--filter="CLUSTER_NAME: projects/$PROJECT_ID/locations/$REGION/clusters/$ADBCLUSTER" \
--format="value(name)" \
--sort-by=~createTime) ; do \
gcloud alloydb backups delete $(basename $i) --region $REGION --quiet; done
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-001-402417)$ for i in $(gcloud alloydb backups list --filter="CLUSTER_NAME: projects/$PROJECT_ID/locations/$REGION/clusters/$ADBCLUSTER" --format="value(name)" --sort-by=~createTime) ; do gcloud alloydb backups delete $(basename $i) --region $REGION --quiet; done Operation ID: operation-1697826266108-60829fb7b5258-7f99dc0b-99f3c35f Deleting backup...done.
이제 VM을 폐기할 수 있습니다.
GCE VM 삭제
Cloud Shell에서 다음을 실행합니다.
export GCEVM=instance-1
export ZONE=us-central1-a
gcloud compute instances delete $GCEVM \
--zone=$ZONE \
--quiet
예상되는 콘솔 출력:
student@cloudshell:~ (test-project-001-402417)$ export GCEVM=instance-1
export ZONE=us-central1-a
gcloud compute instances delete $GCEVM \
--zone=$ZONE \
--quiet
Deleted
12. 축하합니다
축하합니다. Codelab을 완료했습니다.
이 실습은 Google Cloud를 사용한 프로덕션 레디 AI 학습 과정의 일부입니다.
- 전체 교육과정을 살펴보고 프로토타입에서 프로덕션으로 전환하세요.
#ProductionReadyAI해시태그를 사용하여 진행 상황을 공유하세요.
학습한 내용
- AlloyDB 클러스터 및 기본 인스턴스를 배포하는 방법
- Google Compute Engine VM에서 AlloyDB에 연결하는 방법
- 데이터베이스를 만들고 AlloyDB AI를 사용 설정하는 방법
- 데이터베이스에 데이터를 로드하는 방법
- AlloyDB Studio 사용 방법
- AlloyDB에서 Gemini Enterprise Agent Platform 임베딩 모델을 사용하는 방법
- Gemini Enterprise Agent Platform Studio 사용 방법
- Gemini Enterprise Agent Platform 생성형 모델을 사용하여 결과를 보강하는 방법
- 벡터 색인을 사용하여 성능을 개선하는 방법
13. 설문조사
결과: