CityPulse - AI-Powered Geospatial Discovery

CityPulse Main Interface CityPulse is an intelligent location-based discovery search that helps users explore what’s happening around them right now. It demonstrates how to create personalized, real-time local insights using Perplexity’s Sonar models. Demo Video

What CityPulse Does

  • Real-time local discovery - Find current events, restaurants, and local alerts near any location
  • AI-powered search suggestions - Get intelligent search recommendations as you type
  • Personalized insights - Receive AI-generated advice on what to try, best times to visit, and pro tips
  • Interactive mapping - Explore results on an interactive map with custom markers and detailed popups
Search Interface

How It Uses Perplexity Sonar

CityPulse leverages two key Perplexity models: Sonar for Real-Time Data
# Get current local information with geographic context
response = client.chat.completions.create(
    model="sonar",
    messages=[{
        "role": "user", 
        "content": f"Find current events, restaurants, and alerts near {lat}, {lng}"
    }],
    response_format={"type": "json_schema", "json_schema": {"schema": LOCAL_INFO_SCHEMA}}
)
Sonar Reasoning for Personalized Insights
# Generate AI-powered location recommendations
response = client.chat.completions.create(
    model="sonar-reasoning",
    messages=[{
        "role": "user",
        "content": f"Provide personalized insights for {location_name}: what to try, best times to visit, pro tips"
    }]
)
The app uses structured JSON schemas to ensure consistent data formatting and includes citation tracking for source verification. AI Insights