Skip to content

Showcasing Google Cloud's generative AI for marketing scenarios via application frontend, backend, and detailed, step-by-step guidance for setting up and utilizing generative AI tools, including examples of their use in crafting marketing materials like blog posts and social media content, nl2sql analysis, and campaign personalization.

License

Notifications You must be signed in to change notification settings

mchcn2018/genai-for-marketing

Repository files navigation

Generative AI for Marketing using Google Cloud

This repository provides a deployment guide showcasing the application of Google Cloud's Generative AI for marketing scenarios. It offers detailed, step-by-step guidance for setting up and utilizing the Generative AI tools, including examples of their use in crafting marketing materials like blog posts and social media content.

Additionally, supplementary Jupyter notebooks are provided to aid users in grasping the concepts explored in the demonstration.

The architecture of all the demos that are implemented in this application is as follows.
Architecture

Repository structure

.
├── app
└── backend_apis
└── frontend
└── notebooks
└── templates
└── infra
  • /app: Architecture diagrams.
  • /backend_apis: Source code for backend APIs.
  • /frontend: Source code for the front end UI.
  • /notebooks: Sample notebooks demonstrating the concepts covered in this demonstration.
  • /templates: Workspace Slides, Docs and Sheets templates used in the demonstration.
  • /infra: Infrastructure deployment.

Demonstrations

In this repository, the following demonstrations are provided:

  • Marketing Insights: Utilize Looker Dashboards to access and visualize marketing data, powered by Looker dashboards, marketers can access and visualize marketing data to build data driven marketing campaigns. These features can empower businesses to connect with their target audience more efficiently, thereby improving conversion rates.
  • Audience and Insight finder: Conversational interface that translates natural language into SQL queries. This democratizes access to data for non-SQL users removing any bottleneck for marketing teams.
  • Trendspotting: Identify emerging trends in the market by analyzing Google Trends data on a Looker dashboard and summarize news related to top search terms. This can help businesses to stay ahead of the competition and to develop products and services that meet the needs and interests of their customers.
  • Content Search: Improve search experience for internal or external content with Vertex AI Search for business users.
  • Content Generation: Reduce time for content generation with Vertex Foundation Models. Generate compelling and captivating email copy, website articles, social media posts, and assets for PMax. All aimed at achieving specific goals such as boosting sales, generating leads, or enhancing brand awareness. This encompasses both textual and visual elements using Vertex language & vision models.
  • Workspace integration: Transfer the insights and assets you've generated earlier to Workspace and visualize in Google Slides, Docs and Sheets.

Notebooks and code samples

The notebooks listed below were developed to explain the concepts exposed in this repository:

The following additional (external) notebooks provide supplementary information on the concepts discussed in this repository:

  • Tuning Gemini: Examples of how to tune Gemini with your dataset to improve the model's response. This is useful for brand voice because it allows you to ensure that the model is generating text that is consistent with your brand's tone and style.
  • Document Summarization Techniques: Two notebooks explaining different techniques to summarize large documents.
  • Document Q&A: Two notebooks explaining different techniques to do document Q&A on a large amount of documents.
  • Vertex AI Search - Web Search: This demo illustrates how to search through a corpus of documents using Vertex AI Search. Additional features include how to search the public Cloud Knowledge Graph using the Enterprise Knowledge Graph API.
  • Vertex AI Search - Document Search: This demo illustrates how Vertex AI Search and the Vertex AI PaLM API help ensure that generated content is grounded in validated, relevant and up-to-date information.
  • Getting Started with LangChain and Vertex AI PaLM API: Use LangChain and Vertex AI PaLM API to generate text.

Configuration

Some of the behavior of Generative AI for Marketing can be changed by adjusting configuration.

Pre-Deployment Configuration

When deploying Generative AI for Marketing, various settings for the deployment are pulled from the infra/variables.tf file.

If your deployment needs do not match the default Generative AI for Marketing deployment, some of your deployment needs might be met by adjusting the defaults in variables.tf prior to beginning deployment.

Make changes to variables.tf prior to running terraform init, making changes afterwards may result in unexpected behavior including irrecoverable deployment failures.

Config.toml

When deploying, after terraform apply completes successfully, there will be a file called config.toml in backend_apis/app. config.toml is generated from infra/templates/config.toml.tftpl.

config.toml acts as a control center for a marketing content generation, providing the necessary settings, prompts, and data to automate the creation of personalized and brand-consistent marketing materials.

You can adjust some of the values in config.toml to change the behavior of your deployment. If you adjust the values in config.toml, rerun the backend deployment (infra/scripts/backend_deployment.sh) to push the updated config to the backend.

The following are the key sections of config.toml and their functions:

Global:

  • Sets core project settings (project ID, location).
  • Specifies credentials for Workspace access.
  • Identifies BigQuery datasets and Vertex AI resources.
  • Defines Workspace document templates and folders.
  • Sets the GCS bucket for asset storage.
  • Defines Workspace API scopes (permissions).

Prompts:

  • Provides detailed brand information (name, vision, mission, etc.) to guide content generation.
  • Defines prompt templates for various types of content (brand statement, primary message, communication channel, email, web post, ad, headlines, descriptions).
  • Includes placeholders ({}) for dynamic content insertion.

Models:

  • Specifies the names of AI models to use for text and image generation.

Data Sample:

  • Provides sample data and options (age buckets, names, languages) for personalizing content.

Environment Setup

You have two options to deploy the solution:

  1. Automated Deployment (Recommended): Navigate to the infra folder. This folder contains Terraform code and scripts designed to automate the entire deployment process for you. Follow the instructions provided within the folder to initiate the automated deployment.

  2. Manual Setup: If you prefer a hands-on approach, you can opt for manual setup. Detailed instructions are available on how to configure the solution components step-by-step.

Getting help

If you have any questions or if you found any problems with this repository, please report through GitHub issues.

About

Showcasing Google Cloud's generative AI for marketing scenarios via application frontend, backend, and detailed, step-by-step guidance for setting up and utilizing generative AI tools, including examples of their use in crafting marketing materials like blog posts and social media content, nl2sql analysis, and campaign personalization.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 41.6%
  • TypeScript 16.5%
  • HTML 15.3%
  • SCSS 12.1%
  • Python 11.5%
  • HCL 2.7%
  • Other 0.3%