Rela AI - Gemini 3.0 Hackathon Submission

Inspiration

We noticed that traditional dating apps prioritize swiping and matching, often leading to rushed connections and toxic relationships. People jump into dating before healing from past heartbreaks, carrying emotional baggage that sabotages new relationships. What if AI could guide people through a complete relationship wellness journey? Starting with emotional healing, then mindful dating, and finally thriving in healthy partnerships. Google Gemini 3.0 Flash's speed and versatility made it perfect for creating a truly personalized, multi-phase relationship companion.

What it does

Rela AI is an AI-powered relationship wellness platform with three progressive phases:

💚 Phase 1: Healing (Unlocked by Default)

  • AI-generated daily affirmations personalized to your mood and emotional state
  • Interactive mood tracking with color-wheel visualization
  • Memory photo analysis using Gemini's vision capabilities to process past relationships
  • Real-time healing chat for emotional support and guidance
  • Mood pattern analysis that identifies emotional trends over time
  • 30-day check-in system to build healthy emotional habits before dating

💗 Phase 2: Dating (Unlocks After 30-Day Healing)

  • AI-generated dating profiles based on user preferences, interests, and location
  • Advanced compatibility scoring using Gemini's semantic understanding (not just keyword matching)
  • Location-based "Nearby People" carousel with real-time distance calculations
  • Smart swipe deck with detailed bios, interests, and compatibility percentages
  • Match management system with chat functionality
  • Demo mode toggle for instant feature unlocking (testing purposes)

💙 Phase 3: Coaching (Unlocks in Committed Relationships)

  • Personalized AI-generated content feed: date ideas, outfit guides, gift suggestions, playlists, books, movies
  • Location-based recommendations for nearby restaurants, activities, and date spots
  • Context-aware coaching that adapts to your relationship stage
  • Growth tracking dashboard with milestone celebrations
  • Relationship insights and pattern recognition

🔧 Unique Feature-Flag Architecture

  • USE_AI_MATCHING toggle switches between mock data (demo) and full AI generation (production)
  • Timeout protection \( t_{max} = 5s \) with automatic fallback to simple algorithms
  • Production-ready code that works perfectly with or without a user database

How we built it

🚀 Built for Gemini 3.0 Flash! This project targets gemini-3-flash-preview as the primary model.

Core Technology Stack

  • React Native + Expo for cross-platform iOS/Android development
  • TypeScript for type-safe, maintainable code
  • Zustand for elegant state management across phases
  • Google Gemini 3.0 Flash API (gemini-3-flash-preview model)
  • Google Maps API for location-based recommendations
  • React Navigation for seamless tab-based navigation

Note: Built specifically for Gemini 3.0 Flash! Code is future-proof and will automatically use gemini-3-flash-preview when officially available.

Gemini AI Integration (7+ Use Cases)

1. Affirmation Generation (generateAffirmation)

Input: { mood, emotionalState, healingProgress }
Output: { affirmation: "You are worthy of love...", theme: "self-love" }

2. Memory Analysis (analyzeMemoryPhoto)

Input: { photo: Image, caption: string }
Output: { insights: [...], healingSuggestions: [...], reframe: "..." }

3. Healing Chat (healingChat)

Input: { conversationHistory: Message[], userMessage: string }
Output: { response: "I hear your pain...", emotion: "empathy" }

4. Mood Pattern Analysis (analyzeMoodPatterns)

Input: { moodHistory: [{ date, color, note }, ...] }
Output: { trends: [...], triggers: [...], improvements: [...] }

5. Dating Profile Generation (generateDatingProfiles)

Input: { age, gender, interests, location, datingGoal }
Output: { profiles: [{ name, bio, interests, compatibility }, ...] }

6. Compatibility Calculation (calculateCompatibility)

We use both simple and AI-powered compatibility scoring:

Simple Algorithm (Fallback): $$ \text{Compatibility} = \frac{\text{Common Interests}}{\text{Total Unique Interests}} \times 100 $$

AI Algorithm (Primary): $$ \text{Score}_{AI} = f(\text{interests}, \text{age}, \text{goals}, \text{personality}) \in [0, 100] $$

Where \( f \) is a Gemini AI function that semantically analyzes compatibility across multiple dimensions.

7. Instructor Feed (getInstructorFeed)

Input: { interests, relationshipStatus, location }
Output: { cards: [{ type: "date_idea", content, images }, ...] }

Architecture Highlights

  • Feature flag system allows switching between demo mode (instant mock data) and AI mode (production-ready)
  • Timeout protection on all AI calls prevents hanging requests: typescript await Promise.race([ geminiCall(), timeout(5000) ])
  • Graceful fallbacks to simple algorithms if AI times out
  • JSON response sanitization handles Gemini markdown formatting
  • Zustand actions for phase progression, check-ins, and demo controls
  • Conditional tab rendering based on user's unlocked phases

Security Best Practices

  • ✅ API keys stored in .env file (never committed)
  • .gitignore protects sensitive files
  • .env.example template for other developers
  • ✅ Environment variables accessed via EXPO_PUBLIC_ prefix

Challenges we ran into

1. AI Timeout Errors ⏱️

Problem: Initial implementation called AI compatibility calculation for every profile simultaneously, causing timeouts and poor UX

Solution: Implemented a hybrid architecture with USE_AI_MATCHING feature flag, timeout protection \( (t_{timeout} = 5s) \), and automatic fallback to simple interest-matching algorithms. Now works perfectly in demo mode (mock data) and production mode (AI)

const USE_AI_MATCHING = false; // Toggle for demo vs production

2. JSON Response Parsing 📝

Problem: Gemini sometimes returned markdown code blocks (json ...) instead of pure JSON

Solution: Created sanitizeJsonResponse function that strips markdown formatting and extracts clean JSON:

function sanitizeJsonResponse(text: string): string {
  return text.replace(/```json\n?/g, '')
             .replace(/```\n?/g, '')
             .trim();
}

3. Phase-Based Progression Logic 🔓

Problem: Complex state management for unlocking Dating \( (t \geq 30 \text{ days}) \) and Coaching (relationship status) tabs

Solution: Built robust Zustand store with actions like checkInForDating, canAccessDating, canAccessInstructor, and demo override toggles

4. Location-Based Features 📍

Problem: Needed real location data for nearby people and places without an actual user database

Solution: Used Gemini AI to generate realistic location-aware profiles and places with calculated distances, Unsplash images, and detailed metadata

5. GitHub Permissions 🔐

Problem: Couldn't push to collaborator's repository due to SSH key permissions

Solution: Documented comprehensive manual upload process and created .gitignore + .env.example for secure sharing

6. Model Availability 🚀

Problem: Built for gemini-3-flash-preview (Gemini 3.0 Flash), but the model isn't officially released yet

Solution: Implemented intelligent fallback chain that prioritizes the latest models:

gemini-3-flash-preview → gemini-2.0-flash-exp → gemini-1.5-flash → gemini-1.5-pro

Accomplishments that we're proud of

Built for Gemini 3.0 Flash - Specifically targets gemini-3-flash-preview with intelligent fallback chain, future-proof for official release

7+ Unique Gemini AI Use Cases - From emotional healing to matchmaking to coaching, we've integrated AI throughout the entire user journey

Production-Ready Architecture - Feature flags, timeout protection, graceful fallbacks, and comprehensive error handling make this demo code actually deployable

Innovative Phase-Based System - We're not just another dating app - we prioritize mental health and emotional readiness before romantic connections

Hybrid AI + Mock Data Strategy - One-line toggle switches between instant demo mode and full AI generation, perfect for development, testing, and production

Beautiful, Polished UI - Smooth animations, intuitive navigation, color-coded mood tracking, and modern design that rivals production apps

Security-First Approach - API keys never exposed, .gitignore properly configured, environment variables secure

Comprehensive Documentation - Created AI_INTEGRATION.md and DATING_AI_INTEGRATION.md with complete explanations of architecture, use cases, and migration paths

Real-World Impact Potential - Addresses genuine mental health needs before dating, promoting healthier relationships and reducing toxic patterns

What we learned

Technical Learnings 💻

  • How to handle AI API timeouts gracefully with Promise.race() and fallback strategies
  • JSON sanitization techniques for handling inconsistent AI responses
  • Feature flag architecture for switching between demo and production modes
  • Complex state management with Zustand for multi-phase user journeys
  • Semantic compatibility matching vs. keyword matching with AI

Gemini-Specific Insights 🤖

  • Built for Gemini 3.0 Flash (gemini-3-flash-preview) - the latest and fastest model
  • Structured JSON prompts with clear examples dramatically improve response consistency
  • Multi-modal capabilities (text + vision) enable powerful features like memory photo analysis
  • Temperature settings \( T \in [0.7, 0.9] \) affect creativity vs. consistency tradeoffs
  • Model fallback chains ensure code works seamlessly when Gemini 3.0 officially launches

Product Design Learnings 🎨

  • Users need emotional preparation before dating - our 30-day check-in system addresses this
  • Phase-based unlocking creates anticipation and commitment to the healing process
  • Demo modes are essential for testing, presentations, and user onboarding
  • Location-based features dramatically increase engagement and relevance

Development Workflow 🛠️

  • Expo's hot reload made rapid iteration possible
  • TypeScript caught countless bugs before runtime
  • Git + .gitignore are critical for API key security
  • Mock data with real images creates realistic demos without database dependencies

Mathematical Insight 📊

Compatibility isn't just \( C = \frac{|A \cap B|}{|A \cup B|} \) (Jaccard similarity).

AI enables multi-dimensional scoring: $$ C_{AI} = w_1 \cdot f_{interests} + w_2 \cdot f_{age} + w_3 \cdot f_{goals} + w_4 \cdot f_{personality} $$ Where \( \sum w_i = 1 \) and each \( f_i \) is a semantic similarity function learned by Gemini.

What's next for Rela AI

🗄️ Database & Backend

  • Firebase/Supabase integration for real user profiles and authentication
  • Match storage and retrieval system
  • Chat message persistence across sessions
  • User preference and progress storage

🚀 Enhanced AI Features

  • Voice Healing Sessions - Gemini multimodal audio for guided meditations
  • Video Date Coaching - Real-time AI analysis of video call body language and communication
  • Couples Compatibility Reports - Deep relationship analysis for existing partners
  • AI Relationship Counselor - Scheduled coaching sessions with personalized advice
  • Smart Notification Timing - AI predicts optimal times \( t^* = \arg\max P(\text{engagement} | t) \) to send affirmations

💬 Advanced Matching

  • In-App Video/Audio Calls - Verify profiles and build connections safely
  • Group Dating Events - AI-organized meetups for compatible groups
  • Interest-Based Communities - Find people through shared activities, not just swiping
  • "Deal Breaker" Filtering - AI analyzes deep compatibility on important values

📊 Analytics & Insights

  • Relationship health score tracking over time: \( H(t) = f(\text{mood}, \text{communication}, \text{growth}) \)
  • Communication pattern analysis for couples
  • Personalized growth roadmaps with milestones
  • Export therapy-ready reports for professional counseling

🌍 Social Features

  • Success stories and testimonials
  • Community healing circles (moderated group chats)
  • Mentor matching (healed users guide newcomers)
  • Relationship workshops and webinars

💰 Business Model

  • Freemium: Basic healing + limited swipes free forever
  • Premium: Unlimited AI features, advanced matching, coaching sessions
  • Partnerships with therapists for hybrid AI + human support
  • Corporate wellness programs for employee mental health

🔬 Research Opportunities

  • Longitudinal studies on healing-before-dating effectiveness
  • A/B testing AI vs. traditional matching algorithms: $$H_0: \mu_{AI} = \mu_{traditional} \quad \text{vs.} \quad H_1: \mu_{AI} > \mu_{traditional}$$
  • Collaboration with relationship psychologists on evidence-based features
  • Publishing research on AI's role in mental health and relationships

💚💗💙

Built With

Share this project:

Updates