An intelligent AI-powered chatbot for the Institution's Innovation Council (IIC) that provides instant answers about SOPs, rules, responsibilities, and compliance requirements. Built with RAG (Retrieval-Augmented Generation) architecture using LangChain, Pinecone, and Groq LLaMA 3.3.
- π€ AI-Powered Q&A - Get instant answers about IIC SOPs and compliance rules
- π Vector Search - RAG architecture with Pinecone for accurate document retrieval
- π¬ Streaming Responses - Real-time SSE streaming for smooth user experience
- π― Contextual Answers - Provides source documents for transparency
- π‘ Follow-up Questions - Suggests related questions based on context
- π JWT Authentication - Secure token-based authentication
- π₯ Role-Based Access - Administrator, Club Member, and Guest roles
- π‘οΈ Rate Limiting - Multi-tier protection (Chat, Login, Learn, API)
- π bcrypt Encryption - Secure password hashing
- π Analytics Dashboard - Track queries, ratings, and response times
- π§ /learn Command - Teach the bot new information dynamically
- π Query Insights - Top questions, user activity, and performance metrics
- π Dark/Light Mode - Fully customizable theme with persistence
- β Rating System - 5-star feedback on bot responses
- π Copy Responses - One-click clipboard copy
- β¨οΈ Keyboard Shortcuts - Ctrl+K (focus), Ctrl+L (clear chat)
- π± Responsive Design - Mobile-optimized UI
- Runtime: Node.js 25.2.1
- Framework: Express.js 5.2.1
- Database: MongoDB Atlas
- Vector DB: Pinecone
- AI/ML:
- Groq LLaMA 3.3 70B (LLM)
- HuggingFace BGE Embeddings
- LangChain
- Cache: Redis (optional fallback)
- Auth: JWT + bcryptjs
- Validation: express-validator
- Logging: Winston
- Framework: Next.js 16
- UI Library: React 19
- Language: TypeScript 5
- Styling: Tailwind CSS 4
- Theme: next-themes 0.4.3
- Backend Hosting: Render.com
- Frontend Hosting: Vercel
- CI/CD: Git push auto-deploy
- Node.js >= 18.0.0
- MongoDB Atlas account
- Pinecone account
- Groq API key
- HuggingFace API key
- Clone the repository
git clone https://github.com/harsh-pandhe/IIC-Bot.git
cd IIC-Bot/iic-bot-backend- Install dependencies
npm install- Create
.envfile
# Database
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/?appName=Cluster0
# AI Services
PINECONE_API_KEY=your_pinecone_key
PINECONE_INDEX_NAME=iic-compliance-docs
GROQ_API_KEY=your_groq_key
HF_API_KEY=your_huggingface_key
# Authentication
JWT_SECRET=your_jwt_secret_key
# Optional
REDIS_URL=redis://localhost:6379
FRONTEND_URL=http://localhost:3000
PORT=5000
NODE_ENV=production- Start the server
npm start
# or for development
npm run dev- Navigate to frontend
cd ../iic-bot-frontend- Install dependencies
npm install- Create
.env.localfile
NEXT_PUBLIC_API_URL=http://localhost:5000- Start development server
npm run dev- Build for production
npm run build
npm start- Push code to GitHub
- Create new Web Service on Render
- Connect GitHub repository
- Configure:
- Build Command:
npm install - Start Command:
npm start - Branch:
main - Root Directory:
iic-bot-backend
- Build Command:
- Add environment variables in Render dashboard
- Deploy!
- Push code to GitHub
- Import project on Vercel
- Configure:
- Framework Preset: Next.js
- Root Directory:
iic-bot-frontend - Build Command:
npm run build - Output Directory:
.next
- Add environment variables:
NEXT_PUBLIC_API_URL: Your Render backend URL
- Deploy automatically on git push
- Username:
admin - Password:
cb394a138eace8ade809d0b95924f468 - Permissions: Full access, Analytics, /learn command
- Username:
user - Password:
94a582b27d0fc2607d1f400773b4ffe8 - Permissions: Member SOPs access
β οΈ Security Note: Change these credentials in production!
Regular Chat
What are the duties of the Student President?
Admin /learn Command
/learn John Smith is the new Technical Head of IIC
- Ctrl+K (Cmd+K on Mac) - Focus input field
- Ctrl+L (Cmd+L on Mac) - Clear chat history
- Ctrl+Enter - Send message
POST /login
Body: { username, password }
Response: { token, user }
POST /chat/stream
Headers: { Authorization: Bearer <token> }
Body: { question, history?, sessionId? }
Response: SSE stream
GET /analytics
Headers: { Authorization: Bearer <token> }
Response: { totalQueries, avgRating, avgResponseTime, ... }
GET /health
Response: { status, timestamp, version }
| Endpoint | Limit | Window |
|---|---|---|
| Chat | 20 requests | 1 hour |
| Login | 5 requests | 15 minutes |
| /learn | 10 requests | 1 hour |
| API | 100 requests | 15 minutes |
IIC-Bot/
βββ iic-bot-backend/
β βββ config/ # Database, Redis, Logger configs
β βββ middleware/ # Auth, Rate limiting, Validation
β βββ models/ # MongoDB schemas
β βββ documents/ # SOPs and training documents
β βββ server.js # Main Express app
β βββ package.json
β
βββ iic-bot-frontend/
β βββ app/ # Next.js app directory
β β βββ page.tsx # Main chat interface
β β βββ layout.tsx # Root layout
β β βββ globals.css # Global styles
β βββ hooks/ # Custom React hooks
β βββ public/ # Static assets
β βββ package.json
β
βββ LICENSE # MIT License
βββ README.md # This file
- β JWT token authentication with 7-day expiry
- β bcrypt password hashing (10 rounds)
- β 4-tier rate limiting
- β CORS origin whitelist
- β Input validation on all endpoints
- β Trust proxy for accurate rate limiting
- β Secure MongoDB connection
- β Environment variable protection
Redis is optional. If you see "Redis error - falling back to no caching", the app will work fine without caching.
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install- Verify JWT_SECRET is set
- Check MongoDB connection string
- Ensure user accounts exist in database
This is a private project. For questions or issues, contact the repository owner.
MIT License - See LICENSE file for details
- Groq - Lightning-fast LLM inference
- Pinecone - Vector database for semantic search
- LangChain - RAG framework
- Vercel - Frontend hosting
- Render - Backend hosting
Built with β€οΈ by Harsh Pandhe
π Live Demo: https://iic-bot.vercel.app