CityPulse - Smart City Engagement Platform

Inspiration

Living in Mumbai, I witnessed firsthand how citizens struggle to stay informed about their neighborhood. Important information about construction permits, safety alerts, and community issues is scattered across multiple government portals, social media, and news sources. Most people only discover critical changes in their area when it's too late - a new construction blocking their view, a road closure disrupting their commute, or a safety concern that could have been avoided.

I was inspired to create CityPulse after seeing my neighbor miss a crucial public hearing about a high-rise development next door because the permit notice was buried in a government website. This made me realize: What if AI could monitor the entire city's digital footprint and proactively alert citizens about what matters to them?

The Amazon Nova Hackathon presented the perfect opportunity to build this vision using cutting-edge multimodal AI that can understand text, images, and even automate web scraping to gather comprehensive city intelligence.

What it does

CityPulse is an AI-powered hyperlocal intelligence platform that monitors Mumbai's digital footprint 24/7 and provides actionable insights that actually affect your daily life. Unlike traditional chatbots or document processors, CityPulse is a proactive intelligence gathering system powered entirely by Amazon Nova AI models.

Core Features

  1. 🏗️ 3D Permits Visualization

    • Interactive 3D view of construction permits across Mumbai
    • Real-time data from MahaRERA and BMC portals
    • Click buildings to see permit details, timelines, and developer info
    • Powered by Amazon Nova Act for automated web scraping
  2. 🔔 Smart Alerts System

    • AI-prioritized safety notifications (1-10 scoring)
    • Real-time construction updates and road closures
    • Interactive map showing alert locations with clustering
    • Powered by Amazon Nova 2 Lite for intelligent alert ranking
  3. 👥 Community Pulse

    • Trending topics from social media and news (engagement-weighted)
    • Sentiment analysis of community discussions
    • Key concerns and celebrations identified
    • Powered by Amazon Nova 2 Lite for NLP and sentiment analysis
  4. 💰 Investment Insights

    • Trending neighborhoods for real estate investment
    • Development activity heatmaps with growth scores
    • Property value indicators and commercial trends
    • Powered by Amazon Nova 2 Lite for trend analysis
  5. ☀️ Morning Briefing

    • Personalized daily audio briefing (60-90 seconds)
    • News, permits, and community updates
    • Listen on-the-go with natural voice synthesis
    • Powered by Amazon Nova 2 Lite + Amazon Polly Neural TTS
  6. 🎙️ Voice AI Assistant

    • Ask questions in natural language (text or voice input)
    • RAG-powered answers from local data using Amazon Titan Embeddings
    • Audio responses with Amazon Polly Neural TTS
    • Semantic search with FAISS vector database
  7. 📊 User Dashboard

    • Track engagement across all features
    • View recent activity history
    • Personalized stats and insights

Multi-Agent Architecture

CityPulse uses 12 specialized AI agents working autonomously with automated 3-hour refresh cycles:

Phase 1: Data Collection (6 Agents)
├── 📰 News Synthesis Agent (Nova 2 Lite)
│   └── Aggregates local news, identifies trends
├── 🤖 Nova Act Permit Checker (Nova Act)
│   └── UI automation for permit extraction
├── 🏢 Permit Monitor Agent (Nova Act)
│   └── Scrapes MahaRERA real estate projects
├── 🏛️ BMC Ward Monitor (Nova Act)
│   └── Ward-level permit tracking from BMC
├── 👥 Social Listening Agent (Nova 2 Lite)
│   └── Monitors Reddit r/mumbai, r/india with sentiment
└── 📸 Visual Intelligence Agent (Nova 2 Omni)
    └── Analyzes construction photos, safety issues

Phase 2: User Features (6 Agents)
├── ☀️ Morning Briefing Agent (Nova 2 Lite + Polly)
│   └── Generates personalized daily audio briefings
├── 🔔 Smart Alerts Agent (Nova 2 Lite)
│   └── AI-powered alert prioritization (1-10 scoring)
├── 🛡️ Safety Intelligence Agent (Nova 2 Lite)
│   └── Real-time safety monitoring and alerts
├── 💰 Investment Insights Agent (Nova 2 Lite)
│   └── Development trend analysis and growth scoring
├── 🌆 Community Pulse Agent (Nova 2 Lite)
│   └── Trending topics & sentiment analysis
└── 🎙️ Voice Q&A Agent (Nova 2 Lite + Titan + Polly)
    └── RAG-powered natural language Q&A

Automation: Python scheduler runs all agents every 3 hours automatically
Cost Efficiency: Complete system runs for $0.0125 per execution (~2 minutes) - that's less than 2 cents!

How we built it

Technology Stack

AI & ML:

  • 🧠 Amazon Nova 2 Lite - Real-time reasoning and text generation (9 agents)
  • 🎨 Amazon Nova 2 Omni - Multimodal understanding for image analysis (1 agent)
  • 🤖 Amazon Nova Act - UI automation and web scraping (3 agents)
  • 🎙️ Amazon Polly Neural TTS - Natural voice synthesis
  • 🔍 Amazon Titan Embeddings v2 - Vector embeddings for RAG (1024 dimensions)
  • 📊 FAISS - Fast similarity search for semantic Q&A

Backend:

  • 🐍 Python 3.11 with Boto3 (AWS SDK)
  • 🌐 Flask 3.0 REST API
  • 🔄 Multi-agent orchestrator with parallel execution
  • 💾 JSON-based data storage (78 KB complete dataset)

Frontend:

  • 💻 Vanilla JavaScript (no framework overhead)
  • 🎨 Modern CSS with gradients and animations
  • 📱 Fully responsive design
  • 🗺️ Leaflet.js for interactive maps
  • 🎮 Three.js for 3D permit visualization

Infrastructure:

  • ☁️ AWS Bedrock for Nova models (us-east-1)
  • 🚀 Deployed on Render (backend) + Vercel (frontend)

Development Process

Phase 1: Core Data Collection (Week 1)

  • Built 6 autonomous agents for data gathering (not 4!)
  • Implemented real web scraping with Selenium for MahaRERA
  • Integrated Reddit API for social listening
  • Created image analysis pipeline with Nova 2 Omni
  • Added BMC Ward Monitor for ward-level permit tracking
  • Added Nova Act Permit Checker for UI automation
  • Challenge: Windows encoding issues with emoji characters
  • Solution: UTF-8 encoding fixes across all agents

Phase 2: User Features (Week 2)

  • Developed 6 user-facing features with Nova 2 Lite (not 5!)
  • Implemented engagement-weighted topic extraction
  • Created AI-powered alert prioritization (1-10 scoring)
  • Built voice briefing generation with Polly TTS
  • Added Voice Q&A system with RAG (Titan Embeddings + FAISS)
  • Challenge: Community Pulse showing generic topics like "mumbai", "bandra"
  • Solution: 7 iterations of improvements with stopword filtering, location filtering, and engagement weighting

Phase 3: Integration & Automation (Week 3)

  • Built master orchestrator for running all 12 agents
  • Implemented automated scheduler - runs every 3 hours
  • Implemented RAG Q&A system with Titan Embeddings + FAISS
  • Created interactive frontend with 7 pages
  • Fixed map interactivity issues (markers not clickable)
  • Challenge: Map tooltip disappeared when trying to click
  • Solution: Removed tooltip, used direct popup with proper event listeners

Phase 4: Deployment & Testing

  • Deployed backend to Render with AWS credentials
  • Deployed frontend to Vercel
  • Implemented caching system for cost optimization (66-88% savings)
  • Added comprehensive error handling and logging
  • Final Cost: $0.0125 per complete run (99.99% of $100 budget remaining!)

Key Technical Innovations

  1. Engagement-Weighted Topic Extraction

    # Weight keywords by community engagement
    engagement_score = upvotes + comments
    weight = max(1, engagement_score // 10)
    for word in keywords:
       topic_list.extend([word] * weight)
    

    Result: High-engagement topics naturally rise to the top

  2. AI-Powered Alert Prioritization

    • Nova 2 Lite scores each alert 1-10 based on severity, impact, and urgency
    • Combines multiple data sources (news, permits, social media)
    • Location-based filtering (2km radius)
  3. RAG Q&A System

    • Indexes all data with Titan Embeddings (1024-dim vectors)
    • FAISS for fast similarity search (10ms query time)
    • Nova 2 Lite generates contextual answers with source citations
  4. Cost Optimization

    • Caching system with TTL-based expiration
    • Parallel agent execution (reduces time by 3x)
    • Efficient prompts (minimal token usage)
    • Result: 8,000 complete runs possible with $100 budget

Challenges we ran into

1. Windows Encoding Hell 🔥

Problem: Agents crashed with UnicodeEncodeError when printing emoji characters on Windows (cp1252 encoding).

Solution:

# Global UTF-8 setting for all subprocesses
os.environ["PYTHONIOENCODING"] = "utf-8"

# Safe subprocess decoding
result = subprocess.run(
    [sys.executable, script],
    encoding='utf-8',
    errors='ignore'  # Prevents crashes
)

Impact: 100% success rate (12/12 agents) after fix

2. Community Pulse Quality Issues 🎯

Problem: Initial version showed generic topics like "mumbai", "bandra", "court" instead of meaningful civic topics.

Iterations:

  1. Added 40+ stopwords for filtering
  2. Added 15+ location names to stopwords
  3. Implemented engagement weighting (high-engagement posts contribute more)
  4. Enhanced Nova prompt to focus on civic topics (transport, housing, infrastructure)
  5. Capped engagement weighting at 5x (prevents viral post dominance)
  6. Added legal/news term filtering
  7. Created clean_word() helper function for efficiency

Result: 200% improvement in topic relevance - now shows "Metro Transport", "Housing", "Airport Connectivity"

3. Map Interactivity Nightmare 🗺️

Problem: Map markers showed "Click to view details" tooltip, but it disappeared when trying to click it.

Root Cause: Tooltip disappeared on mouse leave, preventing clicks.

Solution:

// Removed tooltip completely
// Changed to direct popup on marker click
marker.on('click', () => {
    marker.openPopup();
});

// Fixed inline onclick handlers (don't work in Leaflet)
map.on('popupopen', () => {
    setTimeout(() => {
        // Attach event listeners after DOM is ready
        document.querySelectorAll('.alert-item').forEach(item => {
            item.addEventListener('click', scrollToAlert);
        });
    }, 100);
});

Additional Fixes:

  • Defensive coding for undefined alert.message
  • Try-catch blocks to prevent one error from breaking all markers
  • Increased marker size from 30px to 40px for better clickability
  • Disabled double-click zoom on markers

Result: Fully functional map with clickable markers and popups

4. Cost Tracking Confusion 💰

Problem: Orchestrator showed all costs as "unknown" agent.

Root Cause: Inconsistent field names in cost log (agent_name vs agent vs operation).

Solution:

# Try multiple field names
agent = log.get('agent_name') or log.get('agent') or log.get('operation', 'unknown_agent')

Result: Clear per-agent cost breakdown showing Image Analysis as most expensive (52%)

5. RAG System Performance ⚡

Problem: RAG Q&A was too slow for real-time voice responses (3-5 seconds).

Solution: Implemented fast fallback system:

  • Load data from JSON files directly
  • Generate answers using template-based logic
  • Only use RAG for complex queries
  • Polly TTS generation in parallel (non-blocking)

Result: Voice responses in <2 seconds

Accomplishments that we're proud of

1. Complete Amazon Nova Showcase 🏆

We successfully utilized every Amazon Nova capability:

  • Nova 2 Lite - 9 agents for reasoning and text generation
  • Nova 2 Omni - Multimodal image analysis
  • Nova Act - UI automation for web scraping (3 agents)
  • Polly Neural TTS - Natural voice synthesis
  • Titan Embeddings - Vector search for RAG

2. Production-Ready Multi-Agent System 🤖

  • 12 autonomous agents working in parallel
  • Automated 3-hour refresh cycles with Python scheduler
  • 100% success rate after encoding fixes
  • Complete dataset generated in 2.4 minutes
  • Cost efficiency: $0.0125 per run (can support 8,000 runs with $100!)

3. Real-World Impact 🌍

  • Real data from MahaRERA, BMC, Reddit (not mock data)
  • Actionable insights that affect daily life
  • Proactive intelligence (not reactive chatbot)
  • Scalable to any city worldwide

4. Technical Excellence 💻

  • 7 iterations on Community Pulse for perfection (200% quality improvement)
  • Engagement-weighted topic extraction (novel approach)
  • RAG Q&A system with semantic search
  • Interactive 3D visualization of permits
  • Fully responsive frontend with modern design

5. Comprehensive Documentation 📚

  • 30+ markdown files documenting every feature
  • Complete API specifications for integration
  • Deployment guides for production
  • Cost analysis and optimization strategies

6. Budget Mastery 💰

Total Budget: $100.00
Used: $0.0125 (0.01%)
Remaining: $99.99 (99.99%)

This means we can run the complete system 8,000 times or provide daily updates for 21.9 years!

What we learned

1. Amazon Nova is Production-Ready 🚀

  • Nova 2 Lite is incredibly fast and cost-effective for text generation
  • Nova 2 Omni handles multimodal tasks beautifully (text + images)
  • Nova Act automates web scraping that would take hours manually
  • Bedrock API is reliable and well-documented

2. Multi-Agent Architecture is Powerful 🤖

  • Specialized agents are more effective than monolithic systems
  • Parallel execution reduces total time by 3x
  • Autonomous operation enables 24/7 monitoring
  • Clear separation of concerns improves maintainability

3. Iterative Development is Key 🔄

  • Community Pulse took 7 iterations to perfect
  • Each iteration improved quality by 20-30%
  • User feedback is invaluable (map interactivity issues)
  • Don't be afraid to refactor for quality

4. Cost Optimization Matters 💰

  • Engagement weighting prevents over-processing
  • Caching reduces costs by 66-88%
  • Efficient prompts save tokens
  • Monitoring per-agent costs enables targeted optimization

5. Cross-Platform Compatibility is Hard 🖥️

  • Windows encoding issues are real (cp1252 vs UTF-8)
  • Always test on target deployment platform
  • Defensive coding prevents cascading failures
  • Proper error handling is essential

6. Real Data > Mock Data 📊

  • Real MahaRERA permits provide actual value
  • Reddit API gives authentic community sentiment
  • Users can verify information independently
  • Builds trust and credibility

What's next for CityPulse

Short-term (Next 3 months)

  1. Multi-City Expansion 🌍

    • Extend to Delhi, Bangalore, Pune
    • City-specific data sources and regulations
    • Localized language support (Hindi, Marathi)
  2. Mobile App 📱

    • Native iOS and Android apps
    • Push notifications for critical alerts
    • Offline mode for cached data
    • Location-based auto-filtering
  3. Advanced Analytics 📊

    • Historical trend analysis
    • Predictive modeling for development patterns
    • Comparative neighborhood analysis
    • Investment ROI calculator
  4. User Personalization 👤

    • Custom alert preferences
    • Saved searches and favorites
    • Email/SMS notifications
    • Personalized dashboard widgets

Long-term (6-12 months)

  1. Government Integration 🏛️

    • Official partnerships with BMC, MahaRERA
    • Real-time permit approval tracking
    • Direct citizen feedback channels
    • Public hearing notifications
  2. Community Features 👥

    • User-generated reports (potholes, issues)
    • Neighborhood forums and discussions
    • Verified resident badges
    • Collaborative problem-solving
  3. Business Intelligence 💼

    • Commercial real estate insights
    • Retail location analysis
    • Competitor tracking
    • Market opportunity identification
  4. AI Enhancements 🤖

    • Multi-turn conversational AI
    • Predictive alerts (before issues occur)
    • Automated report generation
    • Natural language permit search

Technical Roadmap

  1. Scalability

    • Distributed agent execution
    • Redis caching layer
    • PostgreSQL for structured data
    • Kubernetes deployment
  2. Monitoring 📈

    • Real-time cost tracking dashboard
    • Agent health monitoring
    • Data quality validation
    • Anomaly detection
  3. Security 🔒

    • User authentication and authorization
    • Data encryption at rest and in transit
    • Rate limiting and DDoS protection
    • GDPR compliance
  4. API Platform 🔌

    • Public API for third-party developers
    • Webhook support for real-time updates
    • GraphQL endpoint for flexible queries
    • Developer documentation and SDKs

Cost Analysis (Mathematical Formulation)

Per-Run Cost Breakdown

Let \( C_{total} \) be the total cost per complete run:

$$ C_{total} = \sum_{i=1}^{12} C_i $$

Where \( C_i \) is the cost of agent \( i \):

Agent Cost (\$) Percentage
Image Analysis 0.0065 52%
Community Pulse 0.0022 18%
Social Listening 0.0020 16%
Permit Monitor 0.0010 8%
Investment Insights 0.0007 6%
Safety Intelligence 0.0003 2%
Voice Briefing 0.0001 1%
Bridge Processing 0.0001 1%

$$ C_{total} = 0.0125 \text{ USD} $$

Budget Capacity

Given budget \( B = 100 \) USD:

$$ N_{runs} = \frac{B}{C_{total}} = \frac{100}{0.0125} = 8000 \text{ runs} $$

Daily Update Scenarios

For daily updates (\( f = 1 \) run/day):

$$ T_{years} = \frac{N_{runs}}{365} = \frac{8000}{365} \approx 21.9 \text{ years} $$

For hourly updates (\( f = 24 \) runs/day):

$$ T_{days} = \frac{N_{runs}}{24} = \frac{8000}{24} \approx 333 \text{ days} $$

For 3-hour updates (\( f = 8 \) runs/day) - Current Production Schedule:

$$ T_{days} = \frac{N_{runs}}{8} = \frac{8000}{8} = 1000 \text{ days} \approx 2.7 \text{ years} $$

Engagement-Weighted Topic Scoring

Let \( E_i \) be the engagement score for post \( i \):

$$ E_i = u_i + c_i $$

Where \( u_i \) = upvotes, \( c_i \) = comments

Weight factor with cap:

$$ w_i = \min\left(5, \max\left(1, \left\lfloor \frac{E_i}{10} \right\rfloor\right)\right) $$

Topic score \( S_t \) for topic \( t \):

$$ S_t = \sum_{i \in P_t} w_i $$

Where \( P_t \) is the set of posts mentioning topic \( t \).


Repository & Demo

Built with ❤️ for the Amazon Nova Hackathon 2026

Built With

Share this project:

Updates