A full-stack web application that helps Vietnamese high school students choose universities and majors based on exam scores, interests, budget, and location — powered by an intelligent AI chatbot using RAG (Retrieval-Augmented Generation) and hybrid SQL/vector search.
UniOrien addresses a real pain point for Vietnamese high school students: navigating the complex university admission process. With thousands of programs across hundreds of universities and fluctuating admission benchmarks, students often make uninformed decisions.
This system provides:
- Data-driven insights — Historical admission scores, university/major details
- AI-powered Q&A — Natural language queries answered by an intelligent hybrid RAG system
- Personalized guidance — Recommendations based on user profiles and preferences
Vietnamese students face critical challenges during university selection:
| Challenge | Impact |
|---|---|
| Information overload | 400+ universities, 1000s of majors |
| Score benchmark volatility | Admission scores change yearly |
| Lack of personalization | Generic advice doesn't fit individual profiles |
| Fragmented data sources | Information scattered across multiple websites |
UniOrien consolidates data, provides intelligent search, and offers an AI assistant that understands context and delivers accurate, personalized answers.
The core innovation is a hybrid AI pipeline that routes queries to the optimal processing path:
| Intent | Use Case | Pipeline |
|---|---|---|
| SQL | "Top 10 universities by admission score" | NL → SQL → PostgreSQL → LLM formatting |
| RAG | "What is student life like at FPT?" | Vector search → Context retrieval → LLM synthesis |
| Hybrid | "Compare CS programs with my 28-point score" | SQL (data) + RAG (context) → LLM synthesis |
Key Components:
Intent Router (Rule-based classification)
│
├── SQLAgentService
│ └── NL-to-SQL generation using schema-aware prompts
│ └── Query execution + result formatting
│
├── RAGService
│ └── Semantic search via ChromaDB
│ └── Context-augmented generation
│
└── HybridAnswerService
└── SQL ground truth + RAG context
└── Synthesized response with citations
Technical Highlights:
- Schema-aware SQL generation — LLM receives full database schema, enforces SELECT-only queries
- Chunked document ingestion — RecursiveCharacterTextSplitter (800 tokens, 200 overlap)
- Rate limiting — Redis-backed token quota system (12K tokens/user/window)
- Fallback architecture — Primary/fallback LLM configuration for resilience
Architecture Patterns:
- Layered architecture — Controller → Service → Repository
- AOP-based logging — Cross-cutting concerns handled via aspects
- DTO pattern — Clean separation between API contracts and entities
Data Models:
| Entity | Purpose |
|---|---|
University |
Institution details, location, type |
Major |
Program information, subject groups |
Benchmark |
Historical admission scores by year |
Review |
User-submitted reviews (RAG-indexed) |
User |
Authentication, roles, preferences |
Integrations:
- Selenium WebDriver — Automated data crawling from official sources
- Redis — Session caching, rate limit counters
- Feign Client — Service-to-service communication with AI service
Tech Stack:
- Next.js 15 with Turbopack
- React 19 + TypeScript
- TailwindCSS v4 + Radix UI primitives
- TanStack Query for server state management
Features:
- Server-side rendering for SEO optimization
- Real-time chat interface with streaming responses
- Responsive design with dark mode support
| Feature | Description |
|---|---|
| 🎓 University Explorer | Browse, filter, and compare universities by region, type, ranking |
| 📚 Major Search | Find programs by subject group, career path, or keywords |
| 📊 Benchmark Analysis | Historical admission score trends and predictions |
| 🤖 AI Chat Assistant | Natural language Q&A with hybrid SQL+RAG intelligence |
| ⭐ Review System | User reviews indexed for semantic search |
| 🔐 Authentication | JWT-based auth with role-based access control |
Problem: User queries require different processing — some need database lookups, others need contextual knowledge.
Solution: Rule-based intent classifier with confidence scoring routes queries to SQL, RAG, or hybrid pipelines.
Problem: LLMs hallucinate table/column names, generate unsafe queries.
Solution: System prompt injection with full schema context, enforced SELECT-only generation, ILIKE pattern matching for Vietnamese text.
Problem: Admission data changes annually across hundreds of sources.
Solution: Selenium-based automated crawlers with scheduled jobs, incremental ingestion into both PostgreSQL and ChromaDB.
Problem: Standard tokenizers and embeddings perform poorly on Vietnamese.
Solution: SentenceTransformers with multilingual models, custom keyword-based intent detection for Vietnamese query patterns.
Problem: LLM API costs can spiral with unrestricted usage.
Solution: Redis-backed token estimation and quota enforcement per user fingerprint.
| Layer | Technologies |
|---|---|
| Frontend | Next.js 15, React 19, TypeScript, TailwindCSS, Radix UI, TanStack Query |
| Backend | Spring Boot 3.5, Java 21, Spring Data JPA, Spring Security (OAuth2/JWT) |
| AI Service | FastAPI, LangChain, ChromaDB, SentenceTransformers, gpt-4o-mini |
| Databases | PostgreSQL (relational), ChromaDB (vector), Redis (cache/rate-limit) |
| DevOps | Docker, Docker Compose |
| Data Collection | Selenium WebDriver |
uniorien-source/
├── uniorien-frontend/ # Next.js frontend application
│ ├── src/
│ │ ├── app/ # App router pages
│ │ ├── components/ # Reusable UI components
│ │ ├── services/ # API client services
│ │ └── hooks/ # Custom React hooks
│
├── uniorien-backend/ # Spring Boot backend API
│ └── src/main/java/
│ └── com/ntd/uniorien/
│ ├── controller/ # REST endpoints
│ ├── service/ # Business logic
│ ├── repository/ # Data access
│ └── entity/ # JPA entities
│
└── uniorien-ai/ # FastAPI AI service
├── app/ # API routes + rate limiting
├── services/
│ ├── intent/ # Query classification
│ ├── sql_agent/ # NL-to-SQL pipeline
│ ├── rag/ # Vector search pipeline
│ ├── hybrid/ # Combined pipeline
│ └── ingestion/ # Document processing
├── components/ # Pluggable DB/LLM managers
└── prompts/ # LLM prompt templates
Personal Portfolio Project
This project demonstrates full-stack development capabilities including:
- distributed architecture design
- AI/ML integration (RAG, LLM orchestration)
- Modern frontend development
- Enterprise backend patterns
- DevOps and containerization
Built with ☕ and curiosity