AISimBot

AI Sim Bot

Education through AI-Powered Simulations

Overview

AI SimBot is a cutting-edge tool designed to enhance clinical educational experiences through realistic communication simulations. Initially created for prelicensure nursing students at Northeastern University to practice administering the CRAFFT, a screening tool for identifying substance use among youth, it now offers customizable settings for a wide range of educational and professional contexts focused on role-playing and communication skills.

Key Features

Benefits

Demo

Setup

In order to launch this app, you need to configure and set up the following three services:

  1. Create an OpenAI account.
    • Purpose: Provides the AI capabilities for the app, including managing conversations, converting speech to text, and generating spoken responses.
    • Generate an API key.
    • Write down your key, as it will not be shown again.
    • You can delete and create a new key if needed.
    • Purchase credits for API use. It may takes a few hours for API to be active.
  2. Create a GitHub account.
    • Purpose: Organizes and stores the app’s code, making it easy to update and manage.
    • Click here and fork this project.
    • Name your fork and click Create fork.
    • Save the URL for your forked repository.
  3. Create a Streamlit account.
    • Purpose: Hosts the app on a server and makes it accessible to users through a browser.
    • Click Create an app.
    • Select Deploy from repo.
    • Enter the URL of your forked repository.
    • Provide a unique and memorable URL for your app.
    • Choose Advanced settings, and under Secrets, add your OpenAI API key and app password in the following format:
    OPENAI_API_KEY = "your_openai_api_key"
    password = "user-password"
    admin_password = "admin-password"
    
    • Click Save and then Deploy.

Note: Secrets may take a few minutes to propagate. If you see an error about a missing key, wait a few minutes and then reboot your app by going to Manage app (in the lower-right corner) and clicking the overflow menu icon and then reboot.

If the issue persists, confirm that the key appears under App settings > Secrets.

Once set up correctly, you’ll see the app interface.

Testing Your App

  1. Click Share to get your app link.
  2. Open the link in a private browsing window or log out of Streamlit.
    • Shortcut keys:
      • Chrome, Safari, Edge: Ctrl-Shift-N (Windows) or Command-Shift-N (Mac).
      • Firefox: Ctrl-Shift-P (Windows) or Command-Shift-P (Mac).

Customize

  1. Go to your forked repository on GitHub.
  2. Navigate to the settings.toml file and click Edit file.
  3. Update the file content as needed and click Commit changes.
    • Add a short, descriptive title and summary for your changes.

The settings.toml file uses TOML format. For multiline fields, enclose text in '''. You can also use Markdown for formatting.

To update avatars, replace the relevant files in the assets folder.

To customize basic theme settings such as colors and fonts, edit the .streamlit/config.toml file. For advanced styling, modify the style.css file.

IMPORTANT: After commit changes, you need to reboot your app by going to Manage app (in the lower-right corner) and clicking the overflow menu icon and then reboot.

If you log in with the admin password, you can edit the prompt and test it quickly. You can also load and save prompts, as well as chat history.

Importance of Prompt

The content in prompt.txt is the most critical component of the AI SimBot, as it directly shapes the quality and relevance of the user experience.

  1. Be Clear and Specific: Clearly define the AI’s role, purpose, and behavior to minimize ambiguity.
    • Example: “You are Jordan, a 17-year-old non-binary high school student visiting a pediatric office for a routine physical. Speak naturally and respond based on the provided patient background.”
  2. Provide Sufficient Context: Offer background details to help the AI generate relevant and realistic responses.
    • Example: “Jordan has started using substances occasionally to cope with academic and social pressures and feels nervous about the CRAFFT screening due to concerns about judgment and confidentiality.”
  3. Guide Behavior with Clear Instructions: Specify how the AI should behave in different scenarios.
    • Example: “Begin the conversation feeling nervous and guarded. Gradually open up if the nurse is empathetic and supportive. If the nurse is judgmental, withdraw emotionally and respond defensively.”
  4. Use Step-by-Step Instructions: Break down tasks into smaller, manageable steps for the AI to follow.
    • Example: “Start the conversation with an introduction. Respond to the nurse’s questions using short, vague answers at first. Adjust your emotional openness based on the nurse’s tone.”
  5. Define Boundaries: Set clear limits on what the AI should avoid or omit.
    • Example: “Do not ask any questions. Do not mention the CRAFFT manual. If the nurse asks something outside your scope, respond with, ‘I’m not aware of that.’”
  6. Incorporate Examples for Clarity: Provide sample responses to illustrate the desired behavior.
    • Example: “When nervous, say things like, ‘It’s not a big deal,’ or ‘I only do it sometimes.’ If the nurse is empathetic, you might say, ‘Sometimes I just need an escape.’ If they are judgmental, respond with, ‘Can we stop now?’ or ‘I think I’m done here.’”
  7. Encourage Realism and Consistency: Make the AI’s responses more engaging and authentic.
    • Example: “Use casual Gen Z slang like ‘low-key,’ ‘vibe,’ or ‘no cap’ to sound like a typical teenager. Reflect Jordan’s emotions and background in every response.”
  8. Iterate and Test for Improvements: Continuously test and refine the prompt to ensure it delivers the desired outcomes.
    • Insight: Tuning the prompt for CRAFFT practice required multiple rounds of iterative testing with graduate-level nursing students to optimize the SimBot’s performance.

For more information, check out Prompt Engineering Guide by OpenAI.

Technologies Used

Potential Use Cases

The AI SimBot’s versatility makes it valuable for:

Contributers