By Sagar Shankaran, Founder of CallSphere
Build a campus navigation AI agent that provides building directions, helps find rooms, integrates with event calendars, and delivers facility information to students, staff, and visitors.
Key takeaways
University campuses are small cities. With dozens of buildings, multiple floors, renamed halls, construction detours, and hundreds of events, even returning students get lost. A campus navigation agent serves students, faculty, and visitors by providing directions, locating rooms, surfacing upcoming events, and sharing facility details like operating hours and accessibility information.
The foundation is a structured representation of buildings, rooms, and events.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
flowchart LR
INPUT(["User intent"])
PARSE["Parse plus<br/>classify"]
PLAN["Plan and tool<br/>selection"]
AGENT["Agent loop<br/>LLM plus tools"]
GUARD{"Guardrails<br/>and policy"}
EXEC["Execute and<br/>verify result"]
OBS[("Trace and metrics")]
OUT(["Outcome plus<br/>next action"])
INPUT --> PARSE --> PLAN --> AGENT --> GUARD
GUARD -->|Pass| EXEC --> OUT
GUARD -->|Fail| AGENT
AGENT --> OBS
style AGENT fill:#4f46e5,stroke:#4338ca,color:#fff
style GUARD fill:#f59e0b,stroke:#d97706,color:#1f2937
style OBS fill:#ede9fe,stroke:#7c3aed,color:#1e1b4b
style OUT fill:#059669,stroke:#047857,color:#fff
from dataclasses import dataclass, field
from enum import Enum
from datetime import datetime, time
from typing import Optional
class BuildingType(Enum):
ACADEMIC = "academic"
ADMINISTRATIVE = "administrative"
RESIDENTIAL = "residential"
ATHLETIC = "athletic"
LIBRARY = "library"
DINING = "dining"
PARKING = "parking"
class AccessibilityFeature(Enum):
ELEVATOR = "elevator"
RAMP = "ramp"
AUTOMATIC_DOORS = "automatic_doors"
BRAILLE_SIGNAGE = "braille_signage"
ACCESSIBLE_RESTROOM = "accessible_restroom"
@dataclass
class GeoPoint:
latitude: float
longitude: float
@dataclass
class Building:
building_id: str
name: str
short_name: str
building_type: BuildingType
location: GeoPoint
floors: int
address: str
accessibility: list[AccessibilityFeature] = field(
default_factory=list
)
departments: list[str] = field(default_factory=list)
open_time: Optional[time] = None
close_time: Optional[time] = None
image_url: str = ""
notes: str = ""
@dataclass
class Room:
room_id: str
building_id: str
floor: int
room_number: str
room_type: str # lecture hall, lab, office, etc.
capacity: int = 0
equipment: list[str] = field(default_factory=list)
@dataclass
class CampusEvent:
event_id: str
title: str
description: str
building_id: str
room_id: Optional[str]
start_time: datetime
end_time: datetime
category: str
organizer: str
is_public: bool = True
For campus navigation, we need a function that calculates walking directions between buildings.
import math
BUILDINGS: dict[str, Building] = {}
ROOMS: dict[str, Room] = {}
EVENTS: list[CampusEvent] = []
# Pre-defined walking paths between building pairs
WALKING_PATHS: dict[tuple[str, str], list[str]] = {}
def haversine_distance(p1: GeoPoint, p2: GeoPoint) -> float:
"""Calculate distance in meters between two GPS coordinates."""
R = 6371000 # Earth radius in meters
lat1, lat2 = math.radians(p1.latitude), math.radians(p2.latitude)
dlat = math.radians(p2.latitude - p1.latitude)
dlon = math.radians(p2.longitude - p1.longitude)
a = (math.sin(dlat / 2) ** 2
+ math.cos(lat1) * math.cos(lat2)
* math.sin(dlon / 2) ** 2)
return R * 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a))
def get_directions(
from_building_id: str, to_building_id: str
) -> dict:
from_bld = BUILDINGS.get(from_building_id)
to_bld = BUILDINGS.get(to_building_id)
if not from_bld or not to_bld:
return {"error": "Building not found"}
distance = haversine_distance(from_bld.location, to_bld.location)
walk_minutes = round(distance / 80) # ~80 m/min walking
path_key = (from_building_id, to_building_id)
steps = WALKING_PATHS.get(
path_key,
[f"Head toward {to_bld.name} from {from_bld.name}"]
)
return {
"from": from_bld.name,
"to": to_bld.name,
"distance_meters": round(distance),
"walking_minutes": max(1, walk_minutes),
"steps": steps,
"destination_address": to_bld.address,
}
from agents import Agent, function_tool, Runner
import json
@function_tool
def find_building(query: str) -> str:
"""Find a building by name, short name, or department."""
query_lower = query.lower()
matches = []
for bld in BUILDINGS.values():
if (query_lower in bld.name.lower()
or query_lower in bld.short_name.lower()
or any(query_lower in d.lower()
for d in bld.departments)):
matches.append({
"id": bld.building_id,
"name": bld.name,
"type": bld.building_type.value,
"floors": bld.floors,
"departments": bld.departments,
"hours": (
f"{bld.open_time}-{bld.close_time}"
if bld.open_time else "24/7"
),
"accessibility": [
a.value for a in bld.accessibility
],
})
return json.dumps(matches) if matches else "No buildings found."
@function_tool
def find_room(building_name: str, room_number: str) -> str:
"""Find a specific room within a building."""
for room in ROOMS.values():
bld = BUILDINGS.get(room.building_id)
if not bld:
continue
if (building_name.lower() in bld.name.lower()
and room_number in room.room_number):
return json.dumps({
"building": bld.name,
"room": room.room_number,
"floor": room.floor,
"type": room.room_type,
"capacity": room.capacity,
"equipment": room.equipment,
"directions": f"Enter {bld.name}, go to floor "
f"{room.floor}, room {room.room_number}",
})
return "Room not found. Check the building name and room number."
@function_tool
def get_upcoming_events(
category: str = "", building_id: str = ""
) -> str:
"""Get upcoming campus events, optionally filtered."""
now = datetime.now()
upcoming = []
for event in EVENTS:
if event.start_time < now or not event.is_public:
continue
if category and category.lower() not in event.category.lower():
continue
if building_id and event.building_id != building_id:
continue
bld = BUILDINGS.get(event.building_id)
upcoming.append({
"title": event.title,
"when": event.start_time.strftime("%B %d at %I:%M %p"),
"where": bld.name if bld else "TBD",
"category": event.category,
"organizer": event.organizer,
})
upcoming.sort(key=lambda e: e["when"])
return json.dumps(upcoming[:10]) if upcoming else "No upcoming events."
campus_agent = Agent(
name="Campus Navigator",
instructions="""You are a campus navigation assistant. Help
people find buildings, locate rooms, get walking directions,
and discover campus events. Always mention accessibility
features when giving directions. If someone seems lost,
ask where they are starting from to give accurate directions.
Share building hours proactively so visitors do not arrive
to a closed building.""",
tools=[find_building, find_room, get_upcoming_events],
)
Add a closures list to the Building model with start/end dates and detour instructions. Before giving directions, the agent checks for active closures and automatically reroutes. It can also proactively warn users about upcoming closures that might affect their route.
Yes. Replace the haversine calculation with calls to Google Maps, Mapbox, or OpenStreetMap APIs for turn-by-turn walking directions. Indoor navigation can use Bluetooth beacons or WiFi positioning with APIs from Mappedin or Meridian.
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.
Model each entrance as a sub-location with its own GPS coordinates and an entrance_type field (main, side, accessible, loading). The directions tool selects the entrance closest to the user starting point, prioritizing accessible entrances when accessibility features are relevant.
#AIAgents #EdTech #CampusNavigation #Python #Geolocation #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 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 founder's guide to the personal AI assistant market: best AI assistant apps, business-grade options, and how CallSphere's voice agent fits in.
A founder's guide to free AI agents, low-code AI agent builders, and how to know when you should pay for a real platform like CallSphere.
Graphiti is the open-source temporal knowledge graph for AI agents in 2026. Learn how bi-temporal memory beats vector RAG for voice agents and long-running LLMs.
Chatbot app vs ChatGPT in 2026: a founder's clear take on the difference, when to use which, and how a real AI chatbot app development works.
How we built a fault-tolerant HVAC emergency triage and tech-dispatch platform on Kubernetes — three-tier CQRS, 11 micro-agents on the OpenAI Agents SDK + LangGraph, NATS JetStream, DTMF/SMS/WebSocket acceptance, circuit breakers, and an evaluation pipeline that catches regressions before they wake a tech at 3 AM.
© 2026 CallSphere Inc. All rights reserved.
Made within San Francisco