PythonPython
No Screenshots Uploaded Yet
COMPLETED

Unibot University Chatbot System

![Python](https://www.python.org/downloads/) ![Streamlit](https://streamlit.io/) ![LangChain](https://python.langchain.com/) ![License](LICENSE) 📋 Overview UniBot is an intelligent, AI-powered ch

About the Project

Python Streamlit LangChain License

📋 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

  1. Clone the repository

    git clone <repository-url>
    cd chatbot
    
  2. Create and activate virtual environment

    # Windows
    python -m venv venv
    .\venv\Scripts\activate
    
    # Linux/Mac
    python3 -m venv venv
    source venv/bin/activate
    
  3. Install dependencies

    pip install -r requirements.txt
    
  4. Set up environment variables (Optional)

    # Create .env file
    echo "GROQ_API_KEY=your_api_key_here" > .env
    

    Or set as environment variable:

    # Windows
    set GROQ_API_KEY=your_api_key_here
    
    # Linux/Mac
    export GROQ_API_KEY=your_api_key_here
    
  5. Run the application

    streamlit run app.py
    
  6. Access the chatbot

    • Open your browser and navigate to http://localhost:8501

📦 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

  1. Update Faculty Information: Edit teachers.json
  2. Modify Course Catalog: Edit subjects.json
  3. Adjust Fee Structure: Edit fees.csv
  4. Update FAQs: Edit faq.txt
  5. 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:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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

Jan 2026 - Jan 2026

Technologies

Python

External Links

Related Projects

Projects built with similar technologies.

Online Html Editor And Viewer
COMPLETED
JavaScriptHTMLCSS+1 more

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.

Rasikh Ali
Qrgen
COMPLETED
Jupyter NotebookHTMLPython

Qrgen

A premium, feature-rich QR Code Generator engineered with Python (Flask) and a pristine Glassmorphism frontend.

Rasikh Ali
Examina Ai
COMPLETED
TypeScriptPythonCSS+2 more

Examina Ai

Using AI, It transforms raw study materials into structured, verified examination sets with support for institutional export formats like Moodle XML.

Rasikh Ali