1. Template Patterns
  2. Initiated Chat

Template Patterns

Initiated Chat

Describes a conversational pattern where an incoming customer message starts an AI-assisted workflow in Stubber.

This is the most common pattern in Stubber.
For any customer enquiries, this is the pattern that templates would likely follow. The pattern is defined by :

  • an incoming message received from an external party
  • an AI Agent responding and handling some request over one or many states

Examples

  • Sales agent on a website, that responds to sales inquiries
  • Customer support via AI over email
  • Billing queries initiated over Whatsapp by customers

Detailed Structure

  • The incoming notification platform will be configured to initiate a feedback action on a _create context stub if no stubsession if present
  • The _create context stub would define the feedback action with a create_stub task that passes the notification platform message data into a new stub following the default context
  • The newly created default context stub will run the _create lifecycle action and have tasks to detect the various incoming notification data
  • If the notification data for a particular notification platform is detected, the _create action will run a send_actions task and replay the feedback action on the default stub
  • The _create action would also initialize an AI Agent with a system prompt message
  • The feedback action would then run on the default stub and trigger gpt_chat_task that will submit the chat to an LLM
  • The LLM would respond with a feedback action that would most likely trigger a notification to respond to the incoming message
  • This would create a stubsession to the default stub and all subsequent replies from the user would be handled by the default stub
  • The LLM Agent will call AI Enabled actions and correspond with the user on the stub until the stubsession times out
  • A default stub in this case would represent a single query from a user