<?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: wilson icheku</title>
    <description>The latest articles on DEV Community by wilson icheku (@wilson_icheku_c8d53d85ca7).</description>
    <link>https://dev.to/wilson_icheku_c8d53d85ca7</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%2F3596076%2F509b20c7-ad9a-49a7-9c83-5191d213fb5c.jpg</url>
      <title>DEV Community: wilson icheku</title>
      <link>https://dev.to/wilson_icheku_c8d53d85ca7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wilson_icheku_c8d53d85ca7"/>
    <language>en</language>
    <item>
      <title>Building Donny — My Telex Health Assistant with FastAPI and Gemini</title>
      <dc:creator>wilson icheku</dc:creator>
      <pubDate>Tue, 04 Nov 2025 15:07:53 +0000</pubDate>
      <link>https://dev.to/wilson_icheku_c8d53d85ca7/building-donny-my-telex-health-assistant-with-fastapi-and-gemini-44hp</link>
      <guid>https://dev.to/wilson_icheku_c8d53d85ca7/building-donny-my-telex-health-assistant-with-fastapi-and-gemini-44hp</guid>
      <description>&lt;p&gt;The HNG Stage 3 task for “How to Build and Integrate AI Agents” came with an exciting challenge — to design a fully functional, A2A-compliant AI that could interact seamlessly on Telex.im.&lt;/p&gt;

&lt;p&gt;Rather than building a general-purpose chatbot, I decided to focus on something that adds real daily value: a friendly health assistant that encourages wellness and body care. That’s how Donny, the health and fitness AI agent, was born.&lt;/p&gt;

&lt;p&gt;💡 The Inspiration&lt;/p&gt;

&lt;p&gt;Many people, including me, spend long hours working behind screens — often forgetting to stretch, hydrate, or move. I wanted to create an agent that would gently remind users to take care of their bodies and share short, practical health tips.&lt;/p&gt;

&lt;p&gt;Donny isn’t just another chatbot — it’s your personal health buddy, designed to talk only about fitness, nutrition, rest, and wellness.&lt;/p&gt;

&lt;p&gt;⚙️ Under the Hood — The Technical Build&lt;/p&gt;

&lt;p&gt;For this project, I built Donny using FastAPI and Google’s Gemini 2.5 Flash model.&lt;br&gt;
The stack choice was simple: FastAPI for its speed and simplicity, and Gemini for its ability to generate concise, natural replies.&lt;/p&gt;

&lt;p&gt;Here’s what I focused on during development:&lt;/p&gt;

&lt;p&gt;Strict Topic Control: Donny only responds to fitness or health-related messages.&lt;/p&gt;

&lt;p&gt;Smart Greetings: It replies warmly to greetings like “hi” or “hello.”&lt;/p&gt;

&lt;p&gt;Session Memory: Each user has a small stored chat history for context.&lt;/p&gt;

&lt;p&gt;Error Handling: Graceful fallbacks for timeouts or API issues.&lt;/p&gt;

&lt;p&gt;Rate Limiting: Prevents too many requests from hitting Gemini too quickly.&lt;/p&gt;

&lt;p&gt;🧩 A2A Integration — Speaking Telex’s Language&lt;/p&gt;

&lt;p&gt;The next challenge was making Donny fully A2A-compliant.&lt;br&gt;
Telex uses the JSON-RPC 2.0 standard for message exchange — but not in the most straightforward way. It sends complex nested objects containing chat history, roles, and context IDs.&lt;/p&gt;

&lt;p&gt;To make Donny work seamlessly, I created a parsing system that:&lt;/p&gt;

&lt;p&gt;Extracts the most recent user message from the conversation history&lt;/p&gt;

&lt;p&gt;Sends it to Gemini for processing&lt;/p&gt;

&lt;p&gt;Returns the response in Telex’s exact expected format, including jsonrpc, id, result, and status objects&lt;/p&gt;

&lt;p&gt;Once this was implemented correctly, Telex began displaying Donny’s replies directly in the chat — no more default “Here’s your daily health tip!” placeholder message.&lt;/p&gt;

&lt;p&gt;🧠 What Makes Donny Special&lt;/p&gt;

&lt;p&gt;Donny isn’t built to talk about everything — and that’s its strength.&lt;br&gt;
It only engages in topics around:&lt;/p&gt;

&lt;p&gt;Physical health and exercise&lt;/p&gt;

&lt;p&gt;Nutrition and hydration&lt;/p&gt;

&lt;p&gt;Sleep and recovery&lt;/p&gt;

&lt;p&gt;Posture and movement&lt;/p&gt;

&lt;p&gt;Anything outside those areas? Donny politely declines, keeping the conversation on track.&lt;/p&gt;

&lt;p&gt;This focus keeps the user experience clear, consistent, and purposeful.&lt;/p&gt;

&lt;p&gt;⚔️ The Roadblocks&lt;/p&gt;

&lt;p&gt;One of the toughest bugs I encountered was response invisibility — Telex wasn’t showing Donny’s messages even though the API returned “200 OK.”&lt;br&gt;
After careful debugging using the Agent Logs endpoint, I discovered the issue:&lt;br&gt;
I wasn’t structuring the result.status.message.parts correctly.&lt;/p&gt;

&lt;p&gt;Once I matched the Telex JSON schema precisely, everything clicked.&lt;/p&gt;

&lt;p&gt;It was a great reminder that in A2A systems, format precision matters just as much as logic.&lt;/p&gt;

&lt;p&gt;🧪 Testing, Iteration, and Fine-Tuning&lt;/p&gt;

&lt;p&gt;I simulated Telex requests locally with mock JSON-RPC payloads and tested Donny’s replies through real chat sessions.&lt;/p&gt;

&lt;p&gt;Each improvement came from reading logs, catching timeout issues, and improving how the agent handled greetings and invalid topics.&lt;/p&gt;

&lt;p&gt;Now, Donny runs smoothly — generating fast, clear responses, and keeping track of the last few user messages for context.&lt;/p&gt;

&lt;p&gt;🚀 The Final Product&lt;/p&gt;

&lt;p&gt;Today, Donny is a fast, health-focused AI agent that can:&lt;/p&gt;

&lt;p&gt;✅ Respond gracefully to greetings&lt;br&gt;
✅ Generate practical health tips under 200 characters&lt;br&gt;
✅ Filter out off-topic queries&lt;br&gt;
✅ Maintain short-term chat context&lt;br&gt;
✅ Deliver fully A2A-compliant Telex responses&lt;/p&gt;

&lt;p&gt;Every message from Donny feels natural, short, and motivating — just the kind of presence that fits perfectly into a workday chat.&lt;/p&gt;

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

&lt;p&gt;Building Donny taught me several key lessons:&lt;/p&gt;

&lt;p&gt;Precision over power: It’s better to build one focused agent than a general-purpose one.&lt;/p&gt;

&lt;p&gt;JSON-RPC structure matters: Telex requires strict formatting — no shortcuts.&lt;/p&gt;

&lt;p&gt;Health AI needs restraint: The best agents know what not to talk about.&lt;/p&gt;

&lt;p&gt;Logs are gold: The Telex Agent Logs were my best debugging ally.&lt;/p&gt;

&lt;p&gt;🌱 What’s Next for Donny&lt;/p&gt;

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

&lt;p&gt;Personalized daily fitness challenges&lt;/p&gt;

&lt;p&gt;Integration with wearable health APIs (like Fitbit)&lt;/p&gt;

&lt;p&gt;Multilingual support for international users&lt;/p&gt;

&lt;p&gt;A dashboard that visualizes daily health streaks&lt;/p&gt;

&lt;p&gt;❤️ Final Thoughts&lt;/p&gt;

&lt;p&gt;This project reminded me that AI agents don’t have to be complicated to be impactful.&lt;br&gt;
Sometimes, it’s about building a small companion that fits naturally into people’s routines and helps them live a bit healthier each day.&lt;/p&gt;

&lt;p&gt;Donny might be a simple agent — but it has a clear purpose:&lt;/p&gt;

&lt;p&gt;“To keep your body in motion and your mind refreshed, one tip at a time.” 💪&lt;/p&gt;

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