--- title: Smart Advisor emoji: ๐ŸŽ“ colorFrom: blue colorTo: green sdk: docker app_port: 7860 pinned: false --- # Smart Advisor for DS and AI Students > A voice-enabled Arabic RAG-based academic advisor for new and prospective Data Science and AI students at the University College of Applied Sciences (UCAS). ![Status](https://img.shields.io/badge/status-Completed-brightgreen) ![License](https://img.shields.io/badge/license-MIT-green) ![Python](https://img.shields.io/badge/python-3.10+-blue) --- ## ๐Ÿ“– About The Smart Advisor is a graduation project that helps students who just graduated from high school get instant, accurate advice about the Data Science and AI specialization at UCAS โ€” admission requirements, study plan, career paths, and scholarships. Unlike generic AI tools (ChatGPT, Gemini), our system grounds every answer in **official UCAS documents** โ€” eliminating hallucination โ€” and supports both **text and Arabic voice** input. **Phase 1 (Completed):** Research, literature review, methodology design. **Phase 2 (Completed):** Implementation, evaluation, and deployment. The system is fully built, tested, and merged into `main`. --- ## ๐Ÿง  How It Works ``` Student speaks/types question โ†“ Speech-to-Text (Whisper Arabic) โ†“ RAG Pipeline (retrieval + generation) โ†“ Text-to-Speech (Arabic TTS) โ†“ Student receives spoken/text answer ``` Every step is grounded in official UCAS documents stored in a vector database (ChromaDB). If the system can't find a confident answer, it routes the question to a human advisor instead of guessing. --- ## ๐Ÿ‘ฅ Team | Member | Role | Focus | |---|---|---| | **Fatma Alzahraa Alhabbash** | Project Lead + Backend Architect | RAG pipeline ยท retrieval logic ยท LLM integration ยท fallback mechanism | | **Roaa Alhaddad** | Data Engineer | Data collection for the knowledge base ยท FAQ surveys ยท document processing | | **Saja Abdalaal** | Voice & NLP Engineer | STT ยท TTS ยท NLP preprocessing | | **Shahd Ethalathini** | Frontend + Knowledge Base Engineer | UI ยท KB chunking ยท embedding generation ยท storing embeddings in ChromaDB | **Supervisor:** Dr. Sanaa Al-Sayegh **Institution:** University College of Applied Sciences โ€” Gaza --- ## ๐Ÿ—‚๏ธ Repository Structure ``` smart-advisor/ โ”œโ”€โ”€ docs/ Documentation, reports โ”œโ”€โ”€ data/ Raw and processed data (mostly gitignored) โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ knowledge_base/ Document processing โ†’ chunking โ†’ embeddings โ†’ ChromaDB โ”‚ โ”œโ”€โ”€ rag/ Retrieval and generation pipeline โ”‚ โ”œโ”€โ”€ voice/ STT and TTS modules โ”‚ โ”œโ”€โ”€ ui/ FastAPI backend + Gradio interface โ”‚ โ””โ”€โ”€ utils/ Shared helpers (logging, config) โ”œโ”€โ”€ notebooks/ Jupyter experiments ``` --- ## ๐Ÿš€ Getting Started ### Prerequisites - Python 3.10 or higher - Git - ~5GB free disk space (for model weights) - (Optional) GPU for faster STT inference ### Setup 1. **Clone the repository** ```bash git clone https://github.com/smart-advisor-ucas/smart_advisor.git cd smart-advisor ``` 2. **Create a virtual environment** ```bash python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate ``` 3. **Install dependencies** ```bash pip install -r requirements.txt ``` 4. **Configure environment variables** ```bash cp .env.example .env # Open .env and fill in your API keys ``` 5. **Add the ChromaDB knowledge base** The `data/chroma_db/` folder is **not tracked in GitHub** (it's git-ignored). Create it and populate it before running the backend. Without this step, the backend will start but retrieval will fail because the collection won't exist. 7. **Run the backend** ```bash uvicorn src.ui.main:app --reload --port 8000 ``` Swagger docs are available at `http://127.0.0.1:8000/docs`. 6. **Run the interface** ```bash cd src/ui/frontend npm install npm run dev ``` The React frontend talks to the backend over the `/chat`, `/chat/reset`, and `/chat/history/{session_id}` endpoints. --- ## Branch Strategy We use a simple branching model: - **`main`** โ€” protected, only updated via pull requests - **`integration/merge-all`** โ€” integration branch where all feature branches merge first - **`feature/rag`** โ€” backend RAG pipeline work - **`feature/frontend-ui`** โ€” UI work - **`feature/voice`** โ€” STT/TTS work --- ## โœ… Testing - **Unit testing** was carried out at the end of each development phase, on each component in isolation (retrieval, metadata filtering, fallback logic, profile extraction, etc.) before it was merged. - **Integration/overall testing** was performed after all feature branches (`feature/rag`, `feature/frontend-ui`, `feature/voice`) were merged into `main`, to validate the end-to-end flow from onboarding through retrieval to fallback escalation. - Test cases and results are tracked under `tests/`. --- ## ๐Ÿ“š Documentation - [Phase 1 Report](docs/phase1_report.pdf) - [Architecture Overview](docs/architecture.md) --- ## ๐Ÿ“œ License This project is licensed under the MIT License โ€” see [LICENSE](LICENSE) for details. --- ## ๐Ÿ™ Acknowledgments - Dr. Sanaa Al-Sayegh, our supervisor, for invaluable guidance throughout the project. - The Department of Computer Engineering at UCAS for academic support. - The open-source NLP community whose tools make this project possible. --- *Built with โค๏ธ by the Smart Advisor team โ€” UCAS, Gaza, 2025-2026*