<?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: Ola tobey</title>
    <description>The latest articles on Forem by Ola tobey (@toby_paul1907).</description>
    <link>https://forem.com/toby_paul1907</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%2F323740%2F8e1b197f-a145-437a-a5ea-7949c9a578bf.jpg</url>
      <title>Forem: Ola tobey</title>
      <link>https://forem.com/toby_paul1907</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/toby_paul1907"/>
    <language>en</language>
    <item>
      <title>Building NASA Space Explorer: My Journey Integrating AI Agents with Telex.im</title>
      <dc:creator>Ola tobey</dc:creator>
      <pubDate>Sun, 02 Nov 2025 21:24:15 +0000</pubDate>
      <link>https://forem.com/toby_paul1907/building-nasa-space-explorer-my-journey-integrating-ai-agents-with-telexim-4bnc</link>
      <guid>https://forem.com/toby_paul1907/building-nasa-space-explorer-my-journey-integrating-ai-agents-with-telexim-4bnc</guid>
      <description>&lt;p&gt;&lt;strong&gt;From Zero to A2A Compliant Agent in 72 Hours&lt;/strong&gt;&lt;br&gt;
When I received the Stage 3 task for HNG Internship - "Build and Integrate AI Agents" - I knew I wanted to create something that combined my passion for space exploration with modern chat platform integration. The result? NASA Space Explorer, an A2A compliant agent that brings the wonders of the universe directly to Telex.im chat. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🚀 The Vision&lt;/strong&gt;&lt;br&gt;
Space has always fascinated me. The daily Astronomy Picture of the Day (APOD) from NASA has been part of my morning routine for years. What if I could make this experience more accessible, right within the chat platform my team uses daily? That's how NASA Space Explorer was born.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🛠️ Technical Architecture&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Choosing the Stack&lt;/strong&gt;&lt;br&gt;
As a Python developer, I opted for FastAPI - it's perfect for building robust APIs quickly. The key requirements were:&lt;/p&gt;

&lt;p&gt;A2A protocol compliance&lt;/p&gt;

&lt;p&gt;NASA APOD API integration&lt;/p&gt;

&lt;p&gt;Telex.im compatibility&lt;/p&gt;

&lt;p&gt;Error handling and fallbacks&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The A2A Protocol Challenge&lt;/strong&gt;&lt;br&gt;
The A2A (Agent-to-Agent) protocol uses JSON-RPC 2.0, which sounded straightforward until I saw Telex's actual message structure. The complexity was in the nested data arrays containing conversation history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt; Telex sends the entire conversation context, not just the current message. My agent needed to intelligently extract the most recent user command from this historical data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NASA API Integration&lt;/strong&gt;&lt;br&gt;
NASA's APOD API is fantastic but has rate limits. I implemented:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caching:&lt;/strong&gt; 1-hour cache to avoid repeated API calls&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Timeout handling:&lt;/strong&gt; 8-second timeout with graceful fallbacks&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiple image sources:&lt;/strong&gt; Primary API + fallback images&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 The Breakthrough Moment&lt;/strong&gt;&lt;br&gt;
The biggest challenge was command detection. Initially, my agent was confused by previous bot responses in the conversation history. The solution? Reverse chronological parsing - looking for the most recent user command while filtering out bot responses.&lt;/p&gt;

&lt;p&gt;def extract_user_message_simple(params):&lt;br&gt;
    # Look for user commands in reverse order (most recent first)&lt;br&gt;
    for text in reversed(all_texts):&lt;br&gt;
        if not is_bot_response(text):&lt;br&gt;
            command = detect_command(text)&lt;br&gt;
            if command:&lt;br&gt;
                return command&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🎯 Key Features Implemented&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1. Robust Command Detection&lt;/strong&gt;&lt;br&gt;
Handles variations: "today", "today's image", "random fact", etc.&lt;/p&gt;

&lt;p&gt;Filters out bot responses and previous messages&lt;/p&gt;

&lt;p&gt;Graceful fallback to default command&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Comprehensive Error Handling&lt;/strong&gt;&lt;br&gt;
NASA API timeout management&lt;/p&gt;

&lt;p&gt;Network failure fallbacks&lt;/p&gt;

&lt;p&gt;Invalid response validation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. User-Friendly Responses&lt;/strong&gt;&lt;br&gt;
Clear, clickable image URLs&lt;/p&gt;

&lt;p&gt;Informative space facts&lt;/p&gt;

&lt;p&gt;Helpful command guidance&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧪 Testing and Iteration&lt;/strong&gt;&lt;br&gt;
The integration process involved constant testing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Local testing with simulated A2A requests&lt;/li&gt;
&lt;li&gt;Telex integration and real-world usage&lt;/li&gt;
&lt;li&gt;Log analysis using Telex's agent logs endpoint&lt;/li&gt;
&lt;li&gt;User feedback from team members&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The most valuable debugging tool was Telex's agent logs at &lt;a href="https://api.telex.im/agent-logs/%7Bchannel-id%7D.txt" rel="noopener noreferrer"&gt;https://api.telex.im/agent-logs/{channel-id}.txt&lt;/a&gt; - they provided complete visibility into the request-response cycle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📈 Results and Impact&lt;/strong&gt;&lt;br&gt;
After deployment, the agent successfully:&lt;/p&gt;

&lt;p&gt;✅ Processes natural language commands&lt;/p&gt;

&lt;p&gt;✅ Returns beautiful astronomy images with descriptions&lt;/p&gt;

&lt;p&gt;✅ Provides educational space facts&lt;/p&gt;

&lt;p&gt;✅ Handles errors gracefully&lt;/p&gt;

&lt;p&gt;✅ Integrates seamlessly with Telex.im&lt;/p&gt;

&lt;p&gt;Team response has been fantastic! My colleagues now start their day with space images and facts, bringing a bit of cosmic wonder to our daily standups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🎓 Lessons Learned&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Protocols matter:&lt;/strong&gt; Understanding A2A/JSON-RPC 2.0 was crucial.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real data beats assumptions:&lt;/strong&gt; Telex's actual message structure was more complex than expected&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error handling is feature:&lt;/strong&gt; Users appreciate graceful degradation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Simple is better: Clear, clickable URLs often work better than complex embedding&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔮 Future Enhancements&lt;/strong&gt;&lt;br&gt;
Image search by date ("show me image from 2020-01-15")&lt;/p&gt;

&lt;p&gt;Space news integration&lt;/p&gt;

&lt;p&gt;Multiple language support&lt;/p&gt;

&lt;p&gt;Interactive image exploration&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🙏 Acknowledgments&lt;/strong&gt;&lt;br&gt;
This project was built for HNG Internship Stage 3. Special thanks to:&lt;/p&gt;

&lt;p&gt;Telex.im for the amazing platform and A2A protocol&lt;/p&gt;

&lt;p&gt;NASA for the incredible APOD API&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HNG Internship&lt;/strong&gt; for the challenging and educational task&lt;/p&gt;

&lt;p&gt;The experience taught me that building useful AI agents isn't just about the algorithms - it's about creating seamless, delightful user experiences that integrate naturally into people's workflows.&lt;/p&gt;

&lt;p&gt;The cosmos is now just a chat message away! 🌌&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://github.com/toby1907/nasa-space-explorer" rel="noopener noreferrer"&gt;Want to build your own? Check out the GitHub repository and start exploring!&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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