Case study
A RAG-based AI assistant for an e-learning platform.
Clait built a RAG-based AI assistant for a Moodle e-learning platform: it reads and indexes the courses’ PDF documents and answers learners’ questions only from the courses they are enrolled in, citing document and page.
Published
01
The context
Learners on a Moodle-based e-learning platform look for answers about their course content. The goal: an assistant built into the platform that answers from the materials of the courses each learner is enrolled in, always showing its sources.
02
From documents to knowledge
Selection
The PDFs of visible courses enabled for the assistant are indexed.
Structured reading
Text is extracted page by page, keeping section headings, page and lesson.
Language and summary
Each document’s language is detected and a summary is generated, used when search finds no precise enough passage.
Semantic chunking
Text is split into passages that hold together by meaning, not by fixed length.
03
Search and answer
Hybrid search
Semantic and keyword (BM25) search combined, limited to the learner’s courses.
Reranking
A multilingual reranking model reorders the candidates; the top three passages reach the model.
Grounded answers
The model answers only from the retrieved context; if the answer is not there, it says so.
Citations
Every answer shows document, page and a link to the course.
Structured data
Questions about events, progress and certificates are answered by predefined queries on the platform’s database, not written by an LLM.
Multilingual
It answers in the language of the question and says when content exists only in another language.
04
Security and control
Access
The assistant checks the user’s session on the platform and retrieves only content from their courses.
Guardrails
It blocks attempts to extract its instructions, requests for exam answers and questions about other users’ data.
Safe links
A filter strips any unauthorised link from answers.
Privacy
User identifiers in analytics are pseudonymised and stored text is deleted after 90 days.
05
For the platform’s administrators
The chat widget, built into Moodle, streams answers with their sources and asks for a 1–5 star rating. A back office brings together conversations, answer quality, content coverage, usage and costs, with tools for handling GDPR requests.
06
Technology
- Backend
- Python, FastAPI, LangChain
- Search
- Qdrant (vectors + BM25), jina-reranker-v2-base-multilingual reranker
- Models
- Azure OpenAI: text-embedding-3-small, GPT-5 mini, GPT-5 nano
- Documents
- PyMuPDF, langdetect
- Frontend
- Vue 3 widget built into Moodle
- Infrastructure
- Docker, MariaDB, Prometheus, Grafana, Loki
FAQ
Frequently asked questions.
Can the assistant make answers up?
It is instructed to answer only from the context retrieved from the course documents; when that context is not enough, it says it does not know.
Can a learner see content from courses they are not enrolled in?
No: search is filtered to the courses the user is enrolled in.
Which languages does it answer in?
The language of the question; when content exists only in another language, it says so.
Keep reading.
- Service · 01AI agentic systems for complex processesClait develops LLM-based agentic systems: specialised AI agents that work together to orchestrate complex workflows, make decisions, correct themselves and work with the data and tools a company already uses.Agentic systems · Works with your tools · Automation
- Case study · 02Querying a database in natural languageClait built a conversational business intelligence platform: staff type a question in plain language, the system turns it into an optimised SQL query and returns an interactive chart, with no SQL knowledge needed.Agentic systems · LLM · SQL
Contact
We find a solution for everyone.
We'll find yours too.
Tell us what you'd like to improve, even if for now it's only an idea. We'll start from there and build the rest together.