Inspiration

Singapore's Housing & Development Board (HDB) market is one of the world's most successful public housing systems, with over 1 million flats and 300,000+ resale transactions since 2017. Yet finding the right HDB flat remains surprisingly difficult—buyers face fragmented data sources, complex pricing trends across 26 towns, and the daunting task of analyzing demographic factors alongside property data.

I am inspired by a simple question: What if an AI agent could understand your housing needs as well as an experienced property consultant? Not just a chatbot that searches listings, but a true multi-agent system that reasons about property data, understands neighborhood demographics, and optimizes for both accuracy and cost.

The AWS AI Agent Global Hackathon gave me the perfect opportunity to build this vision using Amazon Bedrock AgentCore—a chance to demonstrate how specialized agents working together can solve real-world problems better than any single model.

What it does

SmartFlat AI is your intelligent HDB advisor powered by three specialized AI agents working in concert:

Property Agent - Your market intelligence expert

  • Searches 300K+ real HDB transactions (2017-present)
  • Calculates price statistics, trends, and market comparisons
  • Handles complex analytics like "Show me 5-room flats in mature estates with >10% price growth"
  • Uses Amazon Athena for sophisticated statistical queries

PostgreSQL Agent - Your cost-optimized search specialist

  • Delivers lightning-fast property searches at 70% lower cost than Athena
  • Handles frequent queries like "Find 4-room flats in Bishan under $600k"
  • Leverages RDS Proxy for scalable, secure database connections
  • Perfect for straightforward searches and comparisons

Demographics Agent - Your neighborhood expert

  • Provides live Singapore population statistics via Data Commons API
  • Connects property data with community context

Supervisor Agent - The orchestrator

  • Powered by Amazon Nova Lite for intelligent query routing
  • Analyzes each question and routes to the optimal agent(s)
  • Maintains conversation context across multiple agents
  • Optimizes for both cost and query complexity

How we built it

I architected SmartFlat AI using the official AWS multi-agent supervisor pattern, implementing it in three evolutionary phases:

Phase 1: Foundation Architecture

  • Built web interface with API Gateway + Lambda (Python)
  • Implemented chat handler with conversation memory
  • Integrated basic HDB search capabilities
  • Established AWS infrastructure patterns with CloudFormation

Phase 2: Multi-Agent Intelligence

  • Deployed Amazon Bedrock AgentCore with supervisor pattern
  • Created specialized Property Agent using Amazon Athena + S3
  • Integrated Demographics Agent with Data Commons API
  • Implemented Amazon Nova Lite for intelligent query routing
  • Built complete REST API for HDB resale data (300K+ records)

Phase 3: Cost Optimization (Current)

  • Added PostgreSQL RDS with RDS Proxy for connection pooling
  • Created PostgreSQL Agent for cost-optimized queries
  • Implemented intelligent routing: PostgreSQL (fast/cheap) vs Athena (complex analytics)
  • Achieved 70% cost reduction on frequent queries
  • Maintained dual data sources for optimal performance

Challenges we ran into

1. Query Routing Intelligence

Challenge: How does the supervisor know when to use PostgreSQL vs Athena?
Solution: I added simple query patterns for supervisor:

  • Simple filters + single aggregations → PostgreSQL (fast, cheap)
  • Complex analytics, multiple joins, statistical analysis → Athena (powerful)
  • Demographics → Data Commons API (authoritative source) This required iterative prompt engineering with Amazon Nova Lite to achieve reliable routing.

2. RDS Proxy Connection Management

Challenge: Lambda cold starts creating too many database connections, hitting RDS limits.
Solution: Implemented RDS Proxy as a connection pooler:

  • Maintains persistent connection pool
  • Handles Lambda concurrency gracefully
  • Reduces connection overhead from ~500ms to <50ms
  • Improved security with IAM authentication

3. Cost vs Performance Trade-offs

Challenge: Athena's pay-per-query model expensive for simple searches; PostgreSQL cheaper but requires always-on database.

For query cost analysis:
$$ \text{Athena Cost} = \text{Data Scanned (TB)} \times \$5.00 $$ $$ \text{RDS Cost} = \text{Instance Hours} \times \text{Rate} + \text{Storage} $$

Break-even calculation: $$ \text{Monthly Queries} > \frac{\text{RDS Monthly Cost}}{\text{Avg Athena Query Cost}} \approx 1000 \text{ queries/month} $$

Solution: Intelligent routing achieved 70% cost savings by using PostgreSQL for high-frequency, simple queries while reserving Athena for complex analytics.

Accomplishments that I'm proud of

  • Real Production Architecture - Not a prototype, but a fully deployed system with proper infrastructure as code, security, and scalability
  • 70% Cost Reduction - Intelligent routing saves real money at scale while maintaining performance
  • AWS Best Practices - Implemented the official AWS multi-agent supervisor pattern exactly as designed
  • Three-Phase Evolution - Demonstrated disciplined architecture evolution from single agent → multi-agent → cost-optimized
  • Real-World Impact - Solves actual pain points in Singapore's $500B housing market with 300K+ transaction dataset
  • Agent Specialization - Each agent truly excels at its domain rather than being a generic wrapper
  • Enterprise-Grade - RDS Proxy, IAM authentication, CloudFormation, proper secret management

What I learned

Technical Learnings

1. Multi-Agent Design is Fundamentally Different

  • Single agents optimize for task completion
  • Multi-agent systems optimize for specialization + coordination
  • The supervisor is as critical as the agents themselves

2. Cost Intelligence Must Be Built-In

  • AI systems can become expensive quickly at scale
  • Intelligent routing between compute options (PostgreSQL vs Athena) is crucial
  • Always measure: Cost per Query × Expected Volume = Reality Check

3. Amazon Nova Lite is Surprisingly Capable

  • Cost-effective model for routing decisions
  • Fast inference for supervisor responsibilities
  • Balances cost vs capability perfectly for this use case

What's next for SmartFlat AI

Enhanced User Experience

  • Property image integration from HDB official sources
  • Map visualization showing flat locations and nearby amenities
  • Comparison view for side-by-side flat analysis
  • Saved searches and favorite properties

Proactive Notifications

  • Price drop alerts for saved searches
  • New listings matching criteria
  • Market trend notifications ("Prices in your area up 5% this month")

Advanced Analytics

  • Price prediction using my previously trained XGBoost model
  • Investment ROI calculator
  • Neighborhood comparison scorecards

Built With

Share this project:

Updates