Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to use session parameters to query a connected data store in Dialogflow CX?

I've connected a data store about cars to my start page. If you ask the agent questions, it will give answers. However, if the question is too generic, the answer will be incorrect so I've created routes to guide the user into asking a more specific question. From this, I've extracted parameters which I want to use to re-ask the data store for information. 

For example, without parameters, a user would ask "what's a Hondas top speed", which would then give an answer of a random Hondas top speed. For my design, I get the user's "car brand" and "car model" and store into session parameters.  I then want to ask the data store "What's this [car brand] [car model] top speed" but I can't find where to inject the parameters.

I'd like to avoid using web hooks for this relatively simple task.

Solved Solved
0 7 535
1 ACCEPTED SOLUTION

Hi, unfortunately, that is not possible. The prompt to query a data store is generic and used by all data store handlers.

View solution in original post

7 REPLIES 7

Hi, unfortunately, that is not possible. The prompt to query a data store is generic and used by all data store handlers.

Would webhooks work for this? Or alternatively, since generators can use parameters, can they also make use of the data store?

A generator cannot access a datastore, but you can check query a datastore with the prompt that you want from a webhook

I see, thanks for the help. As I was testing this out, the data store agent seems to understand context of the conversation history, is this the case? So although I can't use parameters directly, after getting car brand/car model, if the user says "tell me the price", the agent retrieves the answer related to that specific car.

yeah, the data store agent understands the conversation history. you can customize the prompt: https://cloud.google.com/dialogflow/vertex/docs/concept/data-store-agent-settings#customize-summariz...

You cannot use parameters in the data store prompt

@cloudeq Were you able to implement the datastore calling based on the session params?

Hey everyone,

I'm currently taking an ML path on Google Skill Boost and accumulated multiple undone labs. If anyone can share some Google Cloud credits with me, I'd really appreciate it!

Here's my profile: My Profile

Thanks a ton!