Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Rule-Based AI Chatbot

A simple Rule-Based AI Chatbot built using Python. This chatbot responds to predefined user inputs using if-elif-else statements and demonstrates the basic concepts of Artificial Intelligence without using Machine Learning or external APIs.


📌 Project Overview

This project was developed to understand the fundamentals of AI by implementing a chatbot that follows predefined rules instead of learning from data.

The chatbot continuously interacts with users, recognizes various commands, and provides appropriate responses based on programmed conditions.


✨ Features

  • Interactive command-line chatbot
  • Continuous conversation using a while loop
  • Handles 50+ predefined user intents
  • Greeting and farewell commands
  • Study and programming tips
  • AI and Machine Learning related questions
  • Fun responses (jokes and facts)
  • User-friendly help menu
  • Handles uppercase/lowercase inputs
  • Ignores common punctuation marks
  • Beginner-friendly code structure

🛠️ Technologies Used

  • Python 3
  • VS Code
  • Git
  • GitHub

📂 Project Structure

Rule-Based-AI-Chatbot/
│
├── assets/
│
├── chatbot.py
├── chatbot_v2.py
├── README.md
├── requirements.txt
└── .gitignore

🚀 How to Run

Clone the repository

git clone <repository-url>

Open the project

cd Rule-Based-AI-Chatbot

Run the chatbot

py chatbot.py

💬 Supported Commands

Greetings

  • hello
  • hi
  • hey
  • good morning
  • good afternoon
  • good evening
  • good night

Personal Questions

  • who are you
  • what is your name
  • who created you
  • who is your owner
  • how old are you
  • where are you from

AI

  • what is ai
  • what is artificial intelligence
  • what is machine learning
  • what is deep learning

Programming

  • what is python
  • what is java
  • what is c++
  • what is javascript
  • what is html
  • what is css
  • what is react

Study

  • study tips
  • programming tips
  • coding tips
  • exam tips

Motivation

  • motivate me
  • quote

Fun

  • tell me a joke
  • tell me another joke
  • fun fact

General

  • weather
  • time
  • date
  • favorite color
  • favorite programming language
  • favorite food
  • favorite movie

Exit

  • bye
  • goodbye
  • exit
  • quit
  • see you

🖥️ Sample Output

=============================================================
🤖 Welcome to the Rule-Based AI Chatbot
=============================================================

You: hello

Bot: Hello! How can I help you today?

You: what is python

Bot: Python is a beginner-friendly programming language used
for AI, web development, automation, and data science.

You: tell me a joke

Bot: Why do programmers prefer dark mode?
Bot: Because light attracts bugs!

You: bye

Bot: Thank you for chatting with me!
Bot: Goodbye! Have a wonderful day.

🎯 Learning Outcomes

This project demonstrates the following Python concepts:

  • Variables
  • User Input
  • Output Statements
  • Conditional Statements
  • if-elif-else
  • Infinite Loops
  • break
  • String Manipulation
  • Input Sanitization
  • Decision Making

🔮 Future Improvements

  • Dictionary-based chatbot
  • GUI using Tkinter
  • Voice-enabled chatbot
  • Natural Language Processing (NLP)
  • Machine Learning integration
  • API integration
  • Chat history
  • Database support

👨‍💻 Author

Hadeed Jalani

Computer Science Student

Python | AI | Machine Learning | Web Development


⭐ If you like this project

Give this repository a ⭐ on GitHub.

About

A simple Rule-Based AI Chatbot built in Python using if-elif-else logic and a dictionary-based implementation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages