A lightweight, offline-first chatbot built with Python and ReactJS
SmartBot is a lightweight chatbot solution that combines Python backend processing with a modern ReactJS frontend. Originally developed as a CLI tool, it has evolved into a web-based application that uses CSV-based Q&A logic, making it perfect for educational institutions, IT departments, and enterprise applications.
- 🔒 Offline-First: No external APIs required - works completely offline
- 📊 CSV-Based Knowledge: Easy-to-edit CSV files for questions and answers
- ⚡ Fast & Lightweight: Minimal resource requirements
- 🌐 Web Interface: Modern ReactJS frontend with responsive design
- ⏰ Time-Aware: Built-in time consciousness for contextual responses
- 🔧 Modular Architecture: Easy to extend and customize
- 💰 Zero Subscription Cost: No ongoing fees or API charges
- 🚀 Easy Deployment: Works on local machines and cloud platforms
- Frontend: ReactJS, JavaScript (JSX), CSS3
- Backend: Python, Flask
- Data Storage: CSV files
- Dependencies: Flask, csv, datetime, argparse
smartbot/
├── backend/
│ └── app.py # Flask backend server
├── frontend/
│ ├── public/ # Static assets
│ └── src/
│ ├── App.js # Main React component
│ └── App.css # Styling
├── templates/ # HTML templates
└── questions.csv # Q&A knowledge base
- Python 3.8 or higher
- Node.js 14 or higher
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/yourusername/smartbot.git cd smartbot -
Set up the backend
cd backend pip install flask python app.py -
Set up the frontend
cd ../frontend npm install npm start -
Access the application Open your browser and navigate to
http://localhost:3000
Problem: Students and staff repeatedly ask the same questions. Solution: SmartBot serves as a 24/7 automated FAQ assistant.
Problem: High volume of repetitive queries (e.g., password resets). Solution: CSV-based knowledge database for instant answers.
Problem: Frequent requests for code syntax/API references. Solution: Quick-access coding assistant for common queries.
Edit the questions.csv file to add new Q&A pairs:
Question,Answer,Category
"How to reset password?","Contact IT support at ext. 1234","Support"
"What are office hours?","Monday-Friday, 9 AM - 5 PM","General"Modify the backend logic in app.py to customize how responses are processed and returned.
| Feature | SmartBot CLI | Generic Chatbots |
|---|---|---|
| Offline Usage | ✅ Yes | ❌ No (Cloud-dependent) |
| CSV Customization | ✅ Yes | ❌ No (Hard-coded) |
| Time Awareness | ✅ Yes | ❌ No |
| Subscription Free | ✅ Yes | ❌ Paid plans |
| Easy Hosting | ✅ Local & Cloud | ❌ Provider-dependent |
- Natural Language Processing (NLP) integration
- Multi-language support
- RESTful API endpoints
- Advanced analytics and reporting
- Machine learning-based response improvement
- Integration with popular messaging platforms
We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or need help with setup, please open an issue or contact our team.
"Ask SmartBot anything – get structured answers instantly!" 🚀
If this project helped you, please consider giving it a star on GitHub!