<?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: Izuchukwu Mcgibson </title>
    <description>The latest articles on DEV Community by Izuchukwu Mcgibson  (@mcgibson).</description>
    <link>https://dev.to/mcgibson</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%2F3596337%2Ff644cc67-de34-4804-b837-7321a601e3c6.png</url>
      <title>DEV Community: Izuchukwu Mcgibson </title>
      <link>https://dev.to/mcgibson</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mcgibson"/>
    <language>en</language>
    <item>
      <title>Building an AI-Powered Focus Tracker for Telex Using Python and Gemini API</title>
      <dc:creator>Izuchukwu Mcgibson </dc:creator>
      <pubDate>Tue, 04 Nov 2025 19:13:00 +0000</pubDate>
      <link>https://dev.to/mcgibson/building-an-ai-powered-focus-tracker-for-telex-using-python-and-gemini-api-4f88</link>
      <guid>https://dev.to/mcgibson/building-an-ai-powered-focus-tracker-for-telex-using-python-and-gemini-api-4f88</guid>
      <description>&lt;p&gt;Staying focused while working remotely can be tough — distractions are everywhere. To solve that, I recently built an &lt;strong&gt;AI-powered Focus Tracker&lt;/strong&gt; integrated directly into &lt;strong&gt;Telex&lt;/strong&gt;, allowing users to manage work sessions, breaks, and even chat with an assistant — all from their Telex workspace.&lt;/p&gt;

&lt;p&gt;🧠 What the Agent Does&lt;/p&gt;

&lt;p&gt;The Focus Tracker isn’t just a timer. It acts as a &lt;strong&gt;smart productivity assistant&lt;/strong&gt; that helps you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⏱️ &lt;strong&gt;Start/Stop focus sessions&lt;/strong&gt; using simple commands like &lt;code&gt;/focus start&lt;/code&gt; or &lt;code&gt;/focus stop&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Track session progress&lt;/strong&gt; and view your focus status anytime with &lt;code&gt;/focus status&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;🧘 &lt;strong&gt;Enable daily summaries&lt;/strong&gt; that send a quick report of your focus activity.&lt;/li&gt;
&lt;li&gt;💬 &lt;strong&gt;Chat with Gemini AI&lt;/strong&gt; directly in Telex — the agent answers questions, motivates you, and provides productivity tips.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All interactions happen &lt;em&gt;inside Telex&lt;/em&gt;, so you never have to leave your workspace.&lt;/p&gt;




&lt;p&gt;⚙️ How It Works&lt;/p&gt;

&lt;p&gt;The agent runs on a Python backend (hosted on &lt;strong&gt;Railway&lt;/strong&gt;) with Flask handling the webhook. The key workflow looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;User sends a command&lt;/strong&gt; (e.g. &lt;code&gt;/focus start 30 5&lt;/code&gt;) to Telex.&lt;/li&gt;
&lt;li&gt;The Telex platform triggers a POST request to my &lt;code&gt;/webhook&lt;/code&gt; endpoint.&lt;/li&gt;
&lt;li&gt;The webhook decodes the command and calls the right function:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;start_focus()&lt;/code&gt; → begins a session and sets a timer.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;stop_focus()&lt;/code&gt; → stops a running session.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;status()&lt;/code&gt; → reports how long you’ve been focused.

&lt;ol&gt;
&lt;li&gt;Responses are sent back to Telex using the &lt;code&gt;send_to_telex()&lt;/code&gt; helper function.&lt;/li&gt;
&lt;li&gt;If the message isn’t a command, it goes straight to &lt;strong&gt;Google’s Gemini API&lt;/strong&gt; for AI responses.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s a small snippet of how the webhook interprets commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/focus start&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;start_focus&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/focus stop&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;stop_focus&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/focus status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;ai_reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ai_generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;send_to_telex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;channel_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ai_reply&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The logic is simple yet flexible — making it easy to extend the agent with new commands later.&lt;/p&gt;




&lt;p&gt;🛠️ Tech Stack&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python (Flask)&lt;/strong&gt; — for the webhook and routing logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telex API&lt;/strong&gt; — for message delivery and channel interactions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Gemini API&lt;/strong&gt; — for natural language responses and productivity tips.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Railway&lt;/strong&gt; — for quick and reliable deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment Variables (.env)&lt;/strong&gt; — for securely storing API keys and config values.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;💡 Lessons Learned&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You don’t always need a full dashboard — sometimes, &lt;strong&gt;intelligent command handling&lt;/strong&gt; in the webhook is enough.&lt;/li&gt;
&lt;li&gt;Telex makes it incredibly easy to plug in AI agents without manual configuration panels.&lt;/li&gt;
&lt;li&gt;Managing environment variables properly avoids exposing sensitive API keys (like Google’s).&lt;/li&gt;
&lt;li&gt;A well-structured Flask app can power multiple Telex agents with minimal duplication.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;🌟 What’s Next&lt;/p&gt;

&lt;p&gt;I plan to enhance this agent with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔔 Focus reminders using scheduled notifications.&lt;/li&gt;
&lt;li&gt;📅 A weekly summary of total focused hours.&lt;/li&gt;
&lt;li&gt;📈 Integration with Notion or Google Sheets for focus analytics.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;💬 Final Thoughts&lt;/p&gt;

&lt;p&gt;This project taught me how &lt;strong&gt;AI agents can live inside team communication tools&lt;/strong&gt; and make productivity both fun and smart. Instead of opening another app to track tasks or set timers, I can now do it conversationally — right where collaboration happens.&lt;/p&gt;

&lt;p&gt;If you’d like to build yours, all you need is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Telex account&lt;/li&gt;
&lt;li&gt;A Python server&lt;/li&gt;
&lt;li&gt;A Gemini API key&lt;/li&gt;
&lt;li&gt;Creativity 🧠&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; McGibson Izuchukwu&lt;br&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/izuchukwuMcGibson" rel="noopener noreferrer"&gt;github.com/izuchukwuMcGibson&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/mcgibson-izuchukwu-ba09a5311" rel="noopener noreferrer"&gt;www.linkedin.com/in/mcgibson-izuchukwu-ba09a5311&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
