How to keep specific context tag alive throughout entire use session

We add some tags to Intent Preconditions in one node of Knowledge Graph.


We also add contextTags in a dialog corresponding to tags added in Knowledge Graph.

addContextTags
Then, for a user session, we tested these tags and they work fine.

conversation1
But if the FAQ with precondition tags was asked again, we are unable to get the right answer.

conversation2
We checked the debug log, 3 tags we added before disappeared.

debug-log1
debug-log2

So, we are wondering if there is way to make some specific context tags persist/alive through the entire use session, please.

1 Like

Yes, there is way to make some specific context tags persist/alive through the entire use session.

This can be achieved by setting the TTL values.

The TTL for variables being created under any of the context types can be defined using the below syntax:
BotContext.put("", “Value”, TTL)
*TTL (time to last in mins )

Please refer to the below link for more details:
https://developer.kore.ai/docs/bots/bot-builder/defining-bot-tasks/using-session-and-context-variables-in-tasks/ 6

If the TTL is not specified while creating variables, they last forever under the respective context types except for UserSession and BotUserSession . For these two context types, if the TTL is not provided for variables, it will only last until the default time (30 mins).

@yuan.liao
Did you get a chance to go through https://developer.kore.ai/docs/bots/bot-builder-tool/dialog-task/custom-meta-tags/
There are user level and session level tagging available.

@yuan.liao
If you are talking about intent precondition specifically, it depends on output context. Please go through this.
https://developer.kore.ai/docs/bots/bot-intelligence/context-management/

After the end of conversation since the context is over, output context will be removed.

cc: @Subrahmanyam can you please share your thoughts?