How nurzhan-it/aitu_ai_chatbot works
AITU Chatbot is a multilingual Telegram advising bot for AITU students, gated by university-email verification. Its main workflow is student question → clarification/triage when needed → document retrieval → sourced answer and feedback. Admins can ingest and manage documents, FAQs, and duplicate warnings. The graph includes the documented ingestion and duplicate-management capabilities; some internal calls are omitted where excerpts do not establish their direction.
Main entry points: user.py User handlers · main.py Bot dispatcher · admin.py Document admin · ingest.py Document ingestion
Components 27
Bot experience
- Bot dispatcher
bot/main.py - Email verification
bot/auth/handler.py - User handlers
bot/handlers/user.py - FAQ management
bot/handlers/admin_faq.py - FAQ repository
bot/faq_repository.py - Feedback capture
bot/handlers/feedback.py
Question answering
- Clarification dialog
bot/handlers/dialog.py - Question triage
rag/dialog/triage.py - Dialog helpers
rag/dialog - Hybrid retrieval
rag/retriever.py - Text embeddings
rag/embedder.py - Answer generation
rag/generator.py - Answer checks
rag/citation_verifier.py
Document knowledge
- Vector collection
- Document ingestion
ingestion/ingest.py - Page processing
ingestion/page_processor.py - Scanned-page vision
ingestion/vision_processor.py
Administration
- Document admin
bot/handlers/admin.py - Duplicate detection
duplicate_detection/detector.py - Warning history
duplicate_detection/repository.py - Warning reports
duplicate_detection/report_generator.py - Duplicate notifications
duplicate_detection/notifier.py - SQLite records
duplicate_detection/db.py
Other components
- Student
- Admin
- Telegram
- Brevo email
Connections 30
- Student → Telegram: sends questions
README.md - Admin → Telegram: manages documents
README.md - Telegram → Bot dispatcher: delivers updates
README.md - Bot dispatcher → Email verification: registers first
bot/main.py - Bot dispatcher → User handlers: registers
bot/main.py - Bot dispatcher → Clarification dialog: registers
bot/main.py - Bot dispatcher → Document admin: registers
bot/main.py - Email verification → Brevo email: sends codes
bot/auth/handler.py - User handlers → Question triage: classifies questions
bot/handlers/user.py - User handlers → Clarification dialog: starts clarification
bot/handlers/user.py - Clarification dialog → Dialog helpers: uses dialog stages
bot/handlers/dialog.py - User handlers → Hybrid retrieval: searches documents
bot/handlers/user.py - Hybrid retrieval → Text embeddings: embeds queries
rag/retriever.py - Hybrid retrieval → Vector collection: searches vectors
README.md - User handlers → Answer generation: generates response
bot/handlers/user.py - Answer generation → Answer checks: verifies citations
rag/generator.py - User handlers → Feedback capture: collects feedback
bot/handlers/user.py - User handlers → FAQ repository: reads FAQ
bot/handlers/user.py - FAQ management → FAQ repository: edits FAQ
bot/handlers/admin_faq.py - Document admin → Document ingestion: uploads documents
bot/handlers/admin.py - Document ingestion → Page processing: processes pages
ingestion/ingest.py - Page processing → Scanned-page vision: routes scanned pages
ingestion/page_processor.py - Document ingestion → Text embeddings: embeds chunks
ingestion/ingest.py - Document ingestion → Vector collection: upserts chunks
ingestion/ingest.py - Document admin → Duplicate detection: checks duplicates
bot/handlers/admin.py - Duplicate detection → Warning history: records warnings
duplicate_detection/detector.py - Document admin → Warning history: lists warnings
bot/handlers/admin.py - Document admin → Warning reports: generates report
bot/handlers/admin.py - Duplicate detection → Duplicate notifications: sends alerts
duplicate_detection/detector.py - Warning history → SQLite records: persists records
duplicate_detection/repository.py