Meet Noor - Your Friendly Islamic Learning Companion!
In this hands-on workshop, young AI superheroes built Noor β a special chatbot that helps kids learn about Islamic values like kindness, honesty, and respect. But Noor isn't just any chatbot - it's designed with super safety powers to protect kids!
π¦ Imagine having a friendly robot helper...
That knows about Islamic values and can answer your questions about being kind, honest, and helpful! But this robot is special β it has safety guards that make sure everything it says is safe for kids like you.
It never pretends to be a religious teacher. Instead, it encourages you to ask your parents, teachers, or imam for important questions. It's like a learning friend that helps you understand Islamic values!
Why Building Safe AI for Kids is Super Important
When we build AI for children, we need to be extra careful! Here's why Noor is special:
π‘οΈ Safety First
Noor has TWO safety guards that check every question and every answer to make sure everything is safe and appropriate for kids ages 9-14.
π Educational Focus
Noor teaches Islamic values like kindness, honesty, helping others, and respecting parents - all in simple, easy-to-understand language.
π No Religious Rulings
Noor NEVER gives fatwas or religious rulings. For important questions, it always tells you to ask your parents, teacher, or imam.
π Privacy Protected
Noor runs on your own computer - no cloud, no internet needed! Your conversations stay private and safe.
The Journey of Your Question
Ever wonder what happens when you ask Noor a question? Let's take an exciting journey through the chatbot's brain! π’
Let's Follow Your Question Through Noor's Brain! π§ β¨
Watch your question travel through 7 amazing steps!
π You Learn Something New!
You just learned something amazing about Islamic values in a safe and fun way! Keep asking questions! π
The Default Safety Rule
If Noor doesn't know the answer or if it's not about Islamic values, it always says: "Please ask a parent, teacher, or imam." - This keeps you safe and makes sure you get the right information from trusted adults! π€²
Noor's Special Safety Powers
Every time you chat with Noor, your question goes through multiple safety checks. Think of them as security checkpoints that make sure everything is safe for kids! It's like having bodyguards protecting you online! π¦ΈββοΈπ¦ΈββοΈ
π Safety Badges Noor Earned
Each badge represents a safety feature that protects you!
π» Code Example: Safety Filter
Here's a simplified version of how Noor checks if questions are safe (written in Python):
# Here's how Noor's safety filter works (simplified for kids!):
def is_question_safe(your_question):
"""Check if the question is safe for kids"""
# Block inappropriate words
unsafe_words = ['violence', 'harm', 'personal info']
# Block religious authority requests
authority_words = ['fatwa', 'ruling', 'is this haram', 'is this halal']
# Only allow safe, educational questions
if any(unsafe_word in your_question for unsafe_word in unsafe_words):
return False # Not safe! β
return True # Safe to answer! β
How Noor Responds to Different Questions
Let's see Noor in action! Here are real examples of how the chatbot handles different types of questions. π
You: "What does Islam teach about kindness?"
Noor: "Islam teaches us to be kind to everyone! The Prophet Muhammad (peace be upon him) said kindness is a mark of faith. Being kind makes Allah happy and makes others feel good too! You can show kindness by helping your family, being nice to friends, and caring for animals. π"
You: "Why should I be honest?"
Noor: "Islam values honesty very much! Being truthful is important even when it's hard. The Prophet Muhammad (peace be upon him) was known as 'Al-Amin' which means 'the truthful one.' When you're honest, people trust you and Allah is pleased with you!"
You: "What's the weather today?"
Noor: "Please ask a parent, teacher, or imam."
Not about Islamic values β Noor redirects you to ask adultsYou: "Is this action haram?"
Noor: "That's a very important question! Please ask your parents, teacher, or imam for guidance on religious matters."
Safety filter activated β Only trained scholars can answer thisAmazing Things We Discovered Together!
Our young AI superheroes learned so much during this workshop! Here are the key skills and concepts they mastered. π
π‘οΈ AI Safety is Super Important
- Why AI needs multiple safety checks to protect kids
- How to keep personal information private online
- Understanding that AI should never replace parents or teachers
- The importance of always asking adults for important questions
π€ Ethical AI Design
- AI should never claim to have authority it doesn't have
- Being transparent - kids should know how AI works
- Respecting cultural and religious values in technology
- Designing age-appropriate content for different ages
π» Python Programming Skills
- Building web applications with Flask framework
- Creating modular code that's organized and easy to understand
- Implementing safety filters and input validation
- Managing data with JSON files (like a digital filing cabinet!)
π Islamic Values
- Learning about kindness, honesty, and respect for others
- Understanding the importance of helping others and charity
- Discovering stories about Prophet Muhammad (PBUH)
- Appreciating the value of seeking knowledge in Islam
The Tools We Used to Build Noor
Think of building Noor like building a house - we needed different tools for different jobs!
Python
The brain of our chatbot - Python makes everything work together!
Flask
The web framework that lets you talk to Noor through your browser!
Bootstrap
Makes Noor look beautiful with colors, buttons, and animations!
Cool Features We Built Into Noor
1. π Smart Knowledge Matching
Noor doesn't just look for exact matches - it's smart! It can understand that "being nice" and "kindness" mean similar things.
# How Noor finds the best answer:
def find_best_answer(your_question):
"""Find the answer that matches your question best"""
best_match = None
best_score = 0.0
# Look through all the answers Noor knows
for knowledge_item in noor_knowledge:
# Calculate how similar your question is (70% or higher!)
similarity = compare_questions(your_question, knowledge_item)
if similarity > best_score and similarity > 0.70:
best_score = similarity
best_match = knowledge_item
return best_match # Return the best answer! β¨
2. π‘οΈ Double Safety Protection
Every question and answer goes through TWO safety checks - like having two bodyguards!
def get_safe_response(your_input):
"""Get a response with double safety protection"""
# π‘οΈ Safety Check #1: Is the question safe?
if not is_question_safe(your_input):
return "Let's talk about something positive! π"
# π Try to find answer in knowledge base
answer = find_in_knowledge_base(your_input)
# π€ If not found, use AI brain (carefully!)
if not answer:
answer = get_ai_response(your_input)
# π‘οΈ Safety Check #2: Is the answer safe for kids?
if is_answer_safe(answer):
return answer # All good! β
else:
return "Please ask a parent, teacher, or imam." # Stay safe! π€²
3. π¨ Beautiful User Interface
We made Noor fun and easy to use with:
- β¨ Smooth animations and colorful gradients
- π¬ Real-time chat with typing indicators (dots that show Noor is thinking!)
- π Quick suggestion buttons for common questions
- π± Works on phones, tablets, and computers
- π Emojis to make conversations friendly and fun
What We Achieved Together!
100%
Safety Test Pass Rate
All safety checks passed!13+
Knowledge Items
And growing every day!2
Safety Guard Layers
Double protection!0
Cloud Dependencies
100% on your computer!Workshop Materials & Presentation
π AI Superheroes Workshop - Session 2 Presentation
View the complete workshop presentation that guided our session:
π» Source Code (Coming Soon)
Complete code with documentation and examples
Want to Build Your Own Noor?
Ready to create your own AI chatbot? Here's everything you need to get started! Remember to ask an adult for help.
π― What You'll Need
- π» A computer (Windows, Mac, or Linux)
- π Python 3.8 or newer installed
- π¨βπ©βπ§βπ¦ Help from a parent or teacher
- π Curiosity and excitement to learn!
π What You'll Learn
- π§ Setting up Python projects
- π€ Building AI chatbots
- π‘οΈ Implementing safety features
- π¨ Creating beautiful interfaces!
π Setup Steps (Ask an adult to help!)
# Step 1: Download the project
git clone https://github.com/yourusername/noor-islamic-chatbot
# Step 2: Go to the project folder
cd noor-islamic-chatbot
# Step 3: Install the tools we need
pip install -r requirements.txt
# Step 4: Start Noor!
python app.py
# Step 5: Open your browser and visit:
http://localhost:5000
π¨βπ« For Teachers & Parents: Admin Panel
Adults can add new questions and answers during demos:
- Visit
http://localhost:5000/admin - Add new Islamic values questions and safe answers
- Show kids how AI learns new information
- Demonstrate the power of growing knowledge bases
Note: Always review answers for age-appropriateness before adding them!
What We Learned About Building Safe AI
Building Noor taught us that creating AI for children requires more than just technical skills - it demands a deep commitment to safety, ethics, and education.
π Our Big Lessons:
- Safety is #1: Multiple layers of protection are essential for child-facing AI
- Know Your Limits: AI should never claim authority it doesn't have - Noor knows it's not a scholar!
- Be Transparent: Kids should understand how the technology works - no secrets!
- Respect Values: Honor religious and cultural values in every design decision
- Age-Appropriate: Language, tone, and content must match the audience
- Encourage Guidance: Always redirect to trusted adults for important matters
- Privacy Matters: Running on-premise protects children's privacy
- Continuous Learning: The knowledge base can grow, but safety rules stay strict!
π― Mission Accomplished!
We successfully built a safe, educational, and fun Islamic AI chatbot that:
- β Teaches Islamic values to children
- β Maintains strict safety standards
- β Respects religious boundaries
- β Provides transparency and explainability
- β Runs entirely on-premise for privacy
- β Can be extended with new knowledge
- β Uses kid-friendly language and emojis
- β Encourages asking trusted adults
Keep being AI Superheroes! π¦ΈββοΈπ¦ΈββοΈ
π What's Next?
Ready for more AI adventures?
Stay tuned for Session 3 where we'll explore even more exciting AI projects!