Recognizing a Return from the Knowledge Graph

Hi Everyone,

I am trying to determine if an approach to determine if the user is returning from the knowledge graph. Currrently the approach goes as follows:

On initial entry to bot the context session data does not contain the key “historicTags” but upon user asking a FAQ the bot is directed to knowledge graph and returns back to bot with new “historicTags” field within context session data. Withing this “historicTags” field there is a key labeled “tags” which is an array and in it contains a field “intent FAQ”.

Can anyone confirm or deny if this is a proper approach is appropriate to determine whether or not user is returning from the knowledge graph? See example below:


“historicTags”: [
{
“tags”: [
“intent faq”,
“xyz”
]
}
]

Please also refer to this thread for further context.

Hi @jberean,

The historic tags holds the last executed task name i.e., dialog task/knowledge task etc.
You can extract the value from the tag array using:

context.historicTags[0].tags

You can also use the solution proposed in this link:

Either of the solution will suffice your requirement.

Let us know if you have any further issues/queries.

Regards,
Yoga Ramya

End of task does not seem to ever populate. Our current approach is to place a context output in the knowledge graph names “FAQ_Intent_Found” so when we return from the knowledge graph this field can be found in the historical tags. Can you confirm or deny this approach is sound?

Hi John,

As explained over the ticket, you can use historicalTags for your requirement.

Regards,
Yoga Ramya.

Hi Yoga,

once we found the historicTags in context then can we remove the object from the context , and also if we did that means it will impact NLP process.

Also is there a way to read NL Analysis in the script node as like context we are retrieving .

Thanks
Ram