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

Customizing Prompts in Dialogflow Data Store Agents for Dynamic Content

Hi everyone,

I'm currently working on a Dialogflow project using data store agents integrated with a Datastore website. One challenge I'm facing is with handling dynamic content such as upcoming events or meetings. When users ask about these, the agent tends to provide outdated information.

However, I've noticed that when users include the current date in their query, the agent responds accurately. This leads me to believe that dynamically including the current date in the user's question could be a solution.

I've explored the customization options for prompts in Datastore, but I haven't found any placeholders or methods for incorporating the current date dynamically.

Has anyone successfully utilized customized prompts in Datastore agents to handle dynamic content with the current date? If so, I would greatly appreciate any guidance or insights you could provide on how to achieve this.

Solved Solved
3 3 913
1 ACCEPTED SOLUTION

Hi!

You should use the Discoveryengine API alpha version to make a query to a data store and a Gemini API call with the sources from the data store + session parameters + a prompt.

you can automate all of this by using langchain, using data store as vectorDB and gemini as the llm.

LLM: https://js.langchain.com/docs/integrations/platforms/google

Retriever: https://python.langchain.com/docs/integrations/retrievers/google_vertex_ai_search/

Best,

Xavi

View solution in original post

3 REPLIES 3

Hi, unfortunately, there is not a way to pass parameters to the customization prompt when accessing a data store like what we have for generators.

My suggestion would be to access the data store with a custom prompt in a webhook where you can use parameters.

Best,

Xavi

Thanks for your response. Could you please let me know if there are any existing guidelines or documentation available for implementing this approach?

Hi!

You should use the Discoveryengine API alpha version to make a query to a data store and a Gemini API call with the sources from the data store + session parameters + a prompt.

you can automate all of this by using langchain, using data store as vectorDB and gemini as the llm.

LLM: https://js.langchain.com/docs/integrations/platforms/google

Retriever: https://python.langchain.com/docs/integrations/retrievers/google_vertex_ai_search/

Best,

Xavi