Challenge: Build a Secure AI Chatbot

Implement a secure and personalized chatbot with dynamic responses and custom training

We'll cover the following

You’ve spent the last few lessons learning how to create and train chatbots, understanding their building blocks, and experimenting with conversational AI. Now, it’s time to roll up your sleeves and put theory into practice. This challenge is not just about coding—it’s about thinking like a problem-solver. By tackling this activity, you’ll deepen your understanding of chatbot logic, personalization, and security.

Why is this challenge important? Imagine this as your final practical test before leveling up. Hands-on experience is where real learning happens. You’ll move beyond following instructions to designing and implementing a solution yourself, just like you would in the real world. Plus, it’s a fun way to create a bot that feels personal and useful!

Scenario

You’ve just purchased Jordan, the smartest AI assistant in the world, to manage your house. But before it becomes a full-fledged member of your household, it needs to be set up with both security protocols and personalized training data. Your task is to ensure that only trusted people can interact with Jordan and then train Jordan with personal information to make it truly yours.

To ensure Jordan isn’t accessible to just anyone, you’ll program a security check. Based on who tries to access Jordan, it will respond differently:

  1. If it’s Mark (the house owner):
    Jordan says:
    "Welcome, Mark. Happy to have you at home."
    and continues running.

  2. If it’s Jane (a trusted friend):
    Jordan says:
    "Mark is out right now, but you are welcome to the house."
    and continues running.

  3. For anyone else:
    Jordan firmly denies access:
    "Your access is denied here."
    and ends the program using the exit() command.

Security is foundational in AI systems. This task introduces conditional logic, where the bot behaves differently based on input. It’s an essential skill for making chatbots useful in real-world scenarios like access control. Once you’ve passed the security check, it’s time to teach Jordan a little about yourself. You’ll train it with your personal information so it can answer specific questions about you.

  1. Where was I born?
    "You were born in __________."

  2. What is my favorite book?
    "That is easy. Your favorite book is __________."

  3. What is my favorite movie?
    "You have watched __________ more times than I can count."

  4. What is my favorite sport?
    "You have always loved __________."

Follow the example below to structure your training data:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy