A simple yet interactive rule-based chatbot built with Python that simulates basic human conversations using predefined responses and demonstrates core programming concepts such as functions, loops, dictionaries, and conditional statements.
The Basic Chatbot is a command-line conversational assistant developed as part of the CodeAlpha Python Programming Internship.
The chatbot interacts with users by recognizing predefined inputs and providing appropriate responses. It demonstrates the fundamentals of chatbot development while focusing on clean code, modular design, and user-friendly interaction.
This project showcases practical implementation of:
- Functions
- Dictionaries
- Conditional Statements
- Loops
- User Input Handling
- Rule-Based Conversation Logic
✅ Interactive command-line chatbot
✅ Predefined intelligent responses
✅ User-friendly conversation flow
✅ Help command support
✅ Graceful exit functionality
✅ Input normalization
✅ Clean and modular code structure
| Technology | Purpose |
|---|---|
| Python | Core Programming Language |
| Functions | Modular Programming |
| Dictionary | Response Mapping |
| Loops | Continuous Conversation |
| Conditional Statements | Decision Making |
| CLI | User Interaction |
CodeAlpha_Basic_Chatbot/
│
├── basic_chatbot.py
├── README.md
├── LICENSE
├── requirements.txt
├── .gitignore
│
├── screenshots/
│ ├── code.png
│ ├── welcome.png
│ ├── conversation.png
│ └── exit.png
│
└── assets/
└── demo.gif
git clone https://github.com/samyakjainx/CodeAlpha_Basic_Chatbot.gitcd CodeAlpha_Basic_Chatbotpython basic_chatbot.pyStart the chatbot:
==============================================
WELCOME TO ALPHABOT
Type 'bye' or 'goodbye' to exit
==============================================
Try interacting with the chatbot using:
hello
hi
how are you
what is your name
help
bye
==================================================
WELCOME TO ALPHABOT
Type 'bye' or 'goodbye' to exit the chat.
==================================================
You: hello
AlphaBot:
Hi there! How can I help you today?
--------------------------------------------------
You: what is your name
AlphaBot:
I am AlphaBot, your friendly neighborhood rule-based assistant.
--------------------------------------------------
You: how are you
AlphaBot:
I'm just a bundle of code, but I'm running perfectly! How are you?
--------------------------------------------------
You: help
AlphaBot:
I can chat with you! Try saying 'hello', 'how are you', or 'what is your name'.
--------------------------------------------------
You: bye
AlphaBot:
Goodbye! Have a wonderful day ahead!
==================================================
Chat session ended.
screenshots/code.png
screenshots/welcome.png
screenshots/conversation.png
screenshots/exit.png
assets/demo.gif
This project helped in understanding:
-
Python Functions
-
Dictionary Data Structures
-
Rule-Based Chatbot Logic
-
Conditional Statements
-
Loops
-
User Input Processing
-
Command-Line Application Development
-
Modular Programming
Some exciting features that can be added in future versions:
-
🤖 AI-powered conversations
-
🎤 Voice input and speech recognition
-
🌍 Multi-language support
-
💾 Chat history storage
-
😊 Sentiment analysis
-
🧠 Context-aware responses
-
🌐 Web interface using Flask
-
📱 GUI version using Tkinter
Contributions are welcome!
If you'd like to improve this project:
-
Fork the repository
-
Create a new branch
-
Make your changes
-
Commit your changes
-
Open a Pull Request
AI & ML Enthusiast | Python Developer | Open Source Learner
GitHub: https://github.com/samyakjainx/
LinkedIn: https://www.linkedin.com/in/samyakjain-ai/
This project is licensed under the MIT License.
You are free to use, modify, and distribute this project for educational purposes.
If you found this project helpful, consider giving it a ⭐ Star on GitHub.
It motivates me to build and share more open-source projects.
Made with ❤️ using Python