Skip to content

SunfishTK1/agora

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Agora

πŸŽ“ PennGPT - AI-Powered University Assistant

Live Demo API Status SSL Security React Python

πŸš€ Overview

PennGPT is an intelligent AI assistant specifically designed for the University of Pennsylvania community. Built with cutting-edge RAG (Retrieval-Augmented Generation) technology, it provides accurate, contextual information about Penn academics, student life, events, clubs, and campus resources.

✨ Key Features

  • 🎯 Penn-Specific Knowledge: Comprehensive information about UPenn academics, clubs, events, and resources
  • πŸ’¬ Natural Conversations: Chat-based interface with contextual understanding
  • πŸ” Smart Search: Vector-powered semantic search across Penn's knowledge base
  • πŸ“± Responsive Design: Modern, mobile-friendly React frontend
  • πŸ”’ Secure & Fast: SSL-encrypted with optimized performance
  • πŸ“š Citations: Provides sources for all information shared

🌐 Live Deployment

Service URL Status
Main Application https://penngpt.com 🟒 Live
Secondary Domain https://penngpt.velroi.com 🟒 Live
API Endpoint https://api.penngpt.velroi.com 🟒 Live
Health Check /api/health 🟒 Active

πŸ—οΈ Architecture

graph TB
    A[πŸ‘€ User] --> B[🌐 HTTPS Frontend<br/>penngpt.com]
    B --> C[πŸ”„ Nginx Reverse Proxy]
    C --> D[βš›οΈ React SPA<br/>Vite + TypeScript]
    C --> E[πŸ”Œ API Proxy<br/>/api/*]
    E --> F[🐍 FastAPI Backend<br/>Python + Uvicorn]
    F --> G[🧠 Azure OpenAI<br/>GPT-4 + Embeddings]
    F --> H[πŸ“Š Milvus Vector DB<br/>Semantic Search]
    F --> I[πŸ“š Knowledge Base<br/>Penn Data + Clubs]
    
    style A fill:#e1f5fe
    style B fill:#e8f5e8
    style G fill:#fff3e0
    style H fill:#f3e5f5
    style I fill:#e0f2f1
Loading

πŸ”§ Technology Stack

Frontend:

  • βš›οΈ React 18.3 with TypeScript
  • ⚑ Vite for fast development and building
  • 🎨 Tailwind CSS for modern styling
  • πŸ“± Responsive Design with mobile-first approach
  • πŸ” Zustand for state management

Backend:

  • 🐍 Python FastAPI for high-performance APIs
  • 🧠 Azure OpenAI (GPT-4, text-embedding-3-large)
  • πŸ“Š Milvus vector database for semantic search
  • πŸ”„ Async/Await for concurrent processing
  • πŸ“š RAG Pipeline for contextual responses

Infrastructure:

  • πŸ”’ Nginx with SSL termination
  • πŸ“œ Let's Encrypt SSL certificates
  • ☁️ AWS EC2 hosting
  • 🌐 DNS with multiple domain support
  • πŸ”„ Auto-renewal for certificates

πŸ“– Usage

πŸ’¬ Chat Interface

Simply visit penngpt.com and start chatting! Ask about:

  • πŸ“š Academics: Course information, requirements, schedules
  • 🎭 Student Life: Clubs, organizations, events
  • πŸ›οΈ Campus Resources: Libraries, dining, facilities
  • πŸ“… Events: Upcoming activities and deadlines
  • ℹ️ General Info: Penn policies, contacts, directions

πŸ”§ API Usage

Base URL: https://penngpt.com/api/ or https://api.penngpt.velroi.com/

Chat Endpoint

curl -X POST https://penngpt.com/api/chat \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "user", "content": "Tell me about Penn clubs"}
    ],
    "top_k": 5
  }'

Health Check

curl https://penngpt.com/api/health

Response Format:

{
  "answer": "Detailed response with Penn-specific information...",
  "citations": [
    {
      "title": "Source Title",
      "url": "https://example.com",
      "excerpt": "Relevant excerpt..."
    }
  ],
  "session_id": "unique-session-identifier"
}

πŸš€ Development

Frontend Setup

cd frontend/frontend/client
npm install
npm run dev  # Development server on :5173
npm run build  # Production build

Backend Setup

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Configure Azure OpenAI credentials

# Run development server
python -m uvicorn chat_assistant_api:app --reload --host 127.0.0.1 --port 8010

Environment Variables

# Azure OpenAI Configuration
AZURE_OPENAI_API_KEY=your_api_key_here
AZURE_OPENAI_ENDPOINT=your_endpoint_here
AZURE_OPENAI_API_VERSION=2024-12-01-preview
AZURE_OPENAI_MODEL=gpt-4
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-3-large

# Vector Database
MILVUS_DB_PATH=./milvus_lite.db
COLLECTION_NAME=web_documents

πŸ”’ Security

  • πŸ›‘οΈ SSL/TLS Encryption: All communications encrypted with Let's Encrypt certificates
  • πŸ” Security Headers: HSTS, CSP, XSS protection, and more
  • 🚫 CORS Protection: Properly configured cross-origin policies
  • πŸ”„ Auto-Renewal: Certificates automatically renewed
  • πŸ“Š Rate Limiting: API endpoint protection
  • πŸ” Input Validation: Secure request processing

πŸ“Š Features

🎯 Core Capabilities

  • 🧠 Intelligent Responses: Context-aware answers using RAG architecture
  • πŸ“š Comprehensive Knowledge: 1,399+ Penn clubs and extensive university data
  • πŸ” Semantic Search: Vector-based similarity matching for relevant information
  • πŸ’¬ Conversational Memory: Maintains context throughout chat sessions
  • πŸ“± Mobile Optimized: Responsive design works on all devices
  • ⚑ Fast Performance: Optimized for quick response times

πŸ”§ Technical Features

  • πŸ”„ Real-time Processing: Async backend for concurrent request handling
  • πŸ“ˆ Scalable Architecture: Designed to handle multiple users
  • 🎨 Modern UI/UX: Clean, intuitive chat interface
  • πŸ”— Citation System: Provides sources for all information
  • πŸ“Š Vector Indexing: Efficient similarity search across knowledge base
  • πŸ› οΈ API-First Design: RESTful API for integration possibilities

πŸ“ˆ Project Stats

Metric Value
Penn Clubs Indexed 1,399+
Knowledge Base Entries 10,000+
Response Time < 2 seconds
SSL Certificate Grade A+
Uptime 99.9%
Supported Domains 3

🀝 Contributing

We welcome contributions to make PennGPT even better!

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/amazing-feature)
  3. πŸ’Ύ Commit your changes (git commit -m 'Add amazing feature')
  4. πŸ“€ Push to the branch (git push origin feature/amazing-feature)
  5. πŸ”„ Open a Pull Request

πŸ“‹ API Documentation

Endpoints

Method Endpoint Description
POST /chat Main chat interface
GET /health Service health check
GET /docs Interactive API documentation

Request Parameters

Chat Endpoint:

  • messages: Array of conversation messages
  • top_k: Number of knowledge base results to retrieve (default: 5)
  • session_id: Optional session identifier for conversation tracking

πŸ“ž Support & Contact


πŸŽ“ Built with ❀️ for the University of Pennsylvania community

UPenn

Empowering Penn students, faculty, and staff with AI-powered assistance

About

Agora PennApps 2025 Team!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors