<?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: Ade Adebayo</title>
    <description>The latest articles on Forem by Ade Adebayo (@myitjournal).</description>
    <link>https://forem.com/myitjournal</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%2F3594732%2F61d0bc1f-b259-4fec-a48a-0098389b4590.png</url>
      <title>Forem: Ade Adebayo</title>
      <link>https://forem.com/myitjournal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/myitjournal"/>
    <language>en</language>
    <item>
      <title>Building a Production-Ready A2A Protocol Agent: A Technical Journey</title>
      <dc:creator>Ade Adebayo</dc:creator>
      <pubDate>Mon, 03 Nov 2025 22:44:21 +0000</pubDate>
      <link>https://forem.com/myitjournal/building-a-production-ready-a2a-protocol-agent-a-technical-journey-2i68</link>
      <guid>https://forem.com/myitjournal/building-a-production-ready-a2a-protocol-agent-a-technical-journey-2i68</guid>
      <description>&lt;p&gt;So, this week came with a new challenge, tasking but interesting. This document chronicles the development of a simple A2A (Agent-to-Agent) Protocol agent built with Python and FastAPI. The agent monitors package dependencies for security vulnerabilities, providing both conversational (Telex) and RESTful interfaces.&lt;/p&gt;

&lt;p&gt;Package Health Monitor Agent is an A2A (Agent-to-Agent) Protocol AI Agent built with Python and FastAPI that monitors package dependencies for security vulnerabilities, outdated versions, and deprecated packages. It was designed for Telex integration with natural language processing capabilities.&lt;/p&gt;

&lt;p&gt;Its features include: A2A Protocol Support, Multi-Language Support, Security Scanning, Health Scoring, Smart Recommendations, Natural Language and RESTful API with traditional REST endpoints for direct integration&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;&lt;br&gt;
This project was carried out as part of the HNG stage tasks. However, modern software projects depend on dozens, sometimes hundreds, of third-party packages. These dependencies can become outdated, vulnerable or deprecated, and developers need a quick, conversational way to check their dependencies' health without context-switching between multiple websites and tools.&lt;/p&gt;

&lt;p&gt;This problem led to building this AI agent that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Accepts natural language queries ("Check flask==2.0.1, requests==2.25.0")&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Analyzes packages across multiple ecosystems (Python/PyPI, JavaScript/npm)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Checks real-time vulnerability databases (OSV)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provides actionable recommendations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integrates with Telex for conversational workflows&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Core Components&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;FastAPI Application (main_a2a.py)&lt;/li&gt;
&lt;li&gt;Modern async web framework&lt;/li&gt;
&lt;li&gt;Automatic OpenAPI documentation&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Native Pydantic integration for validation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Models (models/)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;a2a.py - A2A Protocol models (messages, requests, responses)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;schemas.py - API request/response models&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A2A Handler (a2a_handler.py)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Message processing logic&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Natural language parsing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Package analysis orchestration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Package Checker&lt;br&gt;
Integration with external APIs:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PyPI - Python Package Index (&lt;a href="https://pypi.org/pypi/%7Bpackage%7D/json" rel="noopener noreferrer"&gt;https://pypi.org/pypi/{package}/json&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;npm - Node Package Manager (&lt;a href="https://registry.npmjs.org/%7Bpackage%7D" rel="noopener noreferrer"&gt;https://registry.npmjs.org/{package}&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;OSV - Open Source Vulnerabilities (&lt;a href="https://api.osv.dev/v1/query" rel="noopener noreferrer"&gt;https://api.osv.dev/v1/query&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A2A Handler (a2a_handler.py)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Message processing logic&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Natural language parsing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Package analysis orchestration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Package Checker&lt;br&gt;
Integration with external APIs:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PyPI - Python Package Index (&lt;a href="https://pypi.org/pypi/%7Bpackage%7D/json" rel="noopener noreferrer"&gt;https://pypi.org/pypi/{package}/json&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;npm - Node Package Manager (&lt;a href="https://registry.npmjs.org/%7Bpackage%7D" rel="noopener noreferrer"&gt;https://registry.npmjs.org/{package}&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;OSV - Open Source Vulnerabilities (&lt;a href="https://api.osv.dev/v1/query" rel="noopener noreferrer"&gt;https://api.osv.dev/v1/query&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Live API:&lt;/strong&gt; &lt;a href="https://packagehealthmonitoragent-2367cacc569a.herokuapp.com/" rel="noopener noreferrer"&gt;https://packagehealthmonitoragent-2367cacc569a.herokuapp.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentation:&lt;/strong&gt; &lt;a href="https://packagehealthmonitoragent-2367cacc569a.herokuapp.com/docs" rel="noopener noreferrer"&gt;https://packagehealthmonitoragent-2367cacc569a.herokuapp.com/docs&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;&lt;em&gt;**Technical Stack&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;Core Technologies&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;3.13&lt;/td&gt;
&lt;td&gt;Runtime with improved performance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FastAPI&lt;/td&gt;
&lt;td&gt;0.115.5&lt;/td&gt;
&lt;td&gt;Async web framework&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pydantic&lt;/td&gt;
&lt;td&gt;2.10.3&lt;/td&gt;
&lt;td&gt;Data validation with strict typing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Uvicorn&lt;/td&gt;
&lt;td&gt;0.32.1&lt;/td&gt;
&lt;td&gt;ASGI server for production&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Requests&lt;/td&gt;
&lt;td&gt;2.32.3&lt;/td&gt;
&lt;td&gt;HTTP client for external APIs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;External APIs&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PyPI JSON API&lt;/strong&gt; - &lt;code&gt;https://pypi.org/pypi/{package}/json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm Registry&lt;/strong&gt; - &lt;code&gt;https://registry.npmjs.org/{package}&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OSV Database&lt;/strong&gt; - &lt;code&gt;https://api.osv.dev/v1/query&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Development Tools&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Git/GitHub&lt;/strong&gt; - Version control&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Heroku&lt;/strong&gt; - PaaS deployment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Postman&lt;/strong&gt; - API testing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VS Code&lt;/strong&gt; - Development environment&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Performance Characteristics
&lt;/h2&gt;

&lt;p&gt;Response Times (Average)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;/health&lt;/strong&gt; - &amp;lt;10ms (no external calls)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;/check-package&lt;/strong&gt; - 150-300ms (2 external API calls)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;/analyze/python&lt;/strong&gt; - 500ms-2s (N packages × 2 API calls each)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;/a2a&lt;/strong&gt; - 200ms-2s (depends on message complexity)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Scalability Considerations&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Current Limitations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sequential package checking (no parallelization)&lt;/li&gt;
&lt;li&gt;No caching of PyPI/npm responses&lt;/li&gt;
&lt;li&gt;No rate limiting on external APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Future Improvements:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;asyncio.gather()&lt;/code&gt; for parallel package checks&lt;/li&gt;
&lt;li&gt;Implement Redis cache for package metadata&lt;/li&gt;
&lt;li&gt;Add rate limiting with exponential backoff&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code Statistics&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Language                 Files        Lines         Code     Comments
────────────────────────────────────────────────────────────────────
Python                       4          850          650          100
Markdown                     2          650          550           50
TOML                         1           20           18            2
Text                         2           15           15            0
────────────────────────────────────────────────────────────────────
Total                        9         1535         1233          152
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test Coverage&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A2A Protocol: Tested&lt;/li&gt;
&lt;li&gt;Python Package Analysis: Tested&lt;/li&gt;
&lt;li&gt;npm Package Analysis: Tested&lt;/li&gt;
&lt;li&gt;Error Handling: Tested&lt;/li&gt;
&lt;li&gt;Edge Cases: Tested&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Resources &amp;amp; References&lt;/p&gt;

&lt;p&gt;Documentation&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://fastapi.tiangolo.com/" rel="noopener noreferrer"&gt;FastAPI Official Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.pydantic.dev/latest/" rel="noopener noreferrer"&gt;Pydantic V2 Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.jsonrpc.org/specification" rel="noopener noreferrer"&gt;JSON-RPC 2.0 Specification&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Telex-AI/A2A-Protocol" rel="noopener noreferrer"&gt;A2A Protocol Specification&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ossf.github.io/osv-schema/" rel="noopener noreferrer"&gt;OSV Schema&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Helpful Articles&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Type Hints in Python" - Real Python&lt;/li&gt;
&lt;li&gt;"Building Production-Ready APIs" - FastAPI Best Practices&lt;/li&gt;
&lt;li&gt;"Protocol Design Patterns" - Martin Fowler&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tools Used&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://python-poetry.org/" rel="noopener noreferrer"&gt;Poetry&lt;/a&gt; - Dependency management (initial)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/" rel="noopener noreferrer"&gt;Postman&lt;/a&gt; - API testing&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://devcenter.heroku.com/articles/heroku-cli" rel="noopener noreferrer"&gt;Heroku CLI&lt;/a&gt; - Deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;Building this Package Health Monitor Agent was a journey from simple REST API to enterprise-grade A2A protocol implementation. The key insights:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start Simple, Refactor Thoughtfully&lt;/strong&gt; - The initial flexible approach taught us what we needed before committing to strict types.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Protocol Compliance Matters&lt;/strong&gt; - Proper JSON-RPC 2.0 error codes make debugging integration issues 10x easier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Type Safety is Worth It&lt;/strong&gt; - Strict Literal types caught bugs before they reached production.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Production is Different&lt;/strong&gt; - Logging, error handling, and documentation separate hobby projects from professional tools.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Iterate Based on Real Use&lt;/strong&gt; - The Telex integration exposed assumptions we didn't know we had.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The agent now serves as a production-ready example of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modern Python API development with FastAPI&lt;/li&gt;
&lt;li&gt;A2A Protocol implementation best practices&lt;/li&gt;
&lt;li&gt;Type-safe protocol design with Pydantic&lt;/li&gt;
&lt;li&gt;Professional DevOps practices with Heroku&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Live Demo:&lt;/strong&gt; Try it at &lt;a href="https://packagehealthmonitoragent-2367cacc569a.herokuapp.com/docs" rel="noopener noreferrer"&gt;https://packagehealthmonitoragent-2367cacc569a.herokuapp.com/docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code:&lt;/strong&gt; &lt;a href="https://github.com/MyITjournal/package-health-agent" rel="noopener noreferrer"&gt;https://github.com/MyITjournal/package-health-agent&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Want to build your own A2A agent?&lt;/strong&gt; Clone this repo and use it as a starting template! All code is MIT licensed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Questions or suggestions?&lt;/strong&gt; Open an issue on GitHub or connect with me at &lt;a href="https://github.com/MyITjournal" rel="noopener noreferrer"&gt;@MyITjournal&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Author: Adeyoola Adebayo&lt;br&gt;
Project: Package Health Monitor Agent&lt;br&gt;&lt;br&gt;
Live API: &lt;a href="https://packagehealthmonitoragent-2367cacc569a.herokuapp.com/" rel="noopener noreferrer"&gt;https://packagehealthmonitoragent-2367cacc569a.herokuapp.com/&lt;/a&gt;&lt;/p&gt;

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