By Sagar Shankaran, Founder of CallSphere
Build an AI enrollment agent that helps students register for courses, checks prerequisites, optimizes class schedules, and routes complex advising questions to human advisors.
Key takeaways
Course registration week is chaos at most universities. Students compete for limited seats, struggle with prerequisite chains, build schedules with time conflicts, and flood advisor inboxes with questions. An AI enrollment agent can resolve the majority of these issues instantly by checking prerequisites, detecting conflicts, suggesting alternatives, and only escalating genuinely complex cases to human advisors.
A robust enrollment agent needs a well-structured course catalog with prerequisite relationships.
flowchart LR
CALLER(["Student or Parent"])
subgraph TEL["Telephony"]
SIP["Twilio SIP and PSTN"]
end
subgraph BRAIN["Education AI Agent"]
STT["Streaming STT<br/>Deepgram or Whisper"]
NLU{"Intent and<br/>Entity Extraction"}
TOOLS["Tool Calls"]
TTS["Streaming TTS<br/>ElevenLabs or Rime"]
end
subgraph DATA["Live Data Plane"]
CRM[("CRM and Notes")]
CAL[("Calendar and<br/>Schedule")]
KB[("Knowledge Base<br/>and Policies")]
end
subgraph OUT["Outcomes"]
O1(["Enrollment captured"])
O2(["Tour scheduled"])
O3(["Counselor callback"])
end
CALLER --> SIP --> STT --> NLU
NLU -->|Lookup| TOOLS
TOOLS <--> CRM
TOOLS <--> CAL
TOOLS <--> KB
NLU --> TTS --> SIP --> CALLER
NLU -->|Resolved| O1
NLU -->|Schedule| O2
NLU -->|Escalate| O3
style CALLER fill:#f1f5f9,stroke:#64748b,color:#0f172a
style NLU fill:#4f46e5,stroke:#4338ca,color:#fff
style O1 fill:#059669,stroke:#047857,color:#fff
style O2 fill:#0ea5e9,stroke:#0369a1,color:#fff
style O3 fill:#f59e0b,stroke:#d97706,color:#1f2937
from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
class DayOfWeek(Enum):
MON = "Monday"
TUE = "Tuesday"
WED = "Wednesday"
THU = "Thursday"
FRI = "Friday"
@dataclass
class TimeSlot:
days: list[DayOfWeek]
start_hour: int # 24-hour format
start_minute: int
end_hour: int
end_minute: int
def overlaps(self, other: "TimeSlot") -> bool:
shared_days = set(self.days) & set(other.days)
if not shared_days:
return False
self_start = self.start_hour * 60 + self.start_minute
self_end = self.end_hour * 60 + self.end_minute
other_start = other.start_hour * 60 + other.start_minute
other_end = other.end_hour * 60 + other.end_minute
return self_start < other_end and other_start < self_end
@dataclass
class Course:
code: str
title: str
credits: int
department: str
prerequisites: list[str] = field(default_factory=list)
corequisites: list[str] = field(default_factory=list)
max_enrollment: int = 30
current_enrollment: int = 0
time_slot: Optional[TimeSlot] = None
instructor: str = ""
description: str = ""
@property
def seats_available(self) -> int:
return self.max_enrollment - self.current_enrollment
@property
def is_full(self) -> bool:
return self.current_enrollment >= self.max_enrollment
@dataclass
class StudentRecord:
student_id: str
name: str
major: str
completed_courses: list[str] = field(default_factory=list)
current_schedule: list[str] = field(default_factory=list)
credits_completed: int = 0
max_credits_per_semester: int = 18
The most critical function is verifying that a student meets all prerequisites before registering.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
COURSE_CATALOG: dict[str, Course] = {}
STUDENT_RECORDS: dict[str, StudentRecord] = {}
def check_prerequisites(
student_id: str, course_code: str
) -> dict:
student = STUDENT_RECORDS.get(student_id)
course = COURSE_CATALOG.get(course_code)
if not student or not course:
return {"eligible": False, "reason": "Student or course not found"}
missing_prereqs = [
prereq for prereq in course.prerequisites
if prereq not in student.completed_courses
]
if missing_prereqs:
return {
"eligible": False,
"reason": "Missing prerequisites",
"missing": missing_prereqs,
"suggestion": f"Complete {', '.join(missing_prereqs)} first",
}
current_credits = sum(
COURSE_CATALOG[c].credits
for c in student.current_schedule
if c in COURSE_CATALOG
)
if current_credits + course.credits > student.max_credits_per_semester:
return {
"eligible": False,
"reason": "Would exceed maximum credit limit",
"current_credits": current_credits,
"course_credits": course.credits,
"max_allowed": student.max_credits_per_semester,
}
return {"eligible": True, "reason": "All prerequisites met"}
Before adding a course, the agent must verify there are no time conflicts.
def detect_schedule_conflicts(
student_id: str, new_course_code: str
) -> list[dict]:
student = STUDENT_RECORDS.get(student_id)
new_course = COURSE_CATALOG.get(new_course_code)
if not student or not new_course or not new_course.time_slot:
return []
conflicts = []
for enrolled_code in student.current_schedule:
enrolled = COURSE_CATALOG.get(enrolled_code)
if not enrolled or not enrolled.time_slot:
continue
if enrolled.time_slot.overlaps(new_course.time_slot):
conflicts.append({
"conflicting_course": enrolled.code,
"conflicting_title": enrolled.title,
"conflicting_time": f"{enrolled.time_slot.days} "
f"{enrolled.time_slot.start_hour}:"
f"{enrolled.time_slot.start_minute:02d}",
})
return conflicts
from agents import Agent, function_tool, Runner
import json
@function_tool
def search_courses(department: str, keyword: str = "") -> str:
"""Search the course catalog by department and optional keyword."""
results = []
for code, course in COURSE_CATALOG.items():
if course.department.lower() != department.lower():
continue
if keyword and keyword.lower() not in course.title.lower():
continue
results.append({
"code": code,
"title": course.title,
"credits": course.credits,
"seats_available": course.seats_available,
"instructor": course.instructor,
})
return json.dumps(results) if results else "No courses found."
@function_tool
def register_for_course(student_id: str, course_code: str) -> str:
"""Attempt to register a student for a course after all checks."""
prereq_result = check_prerequisites(student_id, course_code)
if not prereq_result["eligible"]:
return json.dumps(prereq_result)
course = COURSE_CATALOG[course_code]
if course.is_full:
return json.dumps({
"registered": False,
"reason": "Course is full",
"waitlist_available": True,
})
conflicts = detect_schedule_conflicts(student_id, course_code)
if conflicts:
return json.dumps({
"registered": False,
"reason": "Schedule conflict detected",
"conflicts": conflicts,
})
student = STUDENT_RECORDS[student_id]
student.current_schedule.append(course_code)
course.current_enrollment += 1
return json.dumps({
"registered": True,
"course": course.title,
"updated_schedule": student.current_schedule,
})
enrollment_agent = Agent(
name="Enrollment Advisor",
instructions="""You are a university enrollment advisor agent.
Help students search for courses, check prerequisites, register
for classes, and build conflict-free schedules. When a student
cannot register, explain why clearly and suggest alternatives.
If a question requires human judgment (academic probation,
override requests, degree audits), say you will route to a
human advisor.""",
tools=[search_courses, register_for_course],
)
Add a waitlist data structure that tracks position and automatically enrolls students when seats open. The agent tool returns the waitlist position and estimated chance of getting in based on historical drop rates for that course.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
No. The agent handles routine tasks — prerequisite checks, schedule building, course search — freeing advisors for complex decisions like degree pathway planning, academic probation guidance, and career counseling. The agent should always route nuanced questions to human advisors.
Model cross-listed courses as separate entries sharing a linked_course_group field. When a student registers for one section, the agent checks enrollment across all linked sections. Lab sections use a corequisite relationship so the agent enforces paired enrollment.
#AIAgents #EdTech #CourseRegistration #Python #Education #AgenticAI #LearnAI #AIEngineering

Written by
Sagar Shankaran· Founder, CallSphere
LinkedInSagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
A how-to for Colombian education and tutoring SMBs to answer parents and students instantly, book trial classes 24/7 in Spanish and English, and grow enrollment with a CallSphere AI agent.
Kenyan clinics and education providers lose patients and students to busy phone lines. Here is how CallSphere AI voice and chat agents book every appointment 24/7 in English and Swahili, DPA-aware.
How Philippine clinics and tutoring centers in Manila, Cebu, and Davao use CallSphere AI voice and chat agents to answer every Taglish enquiry 24/7 and fill their schedules — Data Privacy Act ready.
A how-to guide for Bangladeshi coaching centres, edtech startups, and schools on using a CallSphere AI voice + chat agent to answer every admission enquiry in Bengali and English during peak season.
A step-by-step guide for coaching centres, tutoring services, and edtech brands in Kota, Delhi, and Bengaluru to capture every admission enquiry with CallSphere AI voice + chat agents in Hindi and regional languages.
A founder's guide to the personal AI assistant market: best AI assistant apps, business-grade options, and how CallSphere's voice agent fits in.
© 2026 CallSphere Inc. All rights reserved.
Made within San Francisco