AI Implementation
Puppeteer creates AI Assistants for healthcare, enhancing patient interactions with advanced prompting and tailored behaviors.
Luca Spektor
Jul 26, 2024
4
min read
Puppeteer is a framework that leverages advanced prompting and orchestration to create customizable conversational AI Assistants. Here’s an overview of how it works under the hood:
Our AI Assistants have two main roles:
AI Chatbot: This component analyzes the user’s message, calls API models, tracks the conversation’s state, and manages memory.
Puppeteer: This orchestration layer monitors and controls the chatbot’s decisions.
The AI chatbot conducts the conversation, while Puppeteer monitors and intervenes when necessary according to the defined behaviors.
What is a Behavior in Puppeteer’s Context?
A “behavior” is the key function that Puppeteer uses to control chatbots. A behavior consists of a Trigger, Condition(s), and Action(s). These behaviors are customizable for clients.
Hierarchically, above these behaviors exists a PuppeteerConfig: a configuration or set of different behaviors that define an AI Assistant.
Here is a hierarchical map to visualize this:
Understanding Triggers, Conditions, and Actions
Once you understand how an AI Assistant is composed, let’s dive deeper into what Triggers, Conditions, and Actions are:
Triggers - When should the behavior activate? Examples include:
New user message received
Scheduled time reached
Conversation started
External API callback
Conditions - Should the action execute? Examples include:
Use GPT-4 to analyze the last message or conversation state
Query external APIs
Apply custom logic
Actions - What the Puppeteer actually does. Examples include:
Give the chatbot new instructions
Send proactive messages
Store information for long-term memory
Make API calls
Retrieve relevant information from external knowledge bases
By combining Triggers, Conditions, and Actions, you can create flexible behaviors tailored to your specific use cases.
Examples of How Behavior’s Look Implemented:
With behaviors, you can orchestrate sophisticated conversations, such as:
Retrieve and Embed Relevant Information:
Use retrieval augmented generation (RAG) to pull key info from documents provided by the client and seamlessly integrate it into the chatbot's responses.
Save Conversation Summaries:
Automatically summarize key points from conversations and save them for later access, enabling continuity across multiple chat sessions.
Orchestrate Complex Protocols:
Coordinate the chatbot through multi-turn conversations, like intake and assessment flows, using step-by-step protocol configurations.
Proactively Send Messages:
Prompt the chatbot to proactively send follow-up messages, reminders, and notifications without a user message.
Call External APIs and Workflows:
Integrate with external systems by calling API endpoints and triggering workflows from within a conversation.
Personalized Education and Guidance:
Adapt explanations and guidance based on the user's needs and interests.
Long-Term Memory and Follow-Ups:
Maintain user profiles and conversation history for continuity across sessions.
Proactively follow up on key topics days or weeks later.
If you want to see our already created behaviors, please check out this example and video demonstration of how it works: Patient Intake Demo