Smart India Hackathon 2025 Project
Multilingual AI-powered campus chatbot for JECRC University
- π Multilingual Support: Hindi, English, and regional languages
- π± Responsive Design: Works perfectly on mobile and desktop
- π€ Smart Intent Recognition: Understands student queries naturally
- β‘ Real-time Responses: Instant answers to common questions
- π¨ Beautiful UI: Modern, accessible design with animations
- π§ Easy Maintenance: Simple JSON-based knowledge base
- π Analytics Ready: Built-in interaction logging
- βΏ Accessible: Screen reader friendly with ARIA labels
ID: 25104
Title: Language Agnostic Chatbot
Organization: Government of Rajasthan - Directorate of Technical Education (DTE)
Campus offices handle hundreds of repetitive queries daily. This chatbot:
- β Reduces administrative workload
- β Provides 24/7 student support
- β Breaks language barriers
- β Integrates with existing systems
- β Maintains conversation logs for improvement
- Python 3.11+ installed
- Git installed
- Modern web browser
- Clone the repository
git clone https://github.com/yourusername/campus-chatbot.git
cd campus-chatbot- Create virtual environment
python -m venv chatbot_env
# Windows
chatbot_env\Scripts\activate
# macOS/Linux
source chatbot_env/bin/activate- Install dependencies
pip install -r requirements.txt- Run the application
python app.py- Open browser
http://localhost:5000
feesβ Fee informationΰ€«ΰ₯ΰ€Έβ Hindi fee informationadmissionβ Admission detailshostelβ Hostel informationplacementβ Placement statistics
python -m pytest tests/ -v- Install Heroku CLI
# Download from: https://devcenter.heroku.com/articles/heroku-cli- Deploy to Heroku
# Login to Heroku
heroku login
# Create app
heroku create jecrc-campus-assistant
# Deploy
git add .
git commit -m "Deploy to Heroku"
git push heroku main
# Open app
heroku open- Connect to Railway
# Install Railway CLI
npm install -g @railway/cli
# Login and deploy
railway login
railway create
railway up- Fork this repository
- Connect to Render.com
- Create new Web Service
- Connect your GitHub repo
- Deploy automatically
# Run on local network (accessible to all devices on WiFi)
python app.py
# Access from other devices using your IP:
# http://YOUR_IP_ADDRESS:5000Send a message to the chatbot
Request:
{
"message": "fees kya hai?"
}Response:
{
"response": "π° Fee Information:\nβ’ B.Tech Fee: βΉ1,25,000/year...",
"intent": "fees",
"language": "hi",
"status": "success"
}Check server health
Response:
{
"status": "healthy",
"intents": 12,
"version": "1.0.0"
}Edit knowledge_base.json:
{
"new_topic": {
"keywords": ["keyword1", "keyword2", "ΰ€Ήΰ€Ώΰ€ΰ€¦ΰ₯_keyword"],
"responses": {
"hi": "Hindi response here",
"en": "English response here"
}
}
}- Colors: Edit
static/css/styles.css - Content: Edit
templates/index.html - Behavior: Edit
static/js/script.js
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Flask App β β Knowledge β
β (HTML/CSS/JS) βββββΊβ (Python) βββββΊβ Base (JSON) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β User Interfaceβ β Intent Detection β β Responses β
β β’ Chat Widget β β β’ Language Detectβ β β’ Hindi β
β β’ Animations β β β’ Keyword Match β β β’ English β
β β’ Responsive β β β’ Context Handle β β β’ Multilingualβ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
"Campus offices are overwhelmed with repetitive queries. Students struggle with language barriers. Our solution provides 24/7 multilingual support."
- Show beautiful UI loading
- Demonstrate English query: "fees"
- Demonstrate Hindi query: "ΰ€«ΰ₯ΰ€Έ"
- Show language switching
- Test mobile responsiveness
- Show admin panel (knowledge base editing)
- "Built with Flask, modern JavaScript"
- "JSON-based knowledge system for easy updates"
- "Production-ready with proper error handling"
- "Deployable in minutes"
- 80% reduction in repetitive queries to admin staff
- 24/7 availability for student support
- Multi-language accessibility for diverse student body
- Instant responses instead of long queues
- Easy maintenance by student volunteers
- Query resolution rate: >90%
- Response time: <2 seconds
- User satisfaction: >4.5/5
- Admin time saved: >20 hours/week
- New Intent Recognition
# Add to detect_intent() function in app.py
if 'new_keyword' in message_lower:
return 'new_intent'- New UI Components
/* Add to static/css/styles.css */
.new-component {
/* Your styles here */
}- New Interactions
// Add to static/js/script.js
function newFeature() {
// Your code here
}- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
JECRC Foundation - SIH 2025 Team
- Team Leader: [Your Name]
- Frontend Developer: [Name]
- Backend Developer: [Name]
- UI/UX Designer: [Name]
- Data Analyst: [Name]
- Tester: [Name]
This project is licensed under the MIT License - see the LICENSE file for details.
Q: Chatbot not responding?
A: Check if server is running and visit http://localhost:5000/health
Q: Hindi text not displaying properly?
A: Ensure UTF-8 encoding in your browser
Q: Mobile layout issues?
A: Clear browser cache and refresh
Q: Deployment failed?
A: Check all files are committed and requirements.txt is complete
- π§ Email: [your-email@jecrc.edu]
- π¬ Discord: [Your Discord Server]
- π Issues: GitHub Issues
- SIH 2025 for the opportunity
- JECRC University for support
- Government of Rajasthan for the problem statement
- Flask Community for the excellent framework
- Open Source Contributors for inspiration
Made with β€οΈ for Smart India Hackathon 2025
Empowering students through technology
Windows Setup Commands Step 1: Open Command Prompt or PowerShell cmd# Open Command Prompt as Administrator (recommended)
cd C:\your-projects-folder Step 2: Create Project Directory cmdmkdir campus-chatbot cd campus-chatbot Step 3: Create Virtual Environment cmdpython -m venv venv Step 4: Activate Virtual Environment cmd# For Command Prompt venv\Scripts\activate
venv\Scripts\Activate.ps1 Step 5: Upgrade pip cmdpython -m pip install --upgrade pip Step 6: Install All Dependencies cmdpip install flask==2.3.3 pip install flask-cors==4.0.0 pip install chromadb==0.4.15 pip install sentence-transformers==2.2.2 pip install transformers==4.35.0 pip install torch==2.1.0 pip install PyPDF2==3.0.1 pip install pandas==2.1.3 pip install openpyxl==3.1.2 pip install python-docx==1.1.0 pip install nltk==3.8.1 pip install scikit-learn==1.3.2 pip install numpy==1.24.4 Step 7: Create Project Files cmd# Create main directories mkdir documents mkdir templates mkdir static
echo. > smart_rag_app.py
echo. > reset_database.py
pip freeze > requirements.txt
macOS/Linux Setup Commands Step 1: Open Terminal bash# Navigate to your desired project directory cd ~/your-projects-folder Step 2: Create Project Directory bashmkdir campus-chatbot cd campus-chatbot Step 3: Create Virtual Environment bashpython3 -m venv venv Step 4: Activate Virtual Environment bashsource venv/bin/activate Step 5: Upgrade pip bashpython -m pip install --upgrade pip Step 6: Install All Dependencies bashpip install flask==2.3.3 pip install flask-cors==4.0.0 pip install chromadb==0.4.15 pip install sentence-transformers==2.2.2 pip install transformers==4.35.0 pip install torch==2.1.0 pip install PyPDF2==3.0.1 pip install pandas==2.1.3 pip install openpyxl==3.1.2 pip install python-docx==1.1.0 pip install nltk==3.8.1 pip install scikit-learn==1.3.2 pip install numpy==1.24.4 Step 7: Create Project Structure bash# Create directories mkdir documents templates static
touch smart_rag_app.py touch reset_database.py
pip freeze > requirements.txt
Setting Up the Code Step 8: Add Your Code Files cmd# Copy your smart_rag_app.py content into the file
notepad smart_rag_app.py
open -a TextEdit smart_rag_app.py
nano smart_rag_app.py Step 9: Create Reset Database Script Create reset_database.py with this content: cmd# For Windows notepad reset_database.py Add this code: pythonimport shutil import os
def reset_rag_system(): if os.path.exists("./advanced_jecrc_vectordb"): shutil.rmtree("./advanced_jecrc_vectordb") print("β Removed vector database")
if os.path.exists("document_cache.pkl"):
os.remove("document_cache.pkl")
print("β
Removed document cache")
print("π Database reset complete!")
if name == "main": reset_rag_system() Step 10: Add Your Documents cmd# Copy your PDF and Excel files to the documents folder
copy "C:\path\to\your\documents*" documents\
cp /path/to/your/documents/* documents/
First Run Commands Step 11: Initial Setup Run cmd# Make sure virtual environment is activated
venv\Scripts\activate
source venv/bin/activate
python smart_rag_app.py You should see output like: π Initializing Advanced Smart RAG System... π₯ Loading advanced embedding model... π§ Loading free QA model... β QA model loaded successfully π Loading enhanced JECRC documents... β Successfully loaded documents
- Running on http://127.0.0.1:5000 Step 12: Test the Application Open your browser and go to: http://localhost:5000
Troubleshooting Commands If Models Don't Download: cmd# Check internet connection ping google.com
pip cache purge
pip uninstall sentence-transformers pip install sentence-transformers If Database Issues Occur: cmd# Stop the application (Ctrl+C)
python reset_database.py
python smart_rag_app.py If Import Errors: cmd# Check what's installed pip list
pip uninstall package-name pip install package-name If Port Already in Use: cmd# Windows - Find process using port 5000 netstat -ano | findstr :5000
taskkill /PID 1234 /F
lsof -ti:5000 | xargs kill -9
Daily Operation Commands Starting the Application: cmd# Navigate to project cd campus-chatbot
venv\Scripts\activate
source venv/bin/activate
python smart_rag_app.py Stopping the Application: cmd# Press Ctrl+C in the terminal running the app Adding New Documents: cmd# Copy new documents to folder
copy "C:\new\documents*" documents\
python smart_rag_app.py Updating Dependencies: cmdpip install --upgrade flask chromadb sentence-transformers
Complete Setup Verification Run these commands to verify everything works: cmd# 1. Check Python version python --version
python -c "import flask, chromadb, sentence_transformers; print('All imports successful')"
dir documents
ls -la documents/
python smart_rag_app.py Expected Final Output: π Found X documents to process... β π Loaded PDF: CURRENT_Syllabus-CSE-5-6.pdf (12 chunks, Priority: high) β π Loaded Excel: CURRENT_2023-2024.xlsx (6 chunks, Priority: high) β Successfully loaded X documents from Y files
- Serving Flask app 'smart_rag_app'
- Running on http://127.0.0.1:5000