<?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: Nishtha Darji</title>
    <description>The latest articles on Forem by Nishtha Darji (@nishthadarji20).</description>
    <link>https://forem.com/nishthadarji20</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%2F3880194%2F1617dd12-329a-49d1-8643-5f5c41c98833.png</url>
      <title>Forem: Nishtha Darji</title>
      <link>https://forem.com/nishthadarji20</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nishthadarji20"/>
    <language>en</language>
    <item>
      <title>How I Built a Voice-Controlled AI Agent with Groq &amp; Streamlit</title>
      <dc:creator>Nishtha Darji</dc:creator>
      <pubDate>Wed, 15 Apr 2026 12:10:45 +0000</pubDate>
      <link>https://forem.com/nishthadarji20/how-i-built-a-voice-controlled-ai-agent-with-groq-streamlit-47o2</link>
      <guid>https://forem.com/nishthadarji20/how-i-built-a-voice-controlled-ai-agent-with-groq-streamlit-47o2</guid>
      <description>&lt;p&gt;I built a fully working voice-controlled AI agent that transcribes speech, classifies intent, and executes local tools — all powered by Groq's free AI APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 What It Does
&lt;/h2&gt;

&lt;p&gt;You speak → It listens → It understands → It acts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Say &lt;em&gt;"Write a Python retry function"&lt;/em&gt; → generates code and saves to file&lt;/li&gt;
&lt;li&gt;Say &lt;em&gt;"Summarize this text"&lt;/em&gt; → returns a clean summary&lt;/li&gt;
&lt;li&gt;Say &lt;em&gt;"What is machine learning?"&lt;/em&gt; → responds conversationally&lt;/li&gt;
&lt;li&gt;Say &lt;em&gt;"Create a file called notes.txt"&lt;/em&gt; → creates the file safely&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🏗️ Architecture
&lt;/h2&gt;

&lt;p&gt;Audio Input → Groq Whisper (STT) → Groq LLaMA 3.3 70B (Intent) → Tool Execution → Streamlit UI&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 Models I Chose &amp;amp; Why
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Speech-to-Text:&lt;/strong&gt; Groq Whisper large-v3&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transcribes audio in under 2 seconds&lt;/li&gt;
&lt;li&gt;Free tier available, no GPU needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;LLM:&lt;/strong&gt; Groq LLaMA 3.3 70B Versatile&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accurately classifies intent from natural speech&lt;/li&gt;
&lt;li&gt;Handles compound commands like "write X and save to Y.py"&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ⚙️ Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Streamlit&lt;/strong&gt; — Web UI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Groq API&lt;/strong&gt; — STT + LLM&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python&lt;/strong&gt; — Backend logic&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚧 Challenges I Faced
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Model Deprecation&lt;/strong&gt;&lt;br&gt;
During development, &lt;code&gt;llama3-8b-8192&lt;/code&gt; was decommissioned by Groq. I switched to &lt;code&gt;llama-3.3-70b-versatile&lt;/code&gt; which is more powerful and still free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Compound Commands&lt;/strong&gt;&lt;br&gt;
Handling commands like "Write a bubble sort and save it to sort.py" required careful prompt engineering to extract both the intent and filename simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Safe File Operations&lt;/strong&gt;&lt;br&gt;
All file writes are sandboxed to an &lt;code&gt;output/&lt;/code&gt; folder with path traversal protection so no system files can be accidentally overwritten.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ Bonus Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;✅ Human-in-the-loop confirmation before file operations&lt;/li&gt;
&lt;li&gt;✅ Session memory — last 4 turns passed as context&lt;/li&gt;
&lt;li&gt;✅ Auto fallback if API fails&lt;/li&gt;
&lt;li&gt;✅ Compound command support&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔗 Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub:(&lt;a href="https://github.com/nishtha-3011/voice-ai-agent" rel="noopener noreferrer"&gt;https://github.com/nishtha-3011/voice-ai-agent&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading! Feel free to star the repo if you found it useful ⭐&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>streamlit</category>
      <category>groq</category>
    </item>
  </channel>
</rss>
