No-Code Solution: Google Vertex AI

Ever wondered if you could turn your PDFs, manuals, ebooks, or website content into a helpful AI chatbot? With Google Vertex AI and Dialogflow CX, you can create a custom knowledge base chatbot—no coding skills required. In just minutes, you’ll have a chatbot that delivers instant answers from your own data, whether it’s a PDF, Word document, PowerPoint presentation, or even website pages.

This tutorial will walk you through creating a data store agent, adding structured or unstructured data, enabling voice or text-based interaction, testing and integrating the chatbot on your website, and viewing conversation history and analytics. Ready to make your online content more interactive and potentially earn revenue by building chatbots for clients? Let’s get started.

Pricing and Cost Considerations

Before building your AI chatbot, it’s important to understand potential costs. Google Cloud Platform (GCP) pricing varies based on usage, storage, and API calls. Here are some general guidelines:

  • Vertex AI: You may be charged for training and inference usage. However, if you’re just setting up simple trials or proofs of concept, your usage might stay within the free tier. New users often receive a credit (e.g., $300 in free credits) to get started.
  • Dialogflow CX: Charges typically apply based on the number of text or voice requests. Be sure to check the latest pricing on Google Cloud’s Dialogflow CX pricing page for up-to-date information.
  • Cloud Storage: Storing files (PDF, Word, etc.) in Google Cloud Storage costs roughly $0.02 per GB per month for standard storage in many regions. If you have small PDFs or documents, the cost will be minimal.
  • Monitoring and Logging: Collecting conversation logs is usually free up to certain limits, but additional logging or analytics might incur charges. Always review your GCP usage in the Billing section of the console.

Overall, for light to moderate use, you can keep costs low. However, if you have large documents, heavy traffic, or advanced features, keep a close eye on your usage and budget within your GCP billing settings.

1. Prepare Your Documents

First, choose the files or website content you want your chatbot to reference. This can include:

  • PDF manuals, ebooks, or reports
  • HTML web pages
  • TXT or CSV files
  • Word documents (.docx)
  • PowerPoint presentations (.pptx)

In this example, we’re using the “Budget of the US Government” PDF, which is 192 pages long. You can use any document relevant to your business or niche.

1.1 Upload Files to a Google Cloud Storage Bucket

If you plan to use PDF or other document files as part of your custom knowledge base, you’ll need to upload them to a Google Cloud Storage bucket (unless you plan to crawl a website instead). First sign in at cloud.google.com and click console on upper right hand corner of the screen:

  1. Create a bucket (if you don’t have one):
    • In the Google Cloud Console, click on Navigation Menu (≡) at top left and select Cloud Storage.
    • Click Create Bucket.
    • Enter a globally unique name (e.g., my-unique-bucket-name).
    • Choose where to store your data and choose a storage class for your data (e.g., Standard).
    • Click Create at the bottom of the page.
    • You’ll be prompted if you need to enforce public access prevention on this bucket. If your documents are private make sure to check enforce public access prevention on this bucket.
  2. Upload your files:
    • Go to your bucket in the Storage section of the console.
    • Click Upload Files.
    • Select your PDF, Word, or other documents from your computer.
    • Click Open to start the upload process.
  3. Confirm your files are uploaded:
    • Once the upload completes, you should see your files listed in the bucket.
    • Take note of the path or object URL for each file (you’ll need this for importing into your chatbot’s data store).
  4. Set proper access controls (if needed):
    • If your documents are private, make sure the bucket does not allow public access.
    • If you need public access for demonstration purposes, adjust the permissions accordingly.

That’s it! Your files are now hosted in Google Cloud Storage, ready to be imported into your agent’s data store for your AI chatbot.

2. Set Up Google Vertex AI and Dialogflow CX

To get started, sign in at cloud.google.com and navigate to the Google Cloud Console. Verify that the following APIs are enabled:

  • Vertex AI API
  • Dialogflow API

Once these are active, follow these steps:

  1. Search for “Agent Builder” in the console.
  2. Click “Agent Builder” and select Create App.
  3. Scroll to find Chat and click Create
  4. Provide a company name and an agent name, then click Continue.

3. Create Your Data Store

The data store is where your chatbot’s knowledge base will live.

  1. Click on Create Data Store in Agent Builder.
  2. Select how you want to import data:
    • Website URL: Automatically crawl defined domains.
    • Google Cloud Storage: Import folders or single files.
    • Manual API calls: Advanced users can import via the API.
  3. Choose Cloud Storage if you’ve uploaded your files to a bucket. Make sure “Unstructured documents (PDF, HTML, TXT and more)” radio button is checked. Click Browse to find the bucket you created earlier (see instructions above). Click on the bucket name and click select. Click Continue.
  4. Label your data store and type a data store name (e.g., “US Budget”), then click Create.
  5. The newly created Data Store should be already selected, if not click on it and then click Create.
  6. Please allow some time for the Vertex AI to complete processing your data source files. Click on the Activity tab to monitor the progress. Once import has been completed. Click on Preview.

Vertex AI can handle various file types for unstructured documents, including PDFs, HTML, text files, CSV, Word, and presentation files.

4. Test Your Chatbot

Testing is crucial to ensure your chatbot responds accurately. You can simulate user questions to see how it behaves.

  1. Click Test Agent (usually found at the top right corner in DialogflowCX).
  2. Enter questions like “Hello” or “What are the President’s top priorities?”
  3. Review the chatbot’s responses. If you want to see exactly where it retrieved the information, click the reference link.

If your chatbot isn’t answering correctly, refine its data sources by adding more documents or URLs. You can also adjust the agent’s settings for better performance.

5. Enable Logging and Conversation History

To view how users interact with your chatbot over time, enable conversation logging:

  1. Go to your Agent settings and check the box labeled Enable conversational history.
  2. Click Save.
  3. Access your logs via the “Conversation History” menu to see transcripts and data analytics.

6. Integrate the Chatbot Into Your Website

One of the best features of Vertex AI is that you can deploy the chatbot across multiple channels:

  • Website embed
  • Facebook Messenger
  • Slack
  • Discord
  • Telegram
  • Whatsapp
  • and more

For a quick website integration:

  1. Click Manage > Integrations in Agent Builder.
  2. Click on Connect under Dialogflow Messenger.
  3. Click on Enable the Unauthenticated API to allow visitors to interact without signing in.
  4. Copy the generated code snippet and paste it into your website’s HTML.
  5. Click Try it now
  6. Test it live by clicking the chat icon in the bottom corner of your site.

You can also set up a phone gateway for voice interactions. This uses Google Cloud’s speech-to-text and text-to-speech features.

7. Explore Analytics and Conversation History

Once your chatbot is live and visitors start interacting, you can track engagement by clickin on the Conversation history in the sidebar on the left:

  • Monitor which questions come up most often.
  • Identify where the chatbot might need more training or data.
  • Fine-tune the data sources to improve answer accuracy.

8. Monetize Your Chatbot Skills

This method isn’t just for your own website. You can build custom knowledge base chatbots for other businesses—charging for setup, training, and maintenance. Many companies have massive PDFs, reports, and knowledge articles that can become much more accessible to their customers with an AI chatbot.

Conclusion

Congratulations! You’ve now created a custom knowledge base AI chatbot using Google Vertex AI and Dialogflow CX. Instead of manually crafting dozens of intents and training phrases, you’ve harnessed the power of data stores to quickly set up a dynamic and user-friendly chatbot. Whether you’re embedding it on your own site or offering it as a service, this new skill can open up exciting opportunities for revenue and user engagement.

 


Full-Code Solution: Google Gemini AI API & Node.js

Bonus Video: Step by Step Tutorial

Finished Project Files

Github Repository: https://github.com/codingmoney/coding-money-chatbot