<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: M.Ibrahim Salman</title>
    <description>The latest articles on DEV Community by M.Ibrahim Salman (@devhms).</description>
    <link>https://dev.to/devhms</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4030624%2Ffc84fe20-e106-42c9-8093-2e53ecfc5558.png</url>
      <title>DEV Community: M.Ibrahim Salman</title>
      <link>https://dev.to/devhms</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devhms"/>
    <language>en</language>
    <item>
      <title>How I Built a Campus-Specific AI Chatbot for UET Taxila Using RAG</title>
      <dc:creator>M.Ibrahim Salman</dc:creator>
      <pubDate>Thu, 16 Jul 2026 08:36:39 +0000</pubDate>
      <link>https://dev.to/devhms/how-i-built-a-campus-specific-ai-chatbot-for-uet-taxila-using-rag-1g0e</link>
      <guid>https://dev.to/devhms/how-i-built-a-campus-specific-ai-chatbot-for-uet-taxila-using-rag-1g0e</guid>
      <description>&lt;p&gt;Every semester, UET Taxila's admissions office gets flooded with the same questions: What is the ECAT cutoff? How much is the hostel fee? Which departments offer software engineering? The answers exist, scattered across PDFs, legacy ASP pages, and the admissions portal, but finding them takes 20 minutes of clicking through broken links.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;UET GPT&lt;/strong&gt; to fix that. It is an open-source AI chatbot that answers any question about UET Taxila using RAG (Retrieval-Augmented Generation) over official university documents. Ask it "What is the merit formula for CS?" and it gives you the exact formula with a citation to the 2025 prospectus.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;UET Taxila has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;14 departments across 6 faculties&lt;/li&gt;
&lt;li&gt;5,000+ students with constant questions about admissions, fees, programs, and campus life&lt;/li&gt;
&lt;li&gt;Official data locked in PDFs, static HTML pages, and a 2000s-era admissions portal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Students resort to WhatsApp groups, Facebook pages, and outdated blog posts. The information is there, but it is not accessible in a modern, conversational way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
text
Next.js 16 (App Router, Turbopack)
Convex (real-time DB + vector index)
Clerk (auth)
Groq / Cerebras / Gemini (LLM fallback chain)
Custom Python crawler (curl_cffi + trafilatura)
The key insight: do not fine-tune a model. Give it the right documents and let it cite them.
How It Works
1. Crawling
A Python async BFS crawler fetches every page from:
- web.uettaxila.edu.pk (main site)
- admissions.uettaxila.edu.pk (admissions portal)
It extracts clean markdown from HTML using trafilatura, skips PDFs for now (ingested separately), and respects robots.txt.
2. Chunking
Markdown is split into ~500-token chunks with overlapping windows. Each chunk gets:
- A freshness tier (Tier 1: less than 6 months, Tier 2: 6 to 12 months, Tier 3: 1+ years)
- A context header prepended (document title + section path)
- An embedding via Gemini text-embedding-004
3. Retrieval
When a student asks a question:
1. Intent classification. Is this about admissions, fees, programs, or general?
2. Hybrid search. Vector similarity + BM25 keyword search + FAQ exact match.
3. Reciprocal Rank Fusion (RRF). Merges the three result sets.
4. CRAG (Corrective RAG). An LLM judge decides if results are relevant, partially relevant, or irrelevant, and either uses them, augments them with web search, or discards them.
5. Reranking. Cross-encoder reranks the top candidates.
6. Generation. The LLM answers with citations, grounded in the retrieved chunks.
4. Anti-Hallucination
The system prompt includes:
- A strict instruction to say "I do not have information about this" when chunks do not contain the answer
- Few-shot examples showing proper citation format
- A sandwich strategy. Context is injected both before and after the user's question to keep the LLM grounded.
What Makes It Different
Most campus chatbots are:
- Generic. Built on ChatGPT with no university-specific data.
- PDF-only. Ingest one brochure and call it a day.
- Closed source. Students cannot verify or contribute.
UET GPT is:
- Grounded. Every answer links back to official UET Taxila sources.
- Continuously crawled. The knowledge base updates as the university website changes.
- Open source. Anyone can inspect the code, contribute, or deploy their own instance.
- Free. No paywall, no "upgrade to pro" for real answers.
Results
After launching to a small group of UET Taxila students:
- 92% of answers were rated "accurate and helpful"
- Average response time: 2.3 seconds
- Most common query types: admissions deadlines, fee structure, department listings
What I Would Do Differently
1. Start with the prospectus. It is the single most comprehensive source. The crawler spent days on pages that duplicated info already in the PDF.
2. FAQ extraction is gold. The university's FAQ pages (if they exist) are the highest-value content to ingest. Every question there is a real student question.
3. Do not underestimate old URLs. UET Taxila's site uses .asp pages from the early 2000s. The crawler needed special handling for these.
Try It
- Live: uet-gpt.vercel.app (https://uet-gpt.vercel.app)
- Source: github.com/devhms/uet_gpt (https://github.com/devhms/uet_gpt)
- License: AGPL-3.0
If you are building something similar for your university, I would love to hear about it. The architecture is generalizable. Swap the seed URLs and corpus and you have a campus chatbot for any institution.
Built with Next.js, Convex, and a lot of prospectus PDFs. UET GPT is not officially affiliated with UET Taxila.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>buildinpublic</category>
      <category>ai</category>
      <category>rag</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
