Skip to content

Repository files navigation

🎓 GAC Salem - Advanced AI Campus Bot (RAG Enterprise Edition)

An intelligent, context-aware RAG (Retrieval-Augmented Generation) system built to dynamically handle complex institutional queries for Government Arts College Salem.


🌿 Branch Strategy & Project Evolution

This repository is intentionally structured to showcase the evolution of an AI product from prototype to production:

  • main branch:
    Contains the foundational Generative AI chatbot built with basic scraping and LLM generation.

  • advanced-rag-pipeline branch (Current):
    The enterprise-grade upgrade. This branch introduces strict multi-stage routing, vector-based semantic caging, and mathematical hallucination prevention to make the bot production-ready.


🚀 Key Enterprise Features

  • Multi-Stage Micro-Bucket Routing:
    Uses an LLM to dynamically route user queries into 5 strict semantic categories (e.g., Department, PO-PSO-CO, General) before retrieval.

  • Deterministic Inverse Filtering:
    Intelligently separates structural PDF documents (Syllabi/Course Outcomes) from Faculty Profiles without relying on standardized naming conventions.

  • Optimized Token Payload:
    Passes mathematically filtered, highly relevant chunk pools (approx. 7,500 tokens) to guarantee zero "Lost in the Middle" attention degradation.

  • Strict Lexical Immunity:
    Bypasses traditional Cross-Encoder reranker collapse by forcing structural list retention for department/course queries.

  • LLM-as-a-Judge Evaluation:
    Includes an automated production evaluation pipeline using the RAGAS framework, mathematically proving:

    • 100% Faithfulness
    • 100% Answer Relevancy

    across synthetic user testing.


🛠️ Technology Stack

Component Technology
Frontend Streamlit
Orchestration LangChain Core
Embeddings Mistral AI (mistral-embed)
Vector Database ChromaDB
Generator LLM Azure OpenAI (gpt-4o-mini)
Evaluation Engine RAGAS & Pandas

⚙️ Quick Start (Windows)

1. Clone and Checkout the RAG Branch

git clone https://github.com/Baskar-forever/college_chatbot.git
cd college_chatbot
git checkout advanced-rag-pipeline

2. Create and Activate a Virtual Environment

python -m venv venv
venv\Scripts\Activate.ps1

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create a .env file in the project root:

AZURE_OPENAI_API_KEY=your_azure_key
AZURE_OPENAI_ENDPOINT=your_azure_endpoint
AZURE_OPENAI_API_VERSION=2024-12-01-preview
MISTRAL_API_KEY=your_mistral_key

5. Run the Application

streamlit run app.py

📊 Running the Production Evaluation

To validate the chatbot against hallucinations and context drop-off, run the automated RAGAS evaluation pipeline:

python production_eval.py

This will:

  • Process a synthetic batch of evaluation queries
  • Grade responses using mathematical RAG metrics
  • Export a detailed audit log as:
production_evaluation_results.csv

🔀 Managing Multiple Versions Locally

Since both the simple chatbot and enterprise RAG system exist in separate branches, switch between them using:

Work on the Simple Version

git checkout main

Work on the Enterprise RAG Version

git checkout advanced-rag-pipeline

Your local files will automatically update to match the selected branch.


✅ Project Goal

This architecture is designed to solve the three major production RAG problems:

  1. Hallucination
  2. Context Collapse
  3. Retriever Noise

The system achieves this through deterministic retrieval control, semantic routing, and evaluation-driven validation.

About

An intelligent, context-aware RAG system built to dynamically handle complex institutional queries using Generative AI

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages