<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Gaurav Pandey</title>
    <description>The latest articles on Forem by Gaurav Pandey (@gaurav_pandey_a16499e79dc).</description>
    <link>https://forem.com/gaurav_pandey_a16499e79dc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3648421%2F954a4e52-7449-4ca2-b6d9-9fc1b4e3651a.png</url>
      <title>Forem: Gaurav Pandey</title>
      <link>https://forem.com/gaurav_pandey_a16499e79dc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gaurav_pandey_a16499e79dc"/>
    <language>en</language>
    <item>
      <title>Building RecallMe: An On-Device AI Companion for Dementia Care Using Flutter &amp; Kiro</title>
      <dc:creator>Gaurav Pandey</dc:creator>
      <pubDate>Fri, 05 Dec 2025 18:40:47 +0000</pubDate>
      <link>https://forem.com/gaurav_pandey_a16499e79dc/building-recallme-an-on-device-ai-companion-for-dementia-care-using-flutter-kiro-1kj3</link>
      <guid>https://forem.com/gaurav_pandey_a16499e79dc/building-recallme-an-on-device-ai-companion-for-dementia-care-using-flutter-kiro-1kj3</guid>
      <description>&lt;h1&gt;
  
  
  Building RecallMe: An On-Device AI Companion for Dementia Care with Flutter and Kiro
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;How I built a privacy-first mobile AI app that helps people with dementia recognize faces and recall memories entirely on-device&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Dementia affects over 55 million people worldwide. One of the most heartbreaking challenges is when loved ones can no longer recognize family members or recall cherished memories. Traditional solutions often rely on cloud-based AI, raising privacy concerns and requiring constant internet connectivity.&lt;/p&gt;

&lt;p&gt;What if we could build an AI assistant that runs entirely on-device, respects privacy, and helps dementia patients maintain their connections with loved ones?&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing RecallMe
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;RecallMe&lt;/strong&gt; is a Flutter-based mobile application that combines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;On-device face recognition&lt;/strong&gt; using Google ML Kit and custom embedding algorithms&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI-powered memory conversations&lt;/strong&gt; with context-aware chat&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voice interaction&lt;/strong&gt; for natural, accessible communication&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smart routine management&lt;/strong&gt; with notifications and progress tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All processing happens locally on the device no cloud, no privacy concerns, fully offline-capable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tech Stack
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Frontend &amp;amp; Framework
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flutter 3.7.0+&lt;/strong&gt; with Dart&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provider&lt;/strong&gt; for state management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hive&lt;/strong&gt; for local NoSQL database&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Material Design&lt;/strong&gt; with custom dementia-friendly theme&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  AI &amp;amp; ML
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google ML Kit&lt;/strong&gt; for face detection (Arm-optimized TensorFlow Lite)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom 256-dimensional embedding algorithm&lt;/strong&gt; combining:

&lt;ul&gt;
&lt;li&gt;Color histograms (64D)&lt;/li&gt;
&lt;li&gt;Spatial grid features (64D)&lt;/li&gt;
&lt;li&gt;Gradient features (6D)&lt;/li&gt;
&lt;li&gt;LBP texture analysis (16D)&lt;/li&gt;
&lt;li&gt;Quadrant averages (4D)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Azure OpenAI (GPT-4)&lt;/strong&gt; for memory conversations (can be replaced with on-device model)&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Cosine similarity&lt;/strong&gt; for face matching&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Native Integration
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kotlin&lt;/strong&gt; for Android native code (face recognition, TTS)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Method Channels&lt;/strong&gt; for Flutter-Kotlin communication&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Native TextToSpeech&lt;/strong&gt; engine&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Voice &amp;amp; Media
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;speech_to_text&lt;/strong&gt; package for voice input&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;camera&lt;/strong&gt; package for face recognition&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;image&lt;/strong&gt; package for image processing

&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gznp4y61me9sy442wco.png" width="720" height="1650"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How It Works: The Face Recognition Pipeline
&lt;/h2&gt;

&lt;p&gt;The face recognition system is the heart of RecallMe. Here's how it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// 1. Face Detection (using ML Kit)
Future&amp;lt;List&amp;lt;FaceDetection&amp;gt;&amp;gt; detectFaces(Uint8List imageBytes) async {
  final result = await _channel.invokeMethod('detectFaces', {
    'imageBytes': imageBytes,
  });
  return result.map((face) =&amp;gt; FaceDetection.fromMap(face)).toList();
}

// 2. Generate Embedding (custom algorithm in Kotlin)
// Combines multiple feature extraction techniques
// Returns 256-dimensional vector

// 3. Match Against Stored Embeddings
double similarity = calculateCosineSimilarity(
  newEmbedding, 
  storedEmbedding
);
if (similarity &amp;gt; 0.45) {
  // Match found!
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The custom embedding algorithm runs entirely in Kotlin, optimized for Arm architecture using NEON SIMD instructions for vectorized operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building with Kiro: How AI-Powered Development Accelerated the Process
&lt;/h2&gt;

&lt;p&gt;One of the most exciting aspects of this project was using &lt;strong&gt;Kiro&lt;/strong&gt;, an AI-powered IDE, to accelerate development. Here's how Kiro transformed my workflow:&lt;/p&gt;

&lt;h3&gt;
  
  
  Steering Documents: Setting the Foundation
&lt;/h3&gt;

&lt;p&gt;I created three steering documents in &lt;code&gt;.kiro/steering/&lt;/code&gt; that gave Kiro deep context about the project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;product.md&lt;/code&gt;&lt;/strong&gt;: Defined the dementia-friendly design principles, target users, and core features&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;structure.md&lt;/code&gt;&lt;/strong&gt;: Established the layered architecture (Presentation → State → Business Logic → Data) and code organization patterns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;tech.md&lt;/code&gt;&lt;/strong&gt;: Specified the technology stack, dependencies, and build commands&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These documents ensured Kiro understood:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The warm color palette (soft yellows, creams, oranges) for dementia-friendly design&lt;/li&gt;
&lt;li&gt;The file naming conventions (&lt;code&gt;snake_case&lt;/code&gt;, &lt;code&gt;_screen.dart&lt;/code&gt; suffix)&lt;/li&gt;
&lt;li&gt;The Provider pattern for state management&lt;/li&gt;
&lt;li&gt;The Hive database structure&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Vibe Coding: Rapid Feature Development
&lt;/h3&gt;

&lt;p&gt;With steering documents in place, I used &lt;strong&gt;vibe coding&lt;/strong&gt; to build features through natural conversation:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Conversation:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Me: "Build a routine management screen with add/edit/delete functionality, notification scheduling, and completion tracking"&lt;/p&gt;

&lt;p&gt;Kiro: &lt;em&gt;Generates complete implementation following our architecture patterns, using Provider for state, Hive for persistence, and our warm color theme&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This approach let me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build 15+ screens with consistent patterns&lt;/li&gt;
&lt;li&gt;Implement complex features like timezone-aware notifications&lt;/li&gt;
&lt;li&gt;Maintain architectural consistency across the entire codebase&lt;/li&gt;
&lt;li&gt;Iterate quickly while keeping code quality high&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Impact
&lt;/h3&gt;

&lt;p&gt;What would have taken weeks of development was completed in days. Kiro's understanding of our architecture meant every generated component fit seamlessly into the existing codebase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features in Action
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Face Recognition
&lt;/h3&gt;

&lt;p&gt;Users can point the camera at someone and instantly see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"This is Sarah (85% confidence)"&lt;/li&gt;
&lt;li&gt;All processing happens on-device&lt;/li&gt;
&lt;li&gt;Works offline, respects privacy&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Memory Recall
&lt;/h3&gt;

&lt;p&gt;Tap a photo, and the AI assistant:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remembers previous conversations (last 5 messages)&lt;/li&gt;
&lt;li&gt;Includes photo metadata (name, year, person, memory word)&lt;/li&gt;
&lt;li&gt;Responds in short, simple sentences perfect for dementia patients&lt;/li&gt;
&lt;li&gt;Speaks the response using text-to-speech&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Routine Management
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Schedule daily routines with precise times&lt;/li&gt;
&lt;li&gt;Get notifications with timezone awareness&lt;/li&gt;
&lt;li&gt;Track completion across Home, Schedule, and Daily Tasks screens&lt;/li&gt;
&lt;li&gt;View weekly progress reports&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Voice Interaction
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Speak questions naturally&lt;/li&gt;
&lt;li&gt;Get voice responses&lt;/li&gt;
&lt;li&gt;No typing required—perfect for accessibility&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Privacy-First Architecture
&lt;/h2&gt;

&lt;p&gt;All data stays on the device:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Face embeddings stored locally in Hive database&lt;/li&gt;
&lt;li&gt;Photos stored in app's private directory&lt;/li&gt;
&lt;li&gt;No cloud synchronization&lt;/li&gt;
&lt;li&gt;Encrypted storage for sensitive data (API keys, PIN)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is crucial for healthcare applications where privacy is paramount.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arm Architecture Optimization
&lt;/h2&gt;

&lt;p&gt;RecallMe is optimized for Arm-based devices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;NEON SIMD&lt;/strong&gt; for vectorized histogram calculations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Big.LITTLE aware&lt;/strong&gt; task scheduling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient memory patterns&lt;/strong&gt; for image processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GPU acceleration&lt;/strong&gt; when available (via ML Kit)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The app runs smoothly on mid-range Arm devices, making it accessible to a wide range of users.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Development Journey
&lt;/h2&gt;

&lt;p&gt;Building RecallMe was a learning experience in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;On-device ML&lt;/strong&gt;: Balancing accuracy with performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accessibility&lt;/strong&gt;: Designing for users with cognitive impairments&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy&lt;/strong&gt;: Building AI that respects user data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration&lt;/strong&gt;: Combining multiple AI technologies seamlessly&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Open Source &amp;amp; Community Impact
&lt;/h2&gt;

&lt;p&gt;RecallMe is open source, with the goal of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helping other developers learn on-device ML techniques&lt;/li&gt;
&lt;li&gt;Providing dementia-friendly design patterns&lt;/li&gt;
&lt;li&gt;Demonstrating Arm optimization best practices&lt;/li&gt;
&lt;li&gt;Inspiring more privacy-first AI applications&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;The project is available on GitHub with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complete source code&lt;/li&gt;
&lt;li&gt;Detailed setup instructions&lt;/li&gt;
&lt;li&gt;Architecture documentation&lt;/li&gt;
&lt;li&gt;Arm device build guide&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/Gaurav-derry/Recall" rel="noopener noreferrer"&gt;https://github.com/Gaurav-derry/Recall&lt;/a&gt;&lt;br&gt;
cd recallme&lt;br&gt;
flutter pub get&lt;br&gt;
flutter run## What's Next?&lt;/p&gt;

&lt;p&gt;Future enhancements could include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On-device LLM replacement for Azure OpenAI&lt;/li&gt;
&lt;li&gt;Multi-language support&lt;/li&gt;
&lt;li&gt;Caregiver dashboard with analytics&lt;/li&gt;
&lt;li&gt;Integration with health monitoring devices&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;RecallMe demonstrates that sophisticated AI can run entirely on mobile devices while respecting privacy and accessibility. By combining Flutter's cross-platform capabilities, on-device ML, and Kiro's AI-powered development workflow, we can build applications that make a real difference in people's lives.&lt;/p&gt;

&lt;p&gt;The technology is here. The tools are accessible. The impact is real.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Technologies&lt;/strong&gt;: Flutter, Dart, Kotlin, Google ML Kit, Azure OpenAI, Hive, Provider&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Development Tools&lt;/strong&gt;: Kiro (AI-powered IDE), Android Studio, VS Code&lt;/p&gt;

</description>
      <category>kiro</category>
      <category>flutter</category>
      <category>machinelearning</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
