--- title: edi.chat - Optimized emoji: ๐ŸŽ“ colorFrom: red colorTo: gray sdk: docker app_port: 7860 pinned: false license: mit app_file: Dockerfile --- # edi.chat - UGA AI Assistant An intelligent, agentic AI assistant for the University of Georgia community, now available at [edi.chat](https://edi.chat) ## ๐ŸŽฏ Key Features ### Agentic Capabilities - **Action Execution**: Actually performs tasks, not just provides information - **Course Registration**: Register for classes directly through the chat - **Financial Transactions**: Make tuition payments and manage accounts - **Room Booking**: Reserve study spaces and meeting rooms - **Grade Submission**: Faculty can submit grades through conversational interface ### UGA-Specific Intelligence - **Comprehensive Knowledge**: Deep understanding of UGA systems, policies, and procedures - **Athens Integration**: Information about local businesses, transportation, and community - **Real-time Data**: Live information from UGA systems (Athena, eLC, dining services) - **Personalization**: Tailored responses based on user role and academic standing ## AI Models Supported (Privacy-First) - **๐Ÿ† Ollama Models** (Recommended): Complete privacy, local inference - llama3:8b - Best balanced model for UGA use cases - llama3:70b - Maximum intelligence for complex queries - mistral:7b - Fast responses, excellent reasoning - phi3:mini - Lightweight option for basic hardware - **Hugging Face**: Cloud-hosted open-source models (fallback) - **OpenAI GPT-4**: Premium cloud AI (not recommended for privacy) ## System Architecture ### Core Components - **Backend**: Node.js with Express.js - **Frontend**: React with TypeScript - **Database**: MongoDB for conversation history and user preferences - **AI/NLP**: Multiple AI providers (OpenAI, Ollama, Hugging Face) - **Authentication**: Integration with UGA MyID system - **Caching**: Redis for session management and quick responses ### UGA System Integrations - **MyID/ArchPass**: Two-step authentication - **eLC (eLearning Commons)**: Course assignments, grades, materials - **Athena**: Student information system - **UGA Mobile App APIs**: Campus services, dining, transportation - **EITS Services**: IT support and campus resources ## Project Structure ``` uga-chatbot/ โ”œโ”€โ”€ backend/ โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ”‚ โ”œโ”€โ”€ controllers/ โ”‚ โ”‚ โ”œโ”€โ”€ middleware/ โ”‚ โ”‚ โ”œโ”€โ”€ models/ โ”‚ โ”‚ โ”œโ”€โ”€ routes/ โ”‚ โ”‚ โ”œโ”€โ”€ services/ โ”‚ โ”‚ โ””โ”€โ”€ utils/ โ”‚ โ”œโ”€โ”€ package.json โ”‚ โ””โ”€โ”€ server.js โ”œโ”€โ”€ frontend/ โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ”‚ โ”œโ”€โ”€ components/ โ”‚ โ”‚ โ”œโ”€โ”€ pages/ โ”‚ โ”‚ โ”œโ”€โ”€ services/ โ”‚ โ”‚ โ””โ”€โ”€ utils/ โ”‚ โ”œโ”€โ”€ package.json โ”‚ โ””โ”€โ”€ public/ โ”œโ”€โ”€ Dockerfile โ””โ”€โ”€ docs/ ``` ## ๐Ÿš€ Quick Start ### Prerequisites - Node.js 18+ and npm - MongoDB 4.4+ - Redis 6.0+ (optional) - AI API keys (OpenAI, Hugging Face, or Ollama setup) ### Environment Variables ```env # ๐Ÿค– LOCAL AI CONFIGURATION (Recommended) USE_LOCAL_AI=true LOCAL_AI_URL=http://localhost:11434 LOCAL_AI_MODEL=llama3:8b # ๐Ÿšซ DISABLE ONLINE AI (Privacy-First) USE_HUGGINGFACE=false USE_OPENAI=false # Server Configuration PORT=7860 NODE_ENV=production # Database (Optional) MONGODB_URI=mongodb://localhost:27017/edichat_local REDIS_URL=redis://localhost:6379 # Security JWT_SECRET=your_secure_secret_min_32_chars JWT_REFRESH_SECRET=your_secure_refresh_secret_min_32_chars # UGA Integration (for production) UGA_API_BASE_URL=https://api.uga.edu UGA_API_KEY=your_uga_api_key_here ``` ### ๐Ÿš€ Quick Start (Local AI) 1. **Install Ollama** ```bash # macOS/Linux curl -fsSL https://ollama.com/install.sh | sh # Start Ollama service ollama serve ``` 2. **Download AI Models** ```bash # Recommended model (4.7GB) ollama pull llama3:8b # Lightweight option (2.3GB) ollama pull phi3:mini ``` 3. **Deploy with Docker** ```bash # Clone and start git clone https://huggingface.co/spaces/edichat/edi.chat.test cd edi.chat.test # Start everything (includes Ollama + edi.chat) docker-compose -f docker-compose.local.yml up ``` 4. **Access edi.chat** - Application: http://localhost:7860 - Health Check: http://localhost:7860/health ### Manual Installation 1. **Clone the repository** ```bash git clone https://huggingface.co/spaces/edichat/edi.chat.test cd edi.chat.test ``` 2. **Install dependencies** ```bash # Backend dependencies cd backend npm install # Frontend dependencies cd ../frontend npm install ``` 3. **Configure for Local AI** ```bash # Set environment variables export USE_LOCAL_AI=true export LOCAL_AI_URL=http://localhost:11434 export LOCAL_AI_MODEL=llama3:8b ``` 4. **Start the services** ```bash # Build frontend cd frontend && npm run build && cd .. # Start backend cd backend && npm start ``` ## ๐Ÿณ Docker Deployment ### Local Docker Run ```bash docker build -t edichat . docker run -p 7860:7860 -e USE_LOCAL_AI=false -e USE_HUGGINGFACE=true edichat ``` ### Hugging Face Spaces This app is configured to deploy automatically to Hugging Face Spaces with Docker SDK. ## ๐Ÿงช Testing ### Backend Tests ```bash cd backend npm test npm run test:coverage ``` ### Frontend Tests ```bash cd frontend npm test npm run test:coverage ``` ## ๐Ÿ“ API Documentation ### Authentication - `POST /api/auth/login` - Standard login - `POST /api/auth/myid-login` - UGA MyID login - `GET /api/auth/me` - Get current user - `POST /api/auth/refresh` - Refresh tokens ### Chat - `GET /api/chat/conversations` - List conversations - `POST /api/chat/message` - Send message - `POST /api/chat/conversations` - Create conversation ### Student Services - `GET /api/students/courses` - Get courses - `POST /api/students/courses/register` - Register for course - `GET /api/students/financial` - Financial information ### Faculty Services - `GET /api/faculty/dashboard` - Faculty dashboard - `GET /api/faculty/analytics` - Student analytics - `POST /api/faculty/grades` - Submit grades ## ๐Ÿ›ก๏ธ Security - JWT authentication with refresh tokens - Role-based access control - UGA MyID integration - Data encryption and FERPA compliance ## ๐Ÿš€ Deployment Options ### Hugging Face Spaces (Recommended for Demo) - Free hosting with Docker support - Custom domain support available - Built-in secrets management - Automatic deployments from git ### Production Deployment ```bash npm run build npm start ``` ### Docker ```bash docker-compose up -d ``` ## ๐Ÿค Support - **EITS Support**: eits@uga.edu - **Phone**: 706-542-3106 - **Documentation**: [docs/](docs/) --- **Built for the University of Georgia community with โค๏ธ** **Available at**: [edi.chat](https://edi.chat)