GCP DialogFlowCX Data store LLM generated agent responses based Knowledgebase in Storage.

AI/ML, DialogflowCX, 2024

image

This is a continuation of the DialogFLowCX Sandbox setup which I had detailed in the page: GCP DialogFlowCX: Setup, Flow, Intent, Entities and Parameters

I have built a integration of Cloud Function and Spanner as a Webhook to DiaglowFlowCX in this page: ConversationAI: Integrating DialogflowCX with backends data sources using webhooks

I will be continuing the sandbox in this page to bring in AI Capabilitieis into DialogFlowCX. I will create a Data Store Vertex AI Agent, which can be based on various sources like Cloud Storage, websites, or other data sources. I will be using Cloud Storage. When a user interacts with your agent, the agent would need to access information from the data store or knowledge base to provide a relevant response. Vertex AI provides conversational AI capabilities to the agent’s responses to specific information stored in a data store.

Creat a knowledge base in Cloud Storage

I copied multiple files from my githubpages over to Cloud Storage.

image

image

Create a DataStore Agent

Data store agents are a special type of Dialogflow agent that can provide LLM generated agent responses based on your website content and uploaded data.

We just need to select the folder and we are good to go. There were around 60 files and it took just a few minutes to index.

I wanted to index my github pages but thats for another time.

image

Connect the DataStore Agent to the DialogFlowCX Flow App

image

This is a very simple step. I have a page “Knowledge base” which I will use. Under StateHandler (Documentation is very poor on this) we can add data stores. Select the Data Store App.

image

Selecting the Generative AI which we be applied on the DataStore Agent

Under the Agent Settings, proceed to the Generative AI section, and then to DataStore.

  1. Low Grounding score. Know more below.
  2. Selected gemini1.0pro001 as the prompt
  3. Fall back was default to use generative AI

image image

Testing the agent

image

Playing with Grounding Score

Grounding means that the agent’s responses are not just generic or made up, but are grounded in real, factual information retrieved from the data store. In other words, the agent uses the data store to “ground” its responses. This means it retrieves specific information from the data store and uses it to formulate its answers

The “grounding score” is a measure of how confident the system is that the chatbot’s response is based on real, factual information from a knowledge base.

Low Grounding Score

  • Dialogflow CX has low confidence that the response is grounded in the knowledge base. This could mean that the system didn’t find any relevant information or that the information it found was not very strong.
  • Responses with low grounding scores might be less accurate or might contain information that is not fully supported by the knowledge base.
  • Users might be less likely to trust a chatbot that provides responses with low grounding scores.

Test 1: Direct questions which I know I have a paragraph on.: Passed

Side Note: NLU (another component of DialogFlowCX) was not able to handle a spelling mistake which I thought it should have. But maybe not.

image

I did a compare and it made my answer better.

image

Test 2: Question which I have a page but not a paragraph: Passed

image

A more complex question like best practices would be difficult and it was not able to provide one.

For what is parquet, I dont remember giving such a detailed description on what is parquet. I am wondering if the fall back is kicking in. I will comfirm later.

High Grounding Score

  • Dialogflow CX has a high level of confidence that the chatbot’s response is grounded in the knowledge base. This means the system has found relevant information in the knowledge base that supports the response.
  • Responses with high grounding scores are more likely to be accurate and factual.
  • Users are more likely to trust a chatbot that provides responses with high grounding scores.

Test 1: Direct questions which I know I have a paragraph on.: Not sure

No difference between High and Low

image

Test 2: Question which I have a page but not a paragraph: Not sure

the answer was less descriptive.

image