This project is a Simple Rule-Based Chatbot developed using Python. The chatbot uses pattern matching and predefined rules to respond to user queries. It supports greetings, help requests, small talk, and answers domain-specific questions from a knowledge base. The chatbot also logs conversation history for future reference.
- Greeting Intent Recognition
- Help Intent Support
- Small Talk Responses
- Knowledge Base Question Answering
- Interactive Console-Based Chat
- Conversation History Logging
- Simple and Easy-to-Understand Python Implementation
- Python 3.x
- JSON
- File Handling
- Pattern Matching
- VS Code
SimpleRuleBasedChatbot/
│
├── chatbot.py
├── knowledge_base.json
├── README.md
├── .gitignore
└── chat_history.txt
The chatbot retrieves answers from a JSON-based knowledge base.
Example:
{
"python": "Python is a high-level programming language.",
"ai": "Artificial Intelligence enables machines to simulate human intelligence.",
"machine learning": "Machine Learning is a subset of AI that learns from data.",
"chatbot": "A chatbot is a software application that simulates conversation."
}git clone https://github.com/your-username/simple-rule-based-chatbot.gitcd simple-rule-based-chatbotpython chatbot.py=== Rule Based Chatbot ===
Type 'bye' to exit.
You: hello
Bot: Hi there!
You: what is python
Bot: Python is a high-level programming language.
You: how are you
Bot: I'm doing well. Thanks for asking!
You: bye
Bot: Goodbye!
All conversations are automatically stored in the chat_history.txt file with timestamps.
Example:
2026-06-14 10:15:21 | User: hello | Bot: Hi there!
2026-06-14 10:15:35 | User: what is python | Bot: Python is a high-level programming language.
- GUI Interface using Tkinter
- Database Integration
- NLP-Based Intent Recognition
- Voice-Based Interaction
- Web-Based Chatbot Deployment
Through this project, the following concepts were explored:
- Rule-Based Conversational Systems
- Pattern Matching Techniques
- Python File Handling
- JSON Data Management
- Interactive Console Applications
- Conversation Logging
Konni Divya
Internship Project – Simple Rule-Based Chatbot
This project is created for educational and internship learning purposes.
