Skip to content

jerrryw/UMD_Claude_Hackathon_TAura

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI Teaching Assistant Platform

A comprehensive AI-powered teaching assistant platform that enables instructors to create course-specific AI TAs trained on their materials, with built-in academic integrity policies and rich analytics.

Features

Core Features

  • RAG-based Q&A: Retrieval-Augmented Generation scoped to course materials
  • Document Ingestion: PDF → text → chunk → embed → store pipeline
  • Claude Integration: Powered by Anthropic's Claude for intelligent, contextual answers
  • Citations: All answers include source references with page numbers
  • Academic Integrity: Built-in policy enforcement (no full solutions, no exam help)

Instructor Dashboard

  • Course Management: Create courses with name, code, and term
  • Material Upload: Upload syllabus, lectures, assignments, transcripts (PDF)
  • Policy Configuration: Define allowed/disallowed topics and custom rules
  • TA Personas: Choose from 3 tone packs:
    • Policy-First (professional, clear boundaries)
    • Friendly Explainer (warm and encouraging)
    • Scaffolded/Tutoring (Socratic method)
  • TA Simulator: Test how the TA responds to questions before publishing
  • Coverage Check: Identify gaps between student questions and uploaded materials
  • Lecture Summarizer: Generate study packs with key points and practice questions
  • Syllabus Extraction: Auto-extract office hours, email, policies from syllabus
  • Analytics Dashboard:
    • Q&A logs with sources
    • Refusal tracking (academic integrity violations)
    • Topic clustering
    • End-of-term reports

Student Interface

  • Course Selection: Browse and select published courses
  • Chat Interface: Ask questions about course content
  • Citations: See which documents/pages answers come from
  • Difficulty Toggle: "I'm new to this" for simplified explanations
  • Follow-up Suggestions: Quick buttons for common follow-ups
  • Quick Info: Fast access to office hours, late policy, etc.

Tech Stack

Backend

  • FastAPI: Modern Python web framework
  • SQLAlchemy: ORM for database operations
  • SQLite: Database (easily upgradable to PostgreSQL)
  • Anthropic Claude: AI answer generation
  • Sentence Transformers: Text embeddings for RAG
  • PyPDF2: PDF text extraction

Frontend

  • React 18: UI library
  • TypeScript: Type safety
  • Vite: Build tool
  • Zustand: State management
  • React Router: Navigation

Setup Instructions

Prerequisites

  • Python 3.9+
  • Node.js 18+
  • Anthropic API key

Backend Setup

  1. Navigate to backend directory:
cd backend
  1. Create virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create .env file:
cp .env.example .env
  1. Edit .env and add your Anthropic API key:
ANTHROPIC_API_KEY=your_api_key_here
SECRET_KEY=your_secret_key_here
  1. Run the backend:
python main.py

The API will be available at http://localhost:8000

  • API docs: http://localhost:8000/docs

Frontend Setup

  1. Navigate to frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Run the development server:
npm run dev

The app will be available at http://localhost:3000

Usage Guide

For Instructors

  1. Register as an instructor at /register
  2. Create a course with name, code, and term
  3. Upload materials:
    • Syllabus (auto-extracts key info)
    • Lecture slides
    • Assignments
    • Transcripts
  4. Configure settings:
    • Choose TA persona
    • Set policies and rules
    • Define allowed/disallowed topics
  5. Test with simulator to see how the TA responds
  6. Publish course to make it available to students
  7. Monitor analytics to see questions, refusals, and coverage gaps

For Students

  1. Register as a student at /register
  2. Select a course from available published courses
  3. Ask questions about course content
  4. Toggle "I'm new to this" for simplified explanations
  5. View citations to see where answers come from
  6. Use follow-up suggestions for deeper exploration

Architecture

Data Flow

  1. Ingestion Pipeline:

    PDF Upload → Text Extraction → Chunking → Embedding → Vector Storage
    
  2. Query Flow:

    Student Question → Embed Query → RAG Retrieval (filtered by course_id)
    → Build Context → Claude Generation → Answer + Citations
    
  3. Policy Enforcement:

    Question → Violation Detection → Refuse or Answer → Log
    

Database Schema

  • users: Instructors and students
  • courses: Course metadata and settings
  • materials: Uploaded files (PDFs)
  • material_chunks: Chunked text with embeddings
  • questions: Q&A logs with sources
  • coverage_gaps: Identified material gaps

API Endpoints

Authentication

  • POST /auth/register - Register new user
  • POST /auth/token - Login
  • GET /auth/me - Get current user

Courses (Instructor)

  • POST /courses/ - Create course
  • GET /courses/ - List courses
  • GET /courses/{id} - Get course details
  • PATCH /courses/{id} - Update course
  • POST /courses/{id}/materials - Upload material
  • GET /courses/{id}/materials - List materials
  • POST /courses/{id}/publish - Publish course

Chat (Student)

  • POST /chat/ - Ask question

Instructor Tools

  • POST /instructor/simulator - Test TA response
  • GET /instructor/courses/{id}/coverage-check - Check coverage gaps
  • POST /instructor/materials/{id}/study-pack - Generate study pack
  • GET /instructor/courses/{id}/analytics - Get analytics

Development

Run Tests

cd backend
pytest

Build for Production

Backend:

cd backend
gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker

Frontend:

cd frontend
npm run build

Security Features

  • JWT-based authentication
  • Password hashing with bcrypt
  • Role-based access control (instructor/student)
  • Academic integrity policy enforcement
  • Refusal logging for monitoring

Future Enhancements

  • Support for video transcripts
  • Multi-language support
  • Advanced topic clustering with ML
  • Integration with LMS (Canvas, Blackboard)
  • Mobile app
  • Voice input/output
  • Collaborative features (peer discussions)
  • Gamification (badges, leaderboards)

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License - see LICENSE file for details

Support

For questions or issues:

Acknowledgments

  • Anthropic Claude API
  • Sentence Transformers
  • FastAPI
  • React community

About

Claude Hackathon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •