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.
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.
💡 The Inspiration
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.
Donny isn’t just another chatbot — it’s your personal health buddy, designed to talk only about fitness, nutrition, rest, and wellness.
⚙️ Under the Hood — The Technical Build
For this project, I built Donny using FastAPI and Google’s Gemini 2.5 Flash model.
The stack choice was simple: FastAPI for its speed and simplicity, and Gemini for its ability to generate concise, natural replies.
Here’s what I focused on during development:
Strict Topic Control: Donny only responds to fitness or health-related messages.
Smart Greetings: It replies warmly to greetings like “hi” or “hello.”
Session Memory: Each user has a small stored chat history for context.
Error Handling: Graceful fallbacks for timeouts or API issues.
Rate Limiting: Prevents too many requests from hitting Gemini too quickly.
🧩 A2A Integration — Speaking Telex’s Language
The next challenge was making Donny fully A2A-compliant.
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.
To make Donny work seamlessly, I created a parsing system that:
Extracts the most recent user message from the conversation history
Sends it to Gemini for processing
Returns the response in Telex’s exact expected format, including jsonrpc, id, result, and status objects
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.
🧠 What Makes Donny Special
Donny isn’t built to talk about everything — and that’s its strength.
It only engages in topics around:
Physical health and exercise
Nutrition and hydration
Sleep and recovery
Posture and movement
Anything outside those areas? Donny politely declines, keeping the conversation on track.
This focus keeps the user experience clear, consistent, and purposeful.
⚔️ The Roadblocks
One of the toughest bugs I encountered was response invisibility — Telex wasn’t showing Donny’s messages even though the API returned “200 OK.”
After careful debugging using the Agent Logs endpoint, I discovered the issue:
I wasn’t structuring the result.status.message.parts correctly.
Once I matched the Telex JSON schema precisely, everything clicked.
It was a great reminder that in A2A systems, format precision matters just as much as logic.
🧪 Testing, Iteration, and Fine-Tuning
I simulated Telex requests locally with mock JSON-RPC payloads and tested Donny’s replies through real chat sessions.
Each improvement came from reading logs, catching timeout issues, and improving how the agent handled greetings and invalid topics.
Now, Donny runs smoothly — generating fast, clear responses, and keeping track of the last few user messages for context.
🚀 The Final Product
Today, Donny is a fast, health-focused AI agent that can:
✅ Respond gracefully to greetings
✅ Generate practical health tips under 200 characters
✅ Filter out off-topic queries
✅ Maintain short-term chat context
✅ Deliver fully A2A-compliant Telex responses
Every message from Donny feels natural, short, and motivating — just the kind of presence that fits perfectly into a workday chat.
📚 Lessons Learned
Building Donny taught me several key lessons:
Precision over power: It’s better to build one focused agent than a general-purpose one.
JSON-RPC structure matters: Telex requires strict formatting — no shortcuts.
Health AI needs restraint: The best agents know what not to talk about.
Logs are gold: The Telex Agent Logs were my best debugging ally.
🌱 What’s Next for Donny
I plan to enhance Donny with:
Personalized daily fitness challenges
Integration with wearable health APIs (like Fitbit)
Multilingual support for international users
A dashboard that visualizes daily health streaks
❤️ Final Thoughts
This project reminded me that AI agents don’t have to be complicated to be impactful.
Sometimes, it’s about building a small companion that fits naturally into people’s routines and helps them live a bit healthier each day.
Donny might be a simple agent — but it has a clear purpose:
“To keep your body in motion and your mind refreshed, one tip at a time.” 💪
Top comments (0)