Spaces:
Sleeping

edi.chat.test / README.md
Claude Code Bot
Claude
Force Docker deployment rebuild
5a33afa
|
Raw History Blame Contribute Delete
6.86 kB
metadata
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

🎯 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

# πŸ€– 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

    # macOS/Linux
    curl -fsSL https://ollama.com/install.sh | sh
    
    # Start Ollama service
    ollama serve
    
  2. Download AI Models

    # Recommended model (4.7GB)
    ollama pull llama3:8b
    
    # Lightweight option (2.3GB)
    ollama pull phi3:mini
    
  3. Deploy with Docker

    # 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

Manual Installation

  1. Clone the repository

    git clone https://huggingface.co/spaces/edichat/edi.chat.test
    cd edi.chat.test
    
  2. Install dependencies

    # Backend dependencies
    cd backend
    npm install
    
    # Frontend dependencies
    cd ../frontend
    npm install
    
  3. Configure for Local AI

    # 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

    # Build frontend
    cd frontend && npm run build && cd ..
    
    # Start backend
    cd backend && npm start
    

🐳 Docker Deployment

Local Docker Run

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

cd backend
npm test
npm run test:coverage

Frontend Tests

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

npm run build
npm start

Docker

docker-compose up -d

🀝 Support


Built for the University of Georgia community with ❀️

Available at: edi.chat