How minhnghia100402/graduation-thesis-haui-2024 works
Project type and purpose
• This is a full-stack research chat application (“HAUI CHAT”) demonstrating Retrieval-Augmented Generation (RAG) with LLMs for an information retrieval graduation project.
• Frontend: Next.js + React + Tailwind UI for user login/signup, chat, sharing sessions.
• Backend: Python FastAPI service exposing chat and prompt endpoints, orchestrating vector retrieval and LLM calls.
• Data layer: a vector store built via ingestion scripts and an external LLM API (e.g. OpenAI).
File structure
Top-level
• docker-compose.yaml – orchestrates frontend & backend containers
• backend/ – Python service, models, routers, service layers, ingestion scripts
• frontend/ – Next.js app in the new “app” folder, UI components, hooks, auth config
Backend substructure
• src/routers – chat.py (handles /chat), promt.py (handles /prompt)
• src/services
– chat/ – business logic for LLM orchestration
– loads/ – functions to load embeddings, LLM clients, build/re-rank collections
– vector_stores/ – vector_indexing.py for CRUD on the vector database
– utils/ – data extraction, chunking, logging
• scripts/vector_store.sh + vector_store.py – one-off data ingestion into the vector store
• Dockerfile & .env_example – containerization and configuration
Frontend substructure
• app/ – route groups: (chat), login, signup, new, share
• components/ – UI primitives, layout components, stock demo widgets
• lib/ – shared hooks, types, utils
• auth.ts, auth.config.ts – next-auth config
• Dockerfile, next.config.js, tsconfig.json, tailwind.config.ts
README for additional insights
• Describes RAG + LLM focus, Docker-based setup, vector store ingestion step, Docker Compose launch command.
• Emphasizes configuration via .env for API keys and local paths.
Detail
• Utilities (logging, chunking) as subcomponents or annotations in the service layer.
• Startup & orchestration (Docker Compose) outside the main data flow but connected to both containers.