GrokBot is a rule-based chatbot built using Python that runs entirely in the terminal. It responds intelligently to user inputs such as greetings, time/date queries, questions about Python, mock weather inquiries, and more โ offering a simple yet effective conversational experience.
To demonstrate a functional, lightweight chatbot using pure Python โ ideal for learning basic NLP techniques, regex-based intent detection, and terminal interactivity without relying on AI APIs.
- โ Regex-based pattern recognition
- โ Friendly responses to greetings and farewells
- โ
Date and time replies using Pythonโs
datetime - โ Fun mock weather responses for any city
- โ Answers general Python-related questions
- โ Fallback responses for unrecognized input
- โ Clean exit and error handling
- Python 3.6+
reโ for regex-based intent matchingrandomโ for varied responsesdatetimeโ for current date/timesysโ for version checking and clean exits
pip install re random datetime sys
git clone https://github.com/shitanshu15/GrokBot.git
cd GrokBot
python GrokBot.py.py
โ Make sure you're using Python 3.6 or higher โ the script checks this automatically.
โ hello
โ bye
โ what is Python?
โ tell me the time
โ whatโs the weather in Mumbai?
โ who are you?
โ can you dance?
Starting GrokBot...
Welcome to GrokBot! Type 'exit' or 'quit' to stop.
Current time: 14:12:56 on 2025-07-18
You: hello
GrokBot: Hello! How can I assist you today?
You: what is python?
GrokBot: Python is a versatile programming language used for web development, data science, and more!
You: what's the weather in Delhi?
GrokBot: Weather info isnโt available, but imagine a nice breeze in Delhi!
You: bye
GrokBot: Goodbye! Thanks for chatting!
This project is licensed under the MIT License โ feel free to use, modify, and share it with attribution.
Shitanshu Poreddiwar
๐ Python Developer Intern @Elite Tech
๐ GitHub: https://github.com/shitanshu15