An intelligent course management system that automates syllabus operations, weekly pacing, and student triage using AI-powered multi-agent routing. Think of it as a "TA in a box" that handles routine course questions while intelligently escalating complex issues to the professor.
ProfAI is designed to manage course operations rather than just teaching content. It acts as a smart assistant that:
- Answers student questions about course policies, concepts, and schedules
- Automatically triages queries to determine if they need professor attention
- Generates weekly announcements based on course schedules
- Provides insights to professors about student confusions and concerns
The system uses a human-in-the-loop approach where AI handles routine tasks and escalates complex or sensitive issues to the professor.
- Framework: Next.js 14+ (App Router) with TypeScript
- Styling: Tailwind CSS + Shadcn/UI components
- Backend: Supabase (PostgreSQL + Auth + Edge Functions)
- AI: Google Gemini via LangChain
- Vector DB: Supabase Vector (pgvector) for RAG
- State Management: React Server Components + useOptimistic for chat
-
Multi-Agent Router: Classifies student queries into three categories:
- POLICY (Syllabus questions) β Routes to Syllabus Agent
- CONCEPT (Learning questions) β Routes to Concept Agent
- ESCALATE (Personal/Complex issues) β Creates escalation for professor
-
RAG (Retrieval-Augmented Generation):
- Chunks syllabus and course content into vector embeddings
- Retrieves relevant context for accurate responses
- Provides source citations (e.g., "See Syllabus page 4")
-
Sunday Night Conductor:
- Automated weekly announcement generator
- Reads course schedule and generates week-specific announcements
- Creates drafts for professor review and approval
- Ask questions about the course in natural language
- Receive instant responses with source citations
- Get answers about:
- Course policies (deadlines, grading, attendance)
- Course concepts and materials
- Weekly schedules and upcoming assignments
- Personal issues (e.g., "I'm sick, can I have an extension?") automatically create escalation tickets
- Students receive confirmation when their query has been escalated
- All sensitive queries are flagged for professor review
1. Announcement Drafts Widget
- View automatically generated weekly announcements
- Review and edit before publishing
- Approve announcements to publish them to students
2. Escalation Queue
- See all student queries that need personal attention
- View student name, email, query text, and timestamp
- Resolve escalations after addressing student concerns
3. Pulse Report
- 3-bullet summary of "Top Student Confusions"
- Based on analysis of chat logs
- Helps professors identify topics that need clarification
- Shows total queries and escalation counts
- Trigger Sunday Night Conductor manually to generate announcements
- View and manage all course content
- Monitor system activity and student engagement
The Agent Router uses AI to classify each student query:
-
POLICY: Questions about syllabus, deadlines, grading policies
- Example: "When is the midterm?"
- Routes to: Syllabus Agent (RAG over syllabus content)
-
CONCEPT: Questions about course material, lectures, concepts
- Example: "Can you explain recursion?"
- Routes to: Concept Agent (RAG over lecture notes/content)
-
ESCALATE: Personal, complex, or sensitive issues
- Example: "I'm having personal issues and need an extension"
- Routes to: Escalation Handler (creates ticket for professor)
Every AI response includes citations:
- "See Syllabus page 4, section 2.3"
- "See Lecture Week 5, slide 12"
- Helps students verify information and find original sources
- If the AI can't find relevant information in the course materials
- If retrieval confidence is low (< 0.7)
- Automatically escalates to professor rather than hallucinating answers
- Login/Signup β Student creates account or logs in
- Onboarding (First-time only) β Professor uploads syllabus PDF and schedule CSV
- Chat Interface β Student asks questions in natural language
- Get Response β Receives answer with citations or escalation confirmation
- View Escalations β Can see status of escalated queries
- Login/Signup β Professor creates account with professor role
- Course Setup β Upload syllabus PDF and schedule CSV
- Weekly Routine:
- Review and approve Sunday Night Conductor announcements
- Check Escalation Queue for student issues
- Review Pulse Report for insights
- Ongoing Management:
- Resolve escalations
- Edit and publish announcements
- Monitor student questions and confusion patterns
- Automated Trigger β Runs every Sunday night (or manually triggered)
- Schedule Analysis β Reads course schedule to determine current week
- Announcement Generation β AI generates week-specific announcement in professor's persona
- Draft Creation β Saves announcement as draft in professor dashboard
- Professor Review β Professor reviews, edits, and approves announcement
- Publication β Approved announcement is published to students
User Query
β
Agent Router (Classification)
β
ββββββββββββ¬βββββββββββ¬βββββββββββ
β POLICY β CONCEPT β ESCALATE β
β Agent β Agent β Handler β
β β β β
β RAG over β RAG over β Creates β
β Syllabus β Lectures β Ticket β
ββββββββββββ΄βββββββββββ΄βββββββββββ
β
Response with Citations
- profiles: User accounts (students/professors)
- courses: Course metadata
- course_content: Chunked syllabus/lecture content with vector embeddings
- schedules: Weekly schedule data (from CSV)
- escalations: Student escalation queue
- announcements: Weekly announcements (drafts + published)
- chat_logs: Chat history for analytics
POST /api/chat- Send chat message, receive AI responseGET /api/announcements- Get published announcements
GET /api/escalations- Get escalation queueGET /api/announcements- Get all announcements (drafts + published)POST /api/announcements- Create announcementPUT /api/announcements/:id- Update/publish announcementPOST /api/conductor- Trigger Sunday Night ConductorGET /api/pulse- Get pulse report data
POST /api/upload- Upload syllabus PDF and schedule CSV
- Node.js 18+ and npm
- Supabase account
- Google Cloud account (for Gemini API)
-
Clone the repository
git clone https://github.com/A5bhinav/SyllabusOS.git cd SyllabusOS -
Install dependencies
npm install
-
Set up environment variables
Copy
.env.exampleto.envand fill in your credentials:# Supabase Configuration NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key # Google Gemini AI Configuration GOOGLE_GENAI_API_KEY=your_google_gemini_api_key # Application Configuration MOCK_MODE=false # Set to true for development (saves API costs) DEMO_MODE=false # Set to true to mock system time to Week 4 DEMO_WEEK=4
-
Set up Supabase
- Create a new Supabase project
- Run database migrations (see
supabase/migrations/) - Enable pgvector extension
-
Run development server
npm run dev
Open http://localhost:3000 in your browser.
Set MOCK_MODE=true in your .env file to:
- Skip actual API calls to Gemini
- Return mock responses for testing
- Save costs during development
- Test UI without API dependencies
Set DEMO_MODE=true and DEMO_WEEK=4 to:
- Mock system time to a specific week
- Test Sunday Night Conductor logic
- Demo the app without waiting for real time
ProfAI/
βββ app/ # Next.js App Router
β βββ api/ # API Routes
β β βββ chat/ # Chat endpoint
β β βββ upload/ # File upload handler
β β βββ conductor/ # Sunday Night Conductor trigger
β β βββ escalations/ # Escalation CRUD
β β βββ announcements/ # Announcement CRUD
β β βββ pulse/ # Pulse report data
β βββ (auth)/ # Auth routes
β βββ (dashboard)/ # Dashboard routes
β β βββ student/ # Student dashboard
β β βββ professor/ # Professor dashboard
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ ui/ # Shadcn/UI components
β βββ student/ # Student-specific components
β βββ professor/ # Professor-specific components
β βββ shared/ # Shared components
βββ lib/
β βββ agents/ # Multi-agent router
β β βββ router.ts # AgentRouter (classifies queries)
β β βββ syllabus-agent.ts # POLICY agent
β β βββ concept-agent.ts # CONCEPT agent
β β βββ escalation-handler.ts # ESCALATE handler
β βββ rag/ # RAG implementation
β β βββ vector-store.ts # Vector store client
β β βββ chunking.ts # Document chunking logic
β β βββ retrieval.ts # Retrieval logic
β βββ conductor/ # Sunday Night Conductor
β β βββ sunday-conductor.ts
β βββ ai/ # AI client abstraction
β β βββ client.ts # Gemini AI client
β β βββ langchain-setup.ts
β βββ supabase/ # Supabase client setup
β β βββ client.ts # Client-side client
β β βββ server.ts # Server-side client
β βββ utils/ # Utility functions
βββ supabase/
β βββ migrations/ # Database migrations
β βββ functions/ # Edge Functions
β βββ sunday-conductor/
βββ types/ # TypeScript types
βββ docs/ # Project documentation
Student asks: "When is the midterm exam?"
System response:
- Agent Router classifies as POLICY
- Routes to Syllabus Agent
- Retrieves relevant syllabus section via RAG
- Returns: "The midterm exam is scheduled for October 15th, 2024. See Syllabus page 8, section 4.2."
Student asks: "Can you explain how binary search works?"
System response:
- Agent Router classifies as CONCEPT
- Routes to Concept Agent
- Retrieves relevant lecture content via RAG
- Returns: "Binary search is a divide-and-conquer algorithm... See Lecture Week 6, slide 15."
Student asks: "I'm experiencing a family emergency and won't be able to submit the assignment on time."
System response:
- Agent Router classifies as ESCALATE
- Routes to Escalation Handler
- Creates escalation ticket in database
- Returns: "I understand your situation. Your request has been escalated to the professor for review. You'll receive a response within 24-48 hours."
Every Sunday at 11 PM:
- System checks course schedule
- Determines it's Week 5
- Generates announcement: "Welcome to Week 5! This week we'll be covering recursion and data structures. Don't forget the assignment is due Friday at 11:59 PM..."
- Saves as draft for professor review
- Professor approves and publishes Monday morning
This project is designed for a 2-person team:
- Lead Architect (Backend): Multi-Agent Router, RAG implementation, Sunday Night Conductor logic
- UI/UX Specialist (Frontend): Student/Professor Dashboards, Escalation Queue UI, component design
The architecture allows parallel development with clear API contracts.
ISC
Built with Next.js, Supabase, Google Gemini, and LangChain.