Membangun aplikasi AI generatif menggunakan AlloyDB AI
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Sebagai database yang kompatibel dengan PostgreSQL, AlloyDB terintegrasi secara lancar dengan alat dan framework yang didukung oleh PostgreSQL, selain layanan lain dari lingkungan Google Cloud .
AlloyDB AI menyediakan serangkaian fitur AI dan ML yang memungkinkan Anda membangun aplikasi AI generatif. Fitur ini memungkinkan Anda membuat aplikasi dengan kemampuan seperti penelusuran vektor untuk kesamaan semantik, kueri bahasa alami, dan integrasi dengan model machine learning oleh penyedia, seperti Google, OpenAI, dan Anthropic.
Untuk menyederhanakan proses pembangunan aplikasi AI, AlloyDB menyediakan ekstensi berikut:
Ekstensi vector: Ekstensi pgvector PostgreSQL
standar disesuaikan untuk AlloyDB, dan disebut sebagai vector.
Fitur ini mendukung penyimpanan embedding yang dihasilkan dalam kolom vektor. Ekstensi ini juga menambahkan dukungan untuk fitur kuantisasi skalar guna membuat indeks IVF. Anda juga dapat membuat indeks IVFFlat atau indeks HSNW yang tersedia dengan pgvector saham.
Ekstensi alloydb_scann: Ekstensi alloydb_scann menerapkan indeks elemen terdekat yang sangat efisien yang didukung oleh algoritma ScaNN.
Anda dapat menggunakan ekstensi alloydb_scann dengan database yang kompatibel dengan PostgreSQL 14 dan 15.
Ekstensi google_ml_integration: Ekstensi google_ml_integration menyediakan fitur mesin kueri AI, yang mencakup fungsi untuk membuat embedding, peringkat semantik, dan menerapkan filter, gabungan, serta pembuatan/ringkasan teks berbasis AI. Ekstensi ini juga menyediakan fungsi untuk mendaftarkan
metadata untuk model AI. Metadata terdaftar kemudian digunakan untuk memanggil prediksi dari model ini.
Ekstensi alloydb_ai_nl: Ekstensi alloydb_ai_nl memungkinkan developer
membuat aplikasi yang secara akurat dan aman menjawab pertanyaan natural
language pengguna akhir tentang data dalam database AlloyDB. Hal ini membuat data dapat diakses oleh pengguna yang mungkin tidak mahir menulis SQL.
Berikut beberapa kasus penggunaan yang diaktifkan oleh ekstensi ini:
Lakukan kueri SQL cerdas menggunakan mesin kueri AI AlloyDB: Gunakan AI langsung dalam kueri SQL Anda. Hal ini memungkinkan Anda mengurutkan ulang hasil penelusuran agar lebih relevan, mengintegrasikan bahasa alami ke dalam kueri SQL, dan membuat embedding multimodal untuk penelusuran vektor.
Penelusuran vektor: Gunakan AlloyDB untuk menyimpan embedding vektor dan melakukan penelusuran kemiripan yang sangat efisien. Anda dapat membuat indeks tetangga terdekat yang sangat efisien yang didukung oleh algoritma ScaNN.
Panggil model menggunakan endpoint model: Daftarkan model AI sebagai endpoint model dan panggil endpoint dari dalam AlloyDB untuk membuat embedding, memanggil prediksi, atau melakukan penelusuran kesamaan.
Buat embedding dan panggil prediksi: Gunakan model embedding teks Vertex AI atau endpoint model terdaftar untuk membuat embedding teks atau multimodal.
Membuat pernyataan SQL dari bahasa alami: Tambahkan kemampuan bahasa alami ke aplikasi Anda, dan berinteraksi dengan AlloyDB dengan mengajukan pertanyaan dalam bahasa alami. Pertanyaan natural language kemudian diproses oleh AlloyDB AI untuk otomatis membuat kueri SQL yang akurat untuk mendapatkan jawabannya.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-25 UTC."],[[["\u003cp\u003eAlloyDB AI provides machine learning capabilities to AlloyDB for PostgreSQL and AlloyDB Omni, allowing users to apply semantic and predictive power to their data.\u003c/p\u003e\n"],["\u003cp\u003eThe platform includes a customized \u003ccode\u003evector\u003c/code\u003e extension for storing and querying embeddings, as well as the \u003ccode\u003ealloydb_scann\u003c/code\u003e extension for efficient nearest-neighbor indexing, using algorithms like ScaNN.\u003c/p\u003e\n"],["\u003cp\u003eAlloyDB AI extends PostgreSQL with functions like \u003ccode\u003eInvoke predictions\u003c/code\u003e and \u003ccode\u003eGenerate embeddings\u003c/code\u003e, which allow for querying models using SQL and translating text prompts into numerical vectors, respectively.\u003c/p\u003e\n"],["\u003cp\u003eUsers can leverage the \u003ccode\u003eembedding()\u003c/code\u003e and \u003ccode\u003egoogle_ml.embedding()\u003c/code\u003e functions to query Vertex AI models, including the use of text embeddings, as well as custom hosted or third-party models.\u003c/p\u003e\n"],["\u003cp\u003eAlloyDB's integration with Vertex AI enables applications to invoke predictions using any model in the Vertex AI Model Garden and to generate embeddings using the \u003ccode\u003etext-embedding-005\u003c/code\u003e English models.\u003c/p\u003e\n"]]],[],null,["# Build generative AI applications using AlloyDB AI\n\nAs a PostgreSQL-compatible database, AlloyDB integrates\nseamlessly with the tools and frameworks supported by PostgreSQL, in addition to\nother services from the Google Cloud environment.\n\nAlloyDB AI provides a suite of AI and ML features that enable you to build\ngenerative AI applications. These features allow you to build\napplications with capabilities like vector search for semantic similarity,\nnatural language queries, and integration with machine learning models by providers, such as Google, OpenAI, and Anthropic.\n\nTo simplify the process of building AI applications, AlloyDB provides the following extensions:\n\n- **vector** extension: The standard [`pgvector` PostgreSQL\n extension](https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing) is customized for AlloyDB, and referred to as `vector`.\n It supports storing generated embeddings in a vector column. The extension also\n adds support for scalar quantization features to create `IVF` indexes. You can\n also create an `IVFFlat` index or `HSNW` index that are available with stock\n `pgvector`.\n\n- **alloydb_scann** extension: The [`alloydb_scann` extension](https://cloud.google.com/alloydb/docs/ai/store-index-query-vectors?resource=scann#create-index) implements a highly efficient\n nearest-neighbor index powered by the [ScaNN\n algorithm](https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md).\n\n You can use the `alloydb_scann` extension with PostgreSQL 14 and 15 compatible databases.\n- **google_ml_integration** extension: The `google_ml_integration` extension\n provides the AI query engine feature, which includes functions for generating embeddings,\n semantic ranking, and implementing AI-based filters, joins and text\n generation/summarization. This extension also provides functions to register\n metadata for AI models. The registered metadata is then used to invoke predictions from these\n models.\n\n- **alloydb_ai_nl** extension: The `alloydb_ai_nl` extension enables developers\n to build applications that accurately and securely answer end user natural\n language questions about data in the AlloyDB database. This makes the data\n accessible to users who might not be proficient in writing SQL.\n\nThe following are some use cases that these extensions enable:\n\n- [Vector search](/alloydb/docs/ai/run-vector-similarity-search): Use AlloyDB to store vector embeddings and perform highly efficient similarity searches. You can generate a highly efficient nearest-neighbor index powered by the ScaNN algorithm.\n\n- [Perform intelligent SQL queries using AlloyDB AI query engine](/alloydb/docs/ai/evaluate-semantic-queries-ai-operators): Use AI directly within your SQL queries. This allows you to re-rank search results for higher relevance, integrate natural language into your SQL queries, and generate multimodal embeddings for vector search.\n\n- [Call models using model endpoints](/alloydb/docs/ai/model-endpoint-overview): Register AI models as model endpoints and call the endpoints from within AlloyDB to generate embeddings, invoke predictions, or perform similarity searches.\n\n- [Generate embeddings](/alloydb/docs/ai/work-with-embeddings) and [invoke predictions](/alloydb/docs/ai/invoke-predictions): Use Vertex AI text embedding models or registered model endpoints to generate text or multimodal embeddings.\n\n- [Generate SQL statements from natural language](/alloydb/docs/ai/natural-language-overview): Add natural language capabilities to your application, and interact with AlloyDB by asking questions in natural language. The natural language questions are then processed by AlloyDB AI to automatically generate an accurate SQL query that retrieve the answer.\n\nWhat's next\n-----------\n\n- [Perform vector search tutorial](/alloydb/docs/ai/perform-vector-search)\n\n- [Integrate AlloyDB with Vertex AI](/alloydb/docs/ai/configure-vertex-ai).\n\n- [Create indexes and query vectors](/alloydb/docs/ai/store-index-query-vectors)."]]