How lehoanganhtai13/agentic-hcmut-chatbot works
Project Type and Purpose
• This is a full‑stack, microservices‑based chatbot system using Retrieval‑Augmented Generation (RAG) to answer admission queries for HCMUT.
• Key goals: semantic search over university documents, context‑aware chat, multilingual support, agentic reasoning.
File Structure
• Top‑level directories:
• chatbot/ ← core Python code
• chatbot/core/ ← retrieval, generation, model clients
• chatbot/indexing/ ← document and FAQ ingestion pipelines
• chatbot/prompts/ ← reusable prompt templates
• chatbot/server/ ← four Dockerized API microservices
• chatbot/utils/ ← database clients (Milvus, MinIO), OpenAI websocket
• chatbot/workflow/ ← CLI scripts for building index & inference
• database/ ← Docker‑compose definitions for Milvus & MinIO
• Makefile orchestrates network, volumes, containers, backup/restore.
README
• Confirms a four‑service architecture (chatbot_server, document_server, faq_server, index_server).
• Uses Milvus (vector DB) + MinIO (object store) for RAG.
• Relies on LLMs via OpenAI or local clients for embeddings/generation.
A. Clients
• Web/Mobile Chat UI (end user)
B. API Gateway / Chatbot Server
• chatbot/server/chatbot_server/server_app.py
• Routes user queries to retriever & generator services
C. Microservices (Docker containers on chatbot network)
1. Index Service
– Endpoint to ingest or re‑build the semantic index
– Invokes chatbot/indexing/ pipelines
2. Document Service
– Serves context documents from MinIO
3. FAQ Service
– Serves FAQ entries and handles FAQ‑specific retrieval
4. Chat Service (the main conversational API)
– Coordinates:
• Retrieval → core/retriever/* (uses Milvus or BM25)
• Generation → core/generator & core/model_clients/llm.py
D. Datastores
• Milvus (vector embeddings)
• MinIO (raw documents, chunks, FAQ JSONs)
E. Model Clients
• Embedding service (embedder.py)
• LLM API (llm.py) or local model loaders
F. Workflow Scripts
• build_index.py → Preprocess & push embeddings/documents into Milvus & MinIO
• chatbot_inference.py → Standalone CLI chat
Architectural Patterns & Tech Stack
• Microservices deployed via Docker Compose on a dedicated chatbot network.
• RAG pipeline: ingestion (indexing) + retrieval + generation.
• Semantic search uses Milvus; object storage via MinIO.
• Prompts are externalized for easy tuning.
• Strict separation of concerns: indexing vs retrieval vs generation vs API.