|
| 1 | +--- |
| 2 | +title: CityPulse - AI-Powered Geospatial Discovery Search |
| 3 | +description: Real-time local discovery search using Perplexity AI for personalized location insights and recommendations |
| 4 | +sidebar_position: 2 |
| 5 | +keywords: [perplexity, geospatial, location, real-time, maps, local-discovery, sonar] |
| 6 | +--- |
| 7 | + |
| 8 | +# CityPulse - AI-Powered Geospatial Discovery |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +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. |
| 13 | + |
| 14 | +[](https://youtu.be/Y0UIhh3diJg) |
| 15 | + |
| 16 | +## What CityPulse Does |
| 17 | + |
| 18 | +- **Real-time local discovery** - Find current events, restaurants, and local alerts near any location |
| 19 | +- **AI-powered search suggestions** - Get intelligent search recommendations as you type |
| 20 | +- **Personalized insights** - Receive AI-generated advice on what to try, best times to visit, and pro tips |
| 21 | +- **Interactive mapping** - Explore results on an interactive map with custom markers and detailed popups |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +## How It Uses Perplexity Sonar |
| 26 | + |
| 27 | +CityPulse leverages two key Perplexity models: |
| 28 | + |
| 29 | +**Sonar for Real-Time Data** |
| 30 | +```python |
| 31 | +# Get current local information with geographic context |
| 32 | +response = client.chat.completions.create( |
| 33 | + model="sonar", |
| 34 | + messages=[{ |
| 35 | + "role": "user", |
| 36 | + "content": f"Find current events, restaurants, and alerts near {lat}, {lng}" |
| 37 | + }], |
| 38 | + response_format={"type": "json_schema", "json_schema": {"schema": LOCAL_INFO_SCHEMA}} |
| 39 | +) |
| 40 | +``` |
| 41 | + |
| 42 | +**Sonar Reasoning for Personalized Insights** |
| 43 | +```python |
| 44 | +# Generate AI-powered location recommendations |
| 45 | +response = client.chat.completions.create( |
| 46 | + model="sonar-reasoning", |
| 47 | + messages=[{ |
| 48 | + "role": "user", |
| 49 | + "content": f"Provide personalized insights for {location_name}: what to try, best times to visit, pro tips" |
| 50 | + }] |
| 51 | +) |
| 52 | +``` |
| 53 | + |
| 54 | +The app uses structured JSON schemas to ensure consistent data formatting and includes citation tracking for source verification. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +## Links |
| 59 | + |
| 60 | +- [GitHub Repository](https://github.com/anevsky/CityPulse) |
| 61 | +- [Live Demo](https://citypulse-ppx.uc.r.appspot.com/) |
| 62 | +- [Video Demo](https://youtu.be/Y0UIhh3diJg) |
| 63 | +- **[Built with ❤️ by Alex Nevsky](https://alexnevsky.com)** |
0 commit comments