Unibot University Chatbot System
    ð Overview UniBot is an intelligent, AI-powered ch
About the Project
ð Overview
UniBot is an intelligent, AI-powered chatbot system designed to provide real-time, accurate, and context-aware assistance for university-related queries. Built using Meta's LLaMA model with Retrieval-Augmented Generation (RAG) and structured function calling, UniBot addresses the limitations of traditional chatbots by offering:
- High Accuracy: RAG-enhanced responses grounded in official university documents
- Low Latency: Ultra-fast inference powered by Groq hardware acceleration
- Dynamic Information Retrieval: Real-time access to course catalogs, faculty directories, and administrative data
- Contextual Understanding: Multi-turn conversation support with memory retention
- Extensible Architecture: Modular design for easy integration of new services
⨠Key Features
ð Academic Support
- Course Information: Detailed course descriptions, prerequisites, credits, and schedules
- Faculty Lookup: Find professors by name or department with contact information and office hours
- Subject Search: Browse courses by department with comprehensive details
ð° Administrative Assistance
- Fee Information: Tuition costs, additional fees, and payment plan details
- Policy Search: RAG-powered semantic search across university policies
- FAQ System: Quick answers to common student questions
ð¤ Advanced AI Capabilities
- Function Calling: Structured tool execution for precise data retrieval
- RAG Pipeline: Document-grounded responses to prevent hallucinations
- Hybrid Fallback: Automatic switching between retrieval and tool-based responses
- Multi-turn Conversations: Contextual memory for natural dialogue flow
ð¨ User Experience
- Dark/Light Mode: Professional theme toggle for comfortable viewing
- Responsive Design: Optimized for desktop and mobile devices
- Interactive Chat Interface: Real-time responses with visual feedback
- Quick Actions: Sidebar buttons for common queries
ðï¸ System Architecture
âââââââââââââââââââ
â User Interface â (Streamlit)
ââââââââââ¬âââââââââ
â
ââââââ¼ââââââ
â Query â
â Parser â
ââââââ¬ââââââ
â
ââââââ¼âââââââââââ
â Tool Resolver â
âââââ¬ââââââââ¬ââââ
â â
ââââââ¼ââââ âââ¼âââââââââ
âFunctionâ â RAG â
âCalling â â Pipeline â
ââââââ¬ââââ âââ¬âââââââââ
â â
âââââ¼ââââââââ¼ââââ
â LLaMA Model â (Groq-accelerated)
â Generator â
âââââââââ¬ââââââââ
â
âââââââââ¼âââââââââ
â Response â
â Formatter â
ââââââââââââââââââ
ð Installation
Prerequisites
- Python 3.10 or higher
- Virtual environment (recommended)
- Groq API key (for LLaMA access)
Setup Instructions
-
Clone the repository
git clone <repository-url> cd chatbot -
Create and activate virtual environment
# Windows python -m venv venv .\venv\Scripts\activate # Linux/Mac python3 -m venv venv source venv/bin/activate -
Install dependencies
pip install -r requirements.txt -
Set up environment variables (Optional)
# Create .env file echo "GROQ_API_KEY=your_api_key_here" > .envOr set as environment variable:
# Windows set GROQ_API_KEY=your_api_key_here # Linux/Mac export GROQ_API_KEY=your_api_key_here -
Run the application
streamlit run app.py -
Access the chatbot
- Open your browser and navigate to
http://localhost:8501
- Open your browser and navigate to
ð¦ Technology Stack
| Component | Technology | Purpose | |-----------|-----------|---------| | LLM | Meta LLaMA 3.1 (8B) | Natural language understanding and generation | | Acceleration | Groq Hardware | Ultra-low latency inference (~0.42s response time) | | Framework | LangChain | Agent orchestration and tool integration | | Embeddings | MiniLM-L6-v2 | Semantic document encoding for RAG | | Vector Store | FAISS | Fast similarity search for document retrieval | | UI | Streamlit | Interactive web interface | | Language | Python 3.10+ | Core implementation |
ð Performance Metrics
Based on evaluation with 10 participants (students and staff):
| Metric | Result | |--------|--------| | Response Accuracy | 92% (with RAG) vs 78% (closed-book) | | Average Latency | 0.42s (Groq) vs 1.35s (standard hardware) | | User Satisfaction | 90% found system easy to use | | Contextual Relevance | 80% of responses rated as helpful | | Hallucination Reduction | 25% improvement with RAG |
ð¯ Usage Examples
Example 1: Course Information
User: "What are the prerequisites for CS201?"
UniBot: "CS201 - Data Structures and Algorithms requires CS101 as a prerequisite.
It's a 4-credit course offered in both Fall and Spring semesters."
Example 2: Faculty Lookup
User: "Who teaches in the Computer Science department?"
UniBot: "Here are the teachers in Computer Science:
- Dr. Sarah Johnson, Professor (sarah.johnson@university.edu)
- Prof. Michael Chen, Associate Professor (michael.chen@university.edu)"
Example 3: Policy Search
User: "What is the grading policy?"
UniBot: "According to university policy, the grading system uses:
A (90-100%): 4.0 grade points
B (80-89%): 3.0 grade points
[Full policy details provided...]"
ð ï¸ Configuration
Customizing Data Sources
- Update Faculty Information: Edit
teachers.json - Modify Course Catalog: Edit
subjects.json - Adjust Fee Structure: Edit
fees.csv - Update FAQs: Edit
faq.txt - Revise Policies: Edit
policies.txt
Adjusting Model Parameters
In app.py, modify the LLM initialization:
ChatGroq( api_key=api_key, model="llama-3.1-8b-instant", # Model selection temperature=0.7 # Creativity (0.0-1.0) )
ð§ Troubleshooting
Common Issues
Port Already in Use
streamlit run app.py --server.port=8502
Module Import Errors
pip install --upgrade -r requirements.txt
Slow Response Times
- Check internet connection (Groq API requires network access)
- Verify Groq API key is valid
- Consider reducing document corpus size
Outdated Policy Retrieval
- Update document files (faq.txt, policies.txt)
- Restart the application to reload vector embeddings
ð Future Enhancements
- [ ] Multilingual support
- [ ] Voice interaction capabilities
- [ ] Integration with university LMS (Learning Management System)
- [ ] Automated policy document updates
- [ ] Enhanced emotion recognition
- [ ] Mobile application
- [ ] Analytics dashboard for administrators
ð¤ Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a 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
ð License
This project is licensed under the MIT License - see the LICENSE file for details.
ð¥ Authors
- Development Team - Initial work and implementation
- Based on research documented in "Development of a University Chatbot using Retrieval-Augmented Generation (RAG) with Custom Vector-Based Knowledge Base"
ð Acknowledgments
- Meta AI for the LLaMA model
- Groq for hardware acceleration platform
- LangChain community for the agent framework
- Streamlit for the UI framework
- All contributors and testers
ð Support
For questions, issues, or feature requests:
- Open an issue on GitHub
- Contact: support@university.edu
- Documentation: Wiki
Note: This is a prototype system designed for educational purposes. For production deployment, ensure compliance with data privacy regulations (GDPR, FERPA) and implement appropriate security measures.
Project Timeline
Technologies
External Links
Related Projects
Projects built with similar technologies.
Online Html Editor And Viewer
The Online HTML Editor and Viewer is a simple web application built with Flask that allows users to write and preview HTML code in real-time.
Qrgen
A premium, feature-rich QR Code Generator engineered with Python (Flask) and a pristine Glassmorphism frontend.
Examina Ai
Using AI, It transforms raw study materials into structured, verified examination sets with support for institutional export formats like Moodle XML.