dariowho/intents

Make intent lifespan configurable

Closed this issue · 0 comments

AS A chatbot developer
I WANT Agents to remember context for longer than 5 turns or forget contexts arbitrarily
SO THAT I have more control on the information and followups that are available at a given point in conversation

Details

Currently each context has a default lifespan of 5 turns that is not configurable. Sometimes we want to make that lifespan longer, to retain context parameters and possible followups longer; sometimes we want to kill intents, to clean context and reduce ambiguity when interpreting new intents. This can be achieved with the following implementation

  • A Intent.lifespan class variable can control the lifespan of a given intent
  • A new_lifespan parameter on the follow() relation can be used to extend the duration of a context, or removed altogether (follow(new_lifespan=0)))