Moodle Student Tracker is an advanced bot designed to enhance academic success by indexing Moodle materials and providing real-time educational support through Telegram. With features like hybrid search and multi-course support, it seamlessly integrates with Moodle API and offers a rich learning experience tailored to each student.
The Moodle Student Tracker is an innovative solution that leverages a chat-based teaching approach to enhance academic success. This tool indexes course materials, lectures, grades, and attendance from Moodle, providing real-time insights through an easy-to-use Telegram interface. Utilizing the latest in Retrieval-Augmented Generation (RAG) technology, this bot streamlines learning and supports students in navigating their educational resources effectively.

/health endpoint to monitor uptime and active users.The bot follows a layered architecture design, ensuring clear separation of concerns:
Telegram API
|
bot/main.py
(Application wiring)
|
+--------------+--------------+
| |
bot/handlers/ bot/middleware/
commands.py auth.py
messages.py error_handler.py
|
bot/services/
rag_service.py ---------> core/vector_store.py (FAISS + BM25)
llm_service.py ---------> core/llm_engine.py (Multi-provider LLM)
user_service.py core/llm_providers.py (Adapter pattern)
document_service.py core/moodle_client.py (Moodle REST API)
topic_cache.py core/sync_engine.py (Material pipeline)
conversation_memory.py core/document_processor.py (PDF/DOCX/PPTX)
The interaction process delineated below illustrates how user messages are processed:
User Message
|
v
[Rate Limit Check] ---x---> "You are sending messages too quickly"
|
v
[Active Course Check] ---x---> "Please select a course: /courses"
|
v
[Load Conversation History]
|
v
[Hybrid RAG Search]
FAISS (semantic) + BM25 (keyword)
--> Reciprocal Rank Fusion (k=60)
--> Adaptive threshold: max(top_score * 0.60, 0.20)
|
v
[Is there sufficient material?]
(chunk count >= RAG_MIN_CHUNKS
and similarity >= RAG_SIMILARITY_THRESHOLD)
/ \
Yes No
| |
v v
Teaching Guidance
Mode Mode
| |
v v
LLM: produces LLM: recommends current topics
context-based pedagogical
responses + example questions
| |
+--------+--------+
|
v
[Save to conversation history]
|
v
[Send to Telegram with Markdown]
Teaching Mode: When adequate resources are available, the bot generates pedagogical answers while maintaining the professor's terminology. It labels source files in brackets like [file.pdf]. It avoids generating misleading content by clearly stating when information is not available.

Guidance Mode: If resources are insufficient, the bot redirects students without technical details, offering suggestions for existing topics.
| Teaching Mode | Material Selection |
|---|---|
![]() | ![]() |
| Lessons Explained with RAG | Upcoming Exams |
|---|---|
![]() | ![]() |
| Attendance Information | Grades |
|---|---|
![]() | ![]() |
Clone the project:
git clone https://github.com/onurcangnc/Moodle_Student_Tracker.git
cd Moodle_Student_Tracker
Create a virtual environment:
python3 -m venv venv
source venv/bin/activate # Linux/Mac
# venv\Scripts\activate # Windows
Install dependencies:
pip install -r requirements.txt
# or
make install
Configure the .env file:
cp .env.example .env
Run the application:
python -m bot.main
# or
make run
The project employs a robust technology stack including Python, semantic and keyword search capabilities, as well as multi-provider LLM models, ensuring a seamless and efficient experience for users while interacting with their Moodle materials.
No comments yet.
Sign in to be the first to comment.