How hoanglhse173120/prn222 works
This is an ASP.NET Core RAG learning chatbot with a Python embedding service. Its main workflow is document upload and indexing, followed by real-time chat: questions are embedded, compared with indexed document chunks, and sent with relevant context to an LLM; responses can include document sources. The repository also exposes authentication, subject/document administration, subscriptions and payments, and benchmark/statistics capabilities. The graph reflects documented capabilities where relevant, but several page and service implementations were not sampled, so uncertain internal calls are omitted.
Main entry points: DocumentService.cs Document service · RagService.cs RAG retrieval · ChatService.cs Chat service · DocumentRepository.cs Document repository
Components 23
Web interaction
- Chat pages
PresentationLayer/Pages/Chat/Index.cshtml.cs - ChatHub
PresentationLayer/Hubs/ChatHub.cs - Chat service
ServiceLayer/Services/ChatService.cs - Identity login
PresentationLayer/Areas/Identity/Pages/Account/Login.cshtml.cs
Content ingestion
- Document pages
PresentationLayer/Pages/Document/Upload.cshtml.cs - Document service
ServiceLayer/Services/DocumentService.cs - Text extraction
ServiceLayer/Services/TextExtractorService.cs - Chunking
ServiceLayer/Services/ChunkingService.cs - Embedding API
PythonAIService/main.py
RAG answering
- RAG retrieval
ServiceLayer/Services/RagService.cs - Groq LLM
Persistence
- Document repository
DataAccessLayer/Repositories/DocumentRepository.cs - Chat session repository
DataAccessLayer/Repositories/ChatSessionRepository.cs - SQL Server
DataAccessLayer/Context/ChatbotDbContext.cs
Administration
- Subject management
PresentationLayer/Pages/Subject/Index.cshtml.cs - Packages and pricing
PresentationLayer/Pages/Pricing/Index.cshtml.cs - Payment service
ServiceLayer/Services/PaymentService.cs - Benchmark service
ServiceLayer/Services/BenchmarkService.cs - Admin statistics
ServiceLayer/Services/StatisticService.cs
Other components
- Learner
- Teacher
- Admin
- VNPAY
Connections 24
- Learner → Chat pages: asks questions
- Chat pages → ChatHub: starts chat
- ChatHub → Chat service: dispatches chat
- Chat service → RAG retrieval: requests answer
- RAG retrieval → Embedding API: embeds query
- RAG retrieval → Document repository: loads chunks
- RAG retrieval → Groq LLM: sends context
- Chat service → Chat session repository: persists sessions
- Teacher → Document pages: uploads documents
- Document pages → Document service: submits file
- Document service → Text extraction: extracts text
- Document service → Chunking: chunks text
- Document service → Embedding API: embeds chunks
- Document service → Document repository: stores document
- Document repository → SQL Server: reads and writes
- Chat session repository → SQL Server: reads and writes
- Learner → Identity login: signs in
- Teacher → Subject management: manages subjects
- Admin → Admin statistics: views statistics
- Admin → Benchmark service: runs benchmarks
- Learner → Packages and pricing: chooses package
- Packages and pricing → Payment service: starts payment
- Payment service → VNPAY: initiates payment
- Admin → Packages and pricing: manages packages