Inspiration
Real estate sales teams in Vietnam manage hundreds of customer conversations across Zalo daily. Yet critical insights—customer psychology, budget readiness, buying signals—remain buried in unstructured chat history. Salespeople lose deals not because they lack effort, but because they can't process and act on this information fast enough. We built KTS-Cham to turn every conversation into actionable intelligence.
## What it does KTS-Cham is an AI-powered mobile app for real estate customer care. Sales teams can import Zalo conversations and get AI-powered insights:
- Psychology Analysis: Personality traits, emotional state, decision-making style
- Behavior Prediction: Conversion probability (0-100%), optimal contact timing
- Needs Analysis: Primary/secondary needs with priority weighting
- Financial Estimates: Budget range, payment preferences
- Product Recommendations: Property matches with scores
- Next-Best-Action: Personalized follow-up suggestions with 3 tone options
The app also includes a full CRM with 7-stage customer journey tracking, smart notifications, and AI-generated content suggestions.
## How we built it
Mobile App: Flutter 3.16+ with Riverpod state management, Hive for offline-first local storage, and Go Router for navigation. UI follows Material Design 3 guidelines.
Backend: Supabase as BaaS—PostgreSQL 15+ with Row Level Security, Edge Functions (Deno) for secure serverless logic, Storage for files, and Auth for JWT authentication.
AI Engine: Google Gemini 1.5 Flash with structured JSON output. Used 1M token context window to analyze up to 200 messages per conversation.
Architecture:
- Users import Zalo chats → stored in Supabase
- Edge Functions call Gemini API with Vietnamese-optimized prompts
- Results cached for 7 days to reduce API costs
- Fallback to mock responses when API unavailable
## Challenges we ran into
Gemini JSON Consistency: Early API responses produced unpredictable JSON formats. Solution: Added strict schema validation, retry logic with exponential backoff, and structured output examples in prompts.
Vietnamese Context: Generic prompts missed cultural nuances in real estate negotiations. Solution: Iteratively refined prompts with Vietnamese market examples and local negotiation patterns.
Cost Optimization: Analyzing 200+ messages per customer could explode API costs. Solution: Implemented 7-day intelligent caching before API calls—estimated ~$20-50/month for a 20-person team.
Offline-First Complexity: Syncing state between local Hive cache and Supabase proved tricky. Solution: Implemented queued operations with conflict resolution using Riverpod providers.
## Accomplishments that we're proud of
🎯 Production-ready mobile app with offline-first architecture
🇻🇳 Vietnamese-first AI prompts—understands local market context
💰 Cost-efficient—under $100/month total (Supabase + Gemini + Firebase)
⚡ Fast analysis—under 5 seconds for 200-message conversations
Cross-platform—single Flutter codebase for iOS and Android
## What we learned
Flutter's ecosystem with Riverpod and Hive enabled rapid development of a complex offline-first app. Supabase provided a complete backend without managing infrastructure—Edge Functions with Deno felt natural for TypeScript/JavaScript developers.
Gemini 3's 1M token context window is powerful for conversation analysis. The key insight was that prompt engineering for non-English markets requires deep cultural understanding—generic prompts produced significantly lower quality results for Vietnamese content.
## What's next for KTS-Cham
- Multi-platform support: Expand beyond Zalo to Messenger, Instagram, and WhatsApp
- Voice integration: Analyze call recordings in addition to chat
- Agent actions: Automatically execute tasks (schedule appointments, send emails) based on AI recommendations
- Team analytics dashboard: Web admin panel for team leaders
- Market expansion: Adapt the platform for other industries (insurance, automotive, B2B sales)


Log in or sign up for Devpost to join the conversation.