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
_createcontext stub if no stubsession if present - The
_createcontext stub would define the feedback action with acreate_stubtask that passes the notification platform message data into a new stub following thedefaultcontext - The newly created
defaultcontext stub will run the_createlifecycle action and have tasks to detect the various incoming notification data - If the notification data for a particular notification platform is detected, the
_createaction will run asend_actionstask and replay the feedback action on thedefaultstub - The
_createaction would also initialize an AI Agent with a system prompt message - The feedback action would then run on the
defaultstub and triggergpt_chat_taskthat 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
defaultstub and all subsequent replies from the user would be handled by thedefaultstub - The LLM Agent will call AI Enabled actions and correspond with the user on the stub until the stubsession times out
- A
defaultstub in this case would represent a single query from a user