add question answering AI bot to Wordpress

With tons of content on your WordPress site, you can add a question answering Chatbot that uses Artificial Intelligence to reply to user questions based on your existing information. This can be used to create a helpful online tool for your niche or even act as a customer service chatbot.

To create a chatbot that answers questions accurately(like ChatGPT) using your WordPress site content, we will use a free plugin and OpenAI. By the end of it, you will have added your content to the chatbot(automatically/manually) and get accurate answers from your new chatbot.

Follow the steps below to add AI Question Answering Chatbot to WordPress.

1. Install the AI Power plugin

We will use the AI Power free plugin to create our Chatbot on WordPress and connect it to OpenAI. The plugin integrates WordPress with OpenAI and Microsoft Azure. With the plugin, you can not only create your own Chatbot but also create an Ai image generation bot, generate content, create templates, create forms, write product descriptions and more functionality powered by the use of Artificial intelligence.

To Install the plugin, go to your WordPress dashboard and click on plugins, Add new. Search for AI Power install it and then activate.

AI power plugin

When done with plugin installation and activation, you will be redirected to the welcome page, here click Add Chat GPT to website.

Add chat GPT to website

You will be required to add your OpenAi Key, follow the next step below to get your API key.

2. Connect Open AI to your WordPress website

As we have mentioned above, the AI Power plugin uses OpenAI, you will hence need to connect your site by using the steps below:

  1. Visit openai.com
  2. If you already have an account, log in, if not create one by clicking on sign up
  3. You can sign up to OpenAI using your email, Google account, Microsoft account or Apple
  4. Once logged in, click on API
  5. Next, click on your account icon and choose View API keys
  6. Create a new Secret Key and copy it

Note:  The secret key can only be viewed and copied once just after creation. You should hence make sure you paste it immediately to your AI Power dashboard or save it in a secure place.

OpenAI

Charges: OpenAI will give you $18 credits when you signup for the first time. This is a plus since you will be able to set up and test your chatbot at no cost. However, when the credits are used up, you will be charged each time a user interacts with your chatbot. Visit the OpenAI pricing page for more.

Also check, How to add Subscribe to push notifications on WordPress.

3. Add OpenAI API key to your website

The next step will be to add the secret key that you just generated above to your website. To do this, please navigate to AI Power, then choose Add Chat GPt to my website, here paste the secret key and click on validate.

Add Open AI key to your website

4. Configure your WordPress AI chatbot

Now that your site is connected to OpenAI, it is time to configure your chatbot. On successful validation, click the next button. Choose the language for your chatbot and proceed to the next step.

Choose the right template for your chatbot depending on your user case. This can be customer support, sale support, product support or even a helpful chatbot.

Choose your chatbot purpose

For the last step, choose if you want to embed the chatbot through a Shortcode or Widget, a Shortcode is better since it can be embedded anywhere on the site. When done, click save, and a message with your shortcode should appear, copy this shortcode as we will use it to insert the Chabot on pages and posts.

Ready chatbot

5. Add your content to your Chatbot

For now, if you try asking questions to your chatbot, it will give general data available on the internet provided by OpenAI, this might not be very accurate or might not give direct answers as they are available on your website. Let’s hence add our content to the Chatbot for more accurate and customized user cases.

Connect Pinecone to your site

Go to AI Power on your WordPress dashboard and Choose Embeddings. On this page, we will need to configure a few things, but first, let’s connect Pinecone to our site.

Pinecone is required since it will assist you change your existing posts/pages content to data that OpenAI can understand.

To connect with Pinecone, please follow these steps:

  • Go pinecone.io
  • Click on Signup to create your account
  • You can continue with your Google, Github or Microsoft account
  • Wait for Pinecone to create and initialize your project(this might take some time)
  • Once the project is ready, click on Create New Index
  • On Dimensions, enter 1536 and the Metric should be Cosine
  • Click create index then proceed
  • Next, click on API Keys and copy your API Key then proceed to paste in your AI Power dashboard.

Create index on Pinecone

Wideup adding content to your Chatbot

Make sure that instant indexing is enabled on the embeddings settings pages in AI Power. Next, go to your posts/pages dashboard and select the posts you want to add to the chatbot then click on the Instant embedding button.

Instant embed your content

You can also use Cron to have the AI Power plugin Index content automatically. Additionally, the content builder option allows you to add content to your Chatbot, just copy and paste the text you want to add as shown below.

Free text index

6. Chatbot settings

The chatbot can be customized further by going to AI Power and then choosing ChatGPT, on this option you change language, tone, style, voice chat, custom text, and more.

Important: Since we want our Chatbot to use our content, please go to the Context option and enable the use of embeddings.

Set embeddings as source

7. Test your Question Answering WordPress Chatbot

Now, it is time to test your question-answering Chatbot, on the ChatGPT window, enter a question that has an answer on the content that you added, the Chatbot should give you an accurate answer.

In our case, we added one of our articles to the Chatbot and the answer given was correct as you can see from the image below.

Collect answer from the Chatbot

The AI Power plugin also allows you to create as many Chatbots as you want and customize each to your liking. Each Chatbot can be added to different pages using a Shortcode.

To display your Chatbot to users Copy the provided Shortcode and add it to your posts and pages where you want the Chatbot to appear.

We now have a working Question Answering Chatbot on our WordPress site that uses OpenAI to give accurate answers from our already existing content. The only downside is that you will have to pay OpenAi per each response your Chatbot gives once your OpenAi trial credits are over.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *