<?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: Santhosh</title>
    <description>The latest articles on DEV Community by Santhosh (@santhosh_120).</description>
    <link>https://dev.to/santhosh_120</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%2F3874725%2F6d07f402-959b-4538-bb76-0c6225eff9c2.png</url>
      <title>DEV Community: Santhosh</title>
      <link>https://dev.to/santhosh_120</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/santhosh_120"/>
    <language>en</language>
    <item>
      <title>Building a Voice-Controlled AI Agent with Groq &amp; Gradio</title>
      <dc:creator>Santhosh</dc:creator>
      <pubDate>Sun, 12 Apr 2026 10:29:01 +0000</pubDate>
      <link>https://dev.to/santhosh_120/building-a-voice-controlled-ai-agent-with-groq-gradio-15pb</link>
      <guid>https://dev.to/santhosh_120/building-a-voice-controlled-ai-agent-with-groq-gradio-15pb</guid>
      <description>&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;A voice-controlled AI agent that: records your voice → transcribes it → &lt;br&gt;
understands your intent → executes the right action → shows everything in a UI.&lt;/p&gt;

&lt;p&gt;Built for the Mem0 AI Internship assignment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;Voice Input → Groq Whisper (STT) → LLaMA 3.3 70B (Intent) → Tool Executor → Gradio UI&lt;/p&gt;

&lt;h2&gt;
  
  
  Model Choices
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Speech-to-Text: Whisper-large-v3 via Groq&lt;/strong&gt;&lt;br&gt;
I initially planned to run Whisper locally using HuggingFace, but on a CPU-only &lt;br&gt;
Windows machine this was extremely slow (30+ seconds per clip). Groq's API gives &lt;br&gt;
sub-second transcription for free, making the user experience much better.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM: LLaMA 3.3 70B via Groq&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Running a 70B model locally requires 40GB+ VRAM. Groq's free tier handles this &lt;br&gt;
instantly. The model is prompted to return structured JSON for reliable intent parsing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Intent Classification Trick
&lt;/h2&gt;

&lt;p&gt;The key insight was prompting the LLM to return ONLY JSON — no explanation, &lt;br&gt;
no markdown. Combined with low temperature (0.1), this gives very consistent results.&lt;/p&gt;

&lt;p&gt;It also supports compound commands: "Write a retry function AND save it" &lt;br&gt;
correctly returns intents: ["write_code", "create_file"].&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JSON parsing&lt;/strong&gt; — LLMs sometimes wrap JSON in markdown fences. &lt;br&gt;
Fixed with regex: &lt;code&gt;re.sub(r"&lt;/code&gt;&lt;code&gt;json\s*|\s*&lt;/code&gt;&lt;code&gt;", "", raw)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Audio formats&lt;/strong&gt; — Gradio passes temp file paths. &lt;br&gt;
Opening with "rb" and letting Groq handle format detection solved this.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Safety&lt;/strong&gt; — Used os.path.basename() to prevent path traversal attacks &lt;br&gt;
when creating files.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What I'd Add With More Time
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Local model support via Ollama (offline mode)&lt;/li&gt;
&lt;li&gt;Wake word detection&lt;/li&gt;
&lt;li&gt;Web search tool integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GitHub &amp;amp; Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Code: &lt;a href="https://github.com/SANTHOSH-120/voice-agent.git" rel="noopener noreferrer"&gt;https://github.com/SANTHOSH-120/voice-agent.git&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Demo: &lt;a href="https://youtu.be/Q2vEAmrYtYg" rel="noopener noreferrer"&gt;https://youtu.be/Q2vEAmrYtYg&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
