<?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>DEV Community: Ankit Kumar Surana</title>
    <description>The latest articles on DEV Community by Ankit Kumar Surana (@ankitsurana).</description>
    <link>https://dev.to/ankitsurana</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4026268%2F9f8f9a57-c2d2-41eb-8b44-6cc9320aaf3a.jpg</url>
      <title>DEV Community: Ankit Kumar Surana</title>
      <link>https://dev.to/ankitsurana</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankitsurana"/>
    <language>en</language>
    <item>
      <title>Sutham : Building a Real-Time Multimodal AI Agent with Gemini Live &amp; Gemma 4</title>
      <dc:creator>Ankit Kumar Surana</dc:creator>
      <pubDate>Sun, 12 Jul 2026 17:34:55 +0000</pubDate>
      <link>https://dev.to/ankitsurana/sutham-building-a-real-time-multimodal-ai-agent-with-gemini-live-gemma-4-nj5</link>
      <guid>https://dev.to/ankitsurana/sutham-building-a-real-time-multimodal-ai-agent-with-gemini-live-gemma-4-nj5</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-07-09"&gt;Weekend Challenge: Passion Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Waste sorting is confusing, especially in India where rules are hyper-local (like Bengaluru's strict 6-bin system) and multi-layered packaging is common. I built &lt;strong&gt;Sutham&lt;/strong&gt; (meaning "clean" in Tamil), an adaptive, continuous multimodal AI agent that acts as your personal waste-sorting buddy. &lt;/p&gt;

&lt;p&gt;Sutham isn't a simple "snap a photo and get a label" app. It runs a full autonomous loop (sense -&amp;gt; decide -&amp;gt; act -&amp;gt; check), asks clarifying questions when it's unsure, and literally learns from its mistakes on your device so it never fails the same way twice. &lt;/p&gt;

&lt;p&gt;It features an &lt;strong&gt;Adaptive Dual-Engine&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fully Offline (Local-First):&lt;/strong&gt; When you have no network, Sutham runs entirely on-device using a local vision model. It can classify waste, ask follow-up questions, and map to local rules without ever hitting a server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Multimodal Mode:&lt;/strong&gt; When online, it opens a continuous audio/video WebSocket to the cloud. You can hold your phone, point it at a pile of waste, and just have a normal conversation. It speaks natively in English, Hindi, Kannada, Tamil, and Telugu. It can even proactively warn you—if you pan the camera across a battery in silence, Sutham will interrupt to say, &lt;em&gt;"Whoa, I see a battery. Don't put that in the bin, I've mapped a drop-off kiosk for you."&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;


&lt;div&gt;
  &lt;iframe src="https://loom.com/embed/58a0acd054844e8d9385acbb90279b44"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/AnkitSurana" rel="noopener noreferrer"&gt;
        AnkitSurana
      &lt;/a&gt; / &lt;a href="https://github.com/AnkitSurana/sutham-app" rel="noopener noreferrer"&gt;
        sutham-app
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Sutham helps Indian households sort waste correctly, in any language, with or without internet. It speaks to you live through the camera and warns you about e-waste and hazardous items before you ask. Learns from your corrections.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Sutham&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;An on-device, agentic waste-sorting assistant for everyone.&lt;/p&gt;
&lt;p&gt;Point your phone at any waste item and Sutham identifies it, reasons about its
material, and tells you the correct &lt;strong&gt;BBMP bin&lt;/strong&gt; (Wet / Dry / Reject / Sanitary /
E-waste / Hazardous) and how to prepare it. It runs the full
&lt;strong&gt;sense -&amp;gt; decide -&amp;gt; act -&amp;gt; check&lt;/strong&gt; loop: it asks when it is unsure, defers e-waste
and hazardous items to a human drop-off, and &lt;strong&gt;learns your corrections&lt;/strong&gt; so the
next scan of the same item is instant - all on-device, no signal required.&lt;/p&gt;
&lt;p&gt;Built for the Google DeepMind Bangalore Hackathon:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma 4 (local-first agents)&lt;/strong&gt; - the offline agent loop on
on-device Gemma 4 E2B (vision).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PS1 Real-Time Multimodal&lt;/strong&gt; - a live voice-to-voice mode on the Gemini Live
API where you talk to Sutham and show it your bin.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Adaptive engine&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;The app picks its brain by connectivity…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/AnkitSurana/sutham-app" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;I built the mobile application using &lt;strong&gt;Flutter (Dart)&lt;/strong&gt; to ensure a smooth, native-feeling camera and audio experience across devices. &lt;/p&gt;

&lt;p&gt;Here are the most interesting technical decisions I made:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Custom PCM Audio &amp;amp; WebSockets:&lt;/strong&gt; For the Live Mode, I couldn't rely on basic turn-based REST APIs. I built a custom &lt;code&gt;live_controller.dart&lt;/code&gt; that manages a continuous WebSocket connection. It captures 16kHz audio from the mic, sends it via base64 chunks alongside ~1FPS silent video frames, and decodes incoming 24kHz PCM audio chunks to play the AI's voice natively.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Barge-In State Management:&lt;/strong&gt; True conversational AI needs to handle interruptions. If Sutham is speaking and the user talks over it ("Wait, what about the cap?"), the app instantly drops the current playback buffer and pivots context so it doesn't sound robotic or echo itself.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Proactive Vision Ticks:&lt;/strong&gt; Most AI only speaks when spoken to. I implemented a &lt;code&gt;_proactiveTick&lt;/code&gt; timer. Even if the user is silent, the app nudges the vision model every 5 seconds with the current camera frame. This allows Sutham to act as a true ambient buddy, catching hazards (like e-waste) completely unprompted.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;On-Device Learning Memory:&lt;/strong&gt; Instead of forcing complex RAG, I built a local &lt;code&gt;learning_store.dart&lt;/code&gt;. When Sutham proposes a bin and the user corrects it (e.g., "No, this specific cup is Reject waste"), it saves that specific signature locally. The next time the user scans that exact item, the response is instant and corrected.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Use of Google AI&lt;/strong&gt;&lt;br&gt;
I heavily utilized the absolute bleeding-edge of the Google AI stack to make Sutham adaptive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Gemma 4 E2B (On-Device Vision):&lt;/strong&gt; Powers the offline local-first agent loop via &lt;code&gt;flutter_gemma&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Gemini 3.1 Flash Live:&lt;/strong&gt; Powers the continuous, sub-second multimodal (voice-to-voice + video) streaming engine. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Gemini 3.5 Flash:&lt;/strong&gt; Used as a fallback for high-fidelity photo reasoning when full Live streaming isn't needed.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>ai</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
