Pycon Tanzania 2026

Building a University AI Assistant with Python: From Chatbot to Reliable Knowledge Retrieval

PyCon Long Talk, 30 min Data, AI & ML Intermediate
Friday 27 November 14:00 to 14:30 Main Hall, State University Of Zanzibar

How can we build an AI assistant that provides reliable answers to university students instead of simply generating responses? This talk explores building a university AI assistant using Python, FastAPI, Large Language Models (LLMs), and Retrieval-Augmented Generation (RAG). Using a student information assistant as a practical case study, it demonstrates how knowledge retrieval can improve answer relevance, reduce hallucinations, and ground AI responses in verified institutional information.

AI-powered chatbots are becoming increasingly common, but generating answers is not the same as providing reliable information. In a university environment, students need accurate answers about academic programmes, admission procedures, academic calendars, campus services, and other institutional information.

This session explores how to develop a university AI assistant using Python, moving beyond a conventional chatbot towards a knowledge-grounded system.

Using a university student assistant as a practical case study, the talk will cover the following areas:
1. Understanding the Problem
-> Challenges students face when accessing university information.
->Limitations of traditional rule-based chatbots.
-> Why general-purpose AI models may produce inaccurate institutional information.

2. Designing the System Architecture
-> Using Python and FastAPI to build the backend.
-> Integrating an AI model through an API.
-> Organizing university information into a structured knowledge base.
-> Understanding the roles of the database, retrieval component, and AI service.

3. Understanding Retrieval-Augmented Generation (RAG)
-> What RAG is and why it is useful.
-> Document processing and text chunking.
-> Generating embeddings.
-> Storing and searching vector representations.
-> Retrieving relevant information and providing context to an LLM.

4. Improving Answer Reliability
-> Grounding responses in retrieved institutional information.
-> Reducing hallucinations through context-based generation.
-> Handling questions when verified information is unavailable.
-> Returning relevant sources to support generated answers.

5. Practical Demonstration

A demonstration will illustrate how a student can ask a university-related question, how the system retrieves relevant information from its knowledge base, and how the AI model uses that information to generate a response.

What Attendees Will Take Away

By the end of the session, attendees will have a practical understanding of:

- How to build an AI-powered application using Python and FastAPI.
- The difference between a conventional chatbot and a RAG-based AI assistant.
- How embeddings and vector search support knowledge retrieval.
- How to connect retrieved information with Large Language Models.
- Practical techniques for improving the reliability of AI-generated answers.
- How these concepts can be applied to educational institutions and other information-intensive environments.

#Python Core#AI#DevOps