Generative AI code samples and sample applications
Sample applications
Deploy a prebuilt generative AI sample application, then fork the code to modify it for your own use-case.
Deploy a one-click sample application to summarize long documents with Vertex AI.
Beginner
Python
Deploy a one-click sample application that uses vector embeddings stored in Cloud SQL to improve the accuracy of responses from a chat application.
Beginner
Python
Deploy a one-click sample application that extracts question-and-answer pairs from a set of documents, along with a pipeline that triggers the application when a document is uploaded.
Beginner
Python
Build a web app to generate marketing campaign ideas, using Gemini on Vertex AI, Cloud Run, and Streamlit.
Beginner
Python
Sample app for retrieval-augmented generation with AlloyDB for PostgreSQL and Vertex AI. (blog post, codelab).
Intermediate
Python
Learn to build a Node-based RAG app that provides investment recommendations for financial advisors. This sample integrates with Vertex AI, Cloud Run, AlloyDB, and Cloud Run functions. Built with Angular, TypeScript, Express.js, and LangChain.
Intermediate
Node
Learn to build a RAG app that helps car owners troubleshoot their vehicle, without having to flip through their owner's manual. Variants include Cloud SQL with pgvector, and Vertex AI Agent Builder. Built with Java (Spring) and Python (Streamlit).
Intermediate
Java
Jump Start Solution: Document Summarization
Jump Start Solution: Generative AI RAG with Cloud SQL
Jump Start Solution: Generative AI Knowledge Base
Generate a marketing campaign with Gemini
Airport Assistant: RAG App
GenWealth: RAG app
Fix My Car: RAG app
SDKs and Frameworks
Learn how to work with Google Cloud's generative AI APIs using SDK code snippets.
Learn how to apply the Vertex AI Gemini SDKs to tasks like chat, multimodal prompts, and document processing. Browse additional code samples here.
Beginner
Python
Node
Java
Go
C#
Learn how to store and retrieve RAG documents using Vertex AI Agent Builder (formerly Vertex AI Search).
Beginner
Python
Node
Java
Go
C#
PHP
Ruby
Integrating other products, like Cloud Storage or Firestore, into your generative AI app? Browse all Google Cloudclient libraries in your programming language of choice.
Beginner
Python
Node
Java
Go
C#
PHP
Ruby
Explore code snippets for using LangChain alongside Google Cloud products, including chat models (Vertex AI), vector databases (AlloyDB, Cloud SQL, Firestore, Vertex AI Agent Builder, BigQuery, and others), and others (Google Drive, Google Maps, YouTube, and others).
Beginner
Python
Explore code snippets for using LangChain alongside Google Cloud products, including chat models (Vertex AI), vector databases (Vertex AI Vector Search), and others (Google Search).
Beginner
Node
Firebase Genkit is an open-source framework that helps you build, deploy, and monitor production-ready AI-powered web applications. Genkit comes with plugins for Vertex AI, Cloud Operations, and Firestore.
Beginner
Node
Explore code snippets for using LangChain alongside Google Cloud products, including chat models (Vertex AI).
Beginner
Java
Vertex AI - Gemini SDKs
Vertex AI Agent Builder SDKs
Browse all Google Cloud client libraries
LangChain (Python)
LangChain.js (Node)
Genkit (Node)
LangChain4j (Java)
Notebooks
Explore hands-on walkthroughs of generative AI use cases.
Learn how to call Gemini 1.5 Flash, and leverage its long context window, using the Vertex AI SDK. This notebook includes text, video, and audio modalities.
Beginner
Python
Learn how to extract sheet music metadata, such as composer and tempo, from PDFs using the Vertex AI SDK.
Beginner
Python
Learn how to analyze video sentiment, including facial expressions, using the Vertex AI SDK.
Beginner
Python
Learn how to extract information from movie posters by calling Gemini directly from BigQuery.
Intermediate
Python
Learn how to convert text and images to vector embeddings using the Vertex AI SDK, for use in a retrieval-augmented generation (RAG) application.
Intermediate
Python
Learn how to augment Gemini's response with real-time data, such as a company's stock price and latest news.
Intermediate
Python
Learn how to migrate your existing Vertex AI SDK code to call Gemini instead of PaLM.
Intermediate
Python
Learn how to tune Gemini using Vertex AI, to train the model to respond well to questions about Python coding.
Advanced
Python
Explore dozens of other Vertex AI notebooks in the Google Cloud Sample Browser.
Intermediate
Python
Getting started with Vertex AI Gemini 1.5 Flash
Sheet Music Analysis with Gemini
Video Analysis with Gemini
Analyzing movie posters in BigQuery with Gemini
Introduction to Vertex AI Embeddings - Text & Multimodal
Function-calling with Gemini
Code migration from PaLM to Gemini
Supervised Tuning with Gemini for Question-answering
Browse all notebooks