How to Build a Brand-Aware Gen AI Content Engine

Gen AI for Marketers: How to use GPT4All and Llama3 to
build a Brand-Aware Gen AI Content Engine (in less than 15 minutes!)

In this post, we’re going to cover how to build a simple “Brand-Aware” Gen AI content engine using GPT4all, a private desktop chatbot application, and the Meta Llama3 large language model. I’ll show you, in just a matter of minutes, how you can take your existing library of marketing content and plug it in to a large language model like Llama3 to generate new on-brand content for blogs, social, email, or any other purpose. While generic chatbots are fun to use, the real power of LLMs is unlocked when you power them with your own data using Retrieval Augmented Generation, or RAG for short. Now, with GPT4all, it’s easier than ever to deploy RAG and create highly customized, brand-aware content for your marketing programs.

Brands Are Struggling to Keep up With Content Marketing Demands
If you’re struggling to keep up with the demands of content marketing, you’re not alone. According to Deloitte Digital research, demand for content increased 1.5x in 2023, yet only 55% of marketers were able to meet the demand. Brands like Klarna, are turning to Generative AI to help close the gap. The potential productivity improvements and cost savings with Generative AI are significant. The buy-now-pay-later fintech firm recently announced it expects to save $10M in marketing expenses annually by using generative AI for copy and image generation. The CEO of Klarna said the company was saving millions of dollars by “spending less on photographers, image banks, and marketing agencies." Adobe claims customers using its Firefly and Sensei Gen AI tools are seeing dramatic increases in content productivity, reducing campaign development times from five weeks to one.

RAG: The key to creating great Gen AI Marketing Content

The key to creating great Gen AI marketing content is to build “Brand-Aware” content generation capabilities. “Brand-aware” means that your large language model either has access to or has been trained on your existing marketing content. For high-quality generative marketing copy creation, you want your LLM to be “plugged-in” to your corpus of brand assets like blog posts, product specs, white papers, website copy, and anything else that reflects your unique brand voice, products, and institutional knowledge.

The way to “plug-in” your content is by using a technique called Retrieval Augmented Generation. RAG enhances traditional language model responses by combining information retrieval with text generation. By incorporating your brand’s data using RAG, you can ensure that generated responses reflect your brand’s unique voice and factual information about your products or services. 

Ok, RAG sounds awesome, but how do you get started? There’s a really easy way, which I’m going to share with you here…GPT4All.

Getting Started with GPT4ALL

GPT4All is the easiest way to run Large Language Models locally on your PC, MAC, or Linux computer. With GPT4All, you can chat with models, turn your local files into information sources for models, and browse models available online to download onto your device. The coolest thing about GPT4All is that you don’t need a high-powered NVIDIA GPU to run LLMs like Meta Llama3 on your local computer. GPT4All will quantize the models, making them efficient enough to allow you to run them on any modern PC or Mac. So let’s build your first RAG-powered content engine, shall we?

1. Download and Install GPT4All on your local computer (GPT4All is available for Mac, Windows, and Linux devices)

Home screen for GPT4All

2.      Download Llama3 - After installation, launch the app and click “Models”. For this tutorial, search for ‘Llama 3 8B Instruct’ and click Download.

Model explorer in GPT4All

3.      Set up your document library for LocalDocs – To use GPT4All to chat about your existing library of marketing content, you will need to create a folder on your computer and place all your related marketing content text, PDFs, or markdown files you want to interact with there. If you have assets like web pages you want to include, you can simply print them to PDF and then include them in your document folder. If you have a large library of legacy blogs, convert them to text files, or collate them into a single text file, and place them in this folder.

4.      Connect your Document Library to GPT4All - Once you have your content folder setup, return to GPT4All and click ‘LocalDocs’ in the left-hand navigation and then select “+ Add Doc Collection’. Name the collection and then browse to the folder containing your document library. Click “Create Collection”.

Add Document Collection in GPT4All

GPT4All also recently added LocalDocs support for OneDrive and Google Drive. You can utilize the same steps above for folders containing marketing content on either of these cloud drives.

GPT4all creates embeddings from your documents library

5.      Create Embeddings – After you select ‘Create Collection’, GPT4all will create embeddings, or a searchable index of the content in your document library, that can be used to inform your chat sessions with Llama3 in the chat UI.

6.      Activate your Document Collection in the GPT4All Chat UI – Once your embeddings have been created, your document collection will be ready to use in the chat UI. Navigate back to the Chat window and select “LocalDocs” in the upper right corner. Select the document collection you just created. Now select the ‘Llama3 8B Instruct’ model from the dropdown in the top middle of the chat screen. Once the Llama3 model loads, that’s it, you’re ready to go! I told you this would be easy, didn’t I?

Select your document collection in LocalDocs before starting your chat session

Creating New Marketing Content with GPT4all and Llama3

Let’s try GPT4All out with a dataset of blog posts I have for a fitness startup, which we’ll call FitApp. The FitApp blog dataset contains over 300 blog posts on various fitness, diet, and wellness related topics.  The dataset itself is simply a text extract of the FitApp blog, with each post labeled with title, body content, and a call to action. You don’t necessarily need to label all your content, but having labels will help RAG perform better by contextualizing the information you’ll be referring to in your chat sessions, especially if you have large blobs of text like Blog posts in a single file.

1.      Test to Make Sure LocalDocs is Working - First you want to test out the LocalDocs RAG feature and make sure Llama3 is properly referencing your newly created document library during chat. So, my first prompt is “What is FitApp?” You can see the response here… Llama3 did great and summarized the app almost perfectly.

Testing LocalDocs with a fact-based question about documents in the Fitapp document collection

2.      Start Creating New Content – Once you’re confident GPT4All has embedded your data correctly, you’re ready to start creating content. I’ve found that building complex content like a blog post works best when you engage in multi-prompt chats about what you want the LLM to create for you, rather than asking for it to spit everything out at once. So, to create a new blog post for FitApp, I’m going to first ask Llama3 to suggest some “new topics” for the Fitapp blog.  Here is the output from that prompt:

Llama3 response to prompt "Suggest 5 new topics for the Fitapp Blog"

Once again, Llama3 did great, providing 5 topics and summaries that are highly relevant to the FitApp audience and reflective of past blog content. Notice how GPT4all also includes a link to sources in the footer of each response. This is super helpful if you’re referencing third-party content or have a large document library and want to know the origin of material being generated in your chats. In this case, there is only one file containing all the Fitapp blogs in my document library, so it’s always the same source.

I like Llama3’s suggestion for the blog topic in option #4, “From Couch to 5k: A Beginner’s Guide to Running with FitApp”, so in my next prompt I ask Llama3 to provide a outline for this topic. Once again, Llama3 does great, providing a comprehensive outline for this topic.

Blog outline for Llama3 suggested topic: "From Couch to 5k: A Beginner’s Guide to Running with FitApp"

From here you can start prompting your way through each of the topics in the outline to produce paragraphs of content that you can assemble into one comprehensive new blog post. Here’s a prompt asking for Llama3 to write a paragraph for the first bullet in the Introduction section of the outline:

Introductory paragraph for the FitApp running blog post, generated by Llama3

Not bad, right? Producing first drafts for new blog posts can move very quickly once you’ve established the topic and an outline. In the case of Fitapp, we might also want to incorporate references to running-related workouts available in the app and link to recovery-related nutrition blog posts to really fill out this post and ensure its relevance to our product and audience.  Even with those editorial additions, GPT4all and Llama3 take on about 80% of the work of drafting a high-quality blog post.

This works well using RAG here because we have a large corpus of past blog posts. If you’re starting with a smaller library of content, you’re going to get more generalized output and it may require more editorial work. Over time, you can add your newly created, human-edited content back into your document library to expand the amount of reference material available to your instance of GPT4All.

Conclusion

Using GPT4all and Llama3 to generate brand-aware content can be a game-changer for any business. By incorporating your own company's marketing content and product information, you can create a bespoke content engine that is uniquely tailored to your brand. This approach allows you to leverage the power of AI to generate content at scale, quickly and efficiently, while ensuring that your generative content is consistent and high-quality. You can use this approach to create virtually any type of content, such as product descriptions, email campaigns, and social media posts, all with the same high levels of customization and quality. With GPT4all and Llama3, any business can stay ahead of the content curve and better connect and engage with their customers.


Previous
Previous

Top 5 Gen AI Takeaways from the Databricks State of Data + AI Report

Next
Next

Get to know Pinokio