Inspiration
The retail sector constantly loses customers, not always due to price or product quality, but often due to inefficiencies that go unnoticed until it is too late. Store managers lack a unified and intelligent system to identify which locations are at risk of losing customers and revenue. We were inspired by the Hack4Her 2026 challenge to create a solution that would empower teams (particularly female leaders in the retail sector) to take proactive measures against customer churn. By combining data-driven insights with AI analysis, we wanted to build a tool that transformed store performance metrics into actionable intelligence. LeakHunter exists to detect the hidden "leaks" in customer loyalty before they become critical operational failures.
What it does
LeakHunter is an intelligent analytics platform for the retail sector that identifies and categorizes stores at risk of customer churn. The system: Analyzes store performance data (transaction volume, territorial patterns, segment classification, inventory metrics, and more) to calculate churn risk scores. Classifies stores into three risk levels: Critical, Medium, and Low, with precise risk percentages. Provides AI-driven insights using Google Gemini to generate strategic recommendations tailored for business managers. Offers actionable recommendations in critical areas: renegotiation strategies, follow-up plans, and resource optimization. Delivers real-time dashboards through an intuitive iOS app, allowing managers to monitor store health at a glance and make informed decisions instantly. The platform essentially asks: "Which stores are we losing? Why? What can we do about it?" and provides clear, data-backed answers.
How we built it
We created an end-to-end solution with three main components: Backend (Python/FastAPI) REST API that loads and processes store performance data from CSV imports. Calculates intelligent risk metrics based on multidimensional store attributes (transactions, client base size, territorial distribution, segment performance). Integrates Google Gemini 2.5 Flash for generative AI analysis. Provides real-time risk summaries and AI-generated business recommendations. Built with a clear separation of concerns: service layer for business logic, LLM client for AI integration, and Pydantic models for type safety.
User Interface (SwiftUI/iOS)
Native iOS app that provides an intuitive interface for retail store managers. Real-time visualization of store risk categories and risk percentages. Interactive dashboards displaying key insights and AI recommendations. Seamless integration with the backend via REST API calls. Optimized for on-the-go decision-making.
Technology Stack
FastAPI (asynchronous Python web framework for high-performance APIs). Google Generative AI (Gemini 2.5 Flash for intelligent analysis and recommendations). Pydantic (data validation and modeling). SwiftUI (modern development framework for iOS). CORS-compliant architecture (secure cross-platform communication). The system processes stored data through a pipeline: CSV ingestion → risk calculation → AI analysis → formatted response → mobile delivery.
Challenges we ran into
Data integration under time pressure: Parsing data from multiple storage sources with varied formats and ensuring data consistency throughout the pipeline required rapid iteration and robust error handling. Balancing AI complexity with latency: We needed Gemini to generate valuable business insights without sacrificing response times. We optimized prompts and implemented fallback mechanisms to ensure reliability. Cross-platform synchronization: Coordinating backend and iOS frontend development in parallel made clear API contracts essential. We spent time early on defining shared models to avoid mismatches during the hackathon. Transforming raw metrics into actionable insights: Converting risk scores and store attributes into concrete, understandable recommendations required careful and rapid prompt engineering, as well as multiple iterations. Team coordination (remote/distributed): Managing development across different team members and repositories required constant communication and clear documentation.
Accomplishments that we're proud of
Intelligent Risk Classification: Our multi-factor risk calculation takes into account territory, customer size, transaction patterns, segment performance, and inventory metrics, not just surface-level metrics. AI-Driven Recommendations: Instead of just pointing out problems, LeakHunter generates contextualized business recommendations using generative AI, making it immediately useful for decision-makers. Production-Ready Architecture: Clean code organization, proper error handling, CORS configuration, health checks, and Swagger documentation from the start. Real Business Impact: Our solution addresses a genuine business need: helping retail leaders prevent revenue loss before it's too late. Diverse Skill Integration: We successfully merged backend development, AI integration, iOS development, and data analysis into a cohesive product.
What we learned
The power of generative AI in a business context: Gemini is not just for chatbots; it can transform raw metrics into strategic intelligence when provided with the right prompts and context. API-first design saves time: Defining clear contracts and response models early on prevented integration headaches later. End-to-end thinking is crucial: Solving the complete problem (data → analysis → delivery → UI) requires thinking across all layers, not just optimizing one component. Fallback mechanisms are essential: Even with cloud APIs, having sensible defaults ensures the product keeps working when services fail. Collaboration under pressure works with clear communication: Using shared repositories, commit messages, and documentation helped us work asynchronously without stepping on each other's toes. Real retail problems are data-driven: Business users don't want complexity; they want clarity and concrete next steps. This influenced every design decision we made.
What's next for LeakHunter?
Immediate Features Predictive Customer Churn Modeling: Transition from current risk assessment to machine learning-based churn predictions using historical store performance data. Deep Dive Analytics: Allow managers to drill down into individual stores to view detailed metrics, trends, and segment-specific insights. Custom Thresholds: Enable organizations to configure their own risk level definitions based on business priorities. Automated Alerts: SMS/push notifications when stores exceed critical thresholds.
Mid-term Roadmap
Cohort Analysis: Compare similar stores to identify best-practice locations and replicate their strategies. Intervention Tracking: Log and measure the impact of manager actions against the recommendations. Multilingual Support: Expand beyond Spanish to serve global retail chains. Admin Dashboard: Centralized management console for enterprise deployments.
Long-term Vision
Enterprise Platform: Scalability to support omnichannel retail (online + offline) with unified customer churn analytics. Partner Integrations: Connect with POS systems, CRM platforms, and supply chain tools for a holistic view. Industry Benchmarking: Position LeakHunter as the standard for retail health monitoring. Expansion to Other Sectors: Apply the core churn detection engine to telecom, SaaS, and subscription businesses. We are excited to continue developing this tool and helping retail leaders worldwide take control of their customer retention strategy. The fight against customer churn doesn't end at Hack4Her; it's just beginning.
Log in or sign up for Devpost to join the conversation.