<?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: Rafael Campos</title>
    <description>The latest articles on Forem by Rafael Campos (@racampos).</description>
    <link>https://forem.com/racampos</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%2F3604698%2F819bf4a9-960a-41cb-a747-824460b20de6.png</url>
      <title>Forem: Rafael Campos</title>
      <link>https://forem.com/racampos</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/racampos"/>
    <language>en</language>
    <item>
      <title>Building NetGenius Instructor Copilot: A Multi-Agent AI System on Google Cloud Run</title>
      <dc:creator>Rafael Campos</dc:creator>
      <pubDate>Tue, 11 Nov 2025 00:40:40 +0000</pubDate>
      <link>https://forem.com/racampos/building-netgenius-instructor-copilot-a-multi-agent-ai-system-on-google-cloud-run-54if</link>
      <guid>https://forem.com/racampos/building-netgenius-instructor-copilot-a-multi-agent-ai-system-on-google-cloud-run-54if</guid>
      <description>&lt;p&gt;&lt;em&gt;This blog post was created for the Google Cloud Run Hackathon to share how I built NetGenius Instructor Copilot using Cloud Run Services, Cloud Run Jobs, and Google's Agent Development Kit (ADK).&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Lab Creation is Painfully Manual
&lt;/h2&gt;

&lt;p&gt;After 25 years of teaching Cisco CCNA courses, I've witnessed the same frustration repeated countless times: instructors spending an entire afternoon meticulously crafting a networking lab (designing the topology, writing step-by-step instructions, creating configurations for each and every device) only to discover during class that a command doesn't work, an IP address is wrong, or a verification step fails.&lt;/p&gt;

&lt;p&gt;The problem isn't lack of expertise. It's the sheer complexity of coordinating multiple moving parts: network design, CLI syntax, student instructions, and validation. A single typo can derail an entire lab session.&lt;/p&gt;

&lt;p&gt;I knew AI could help, but building a production-ready solution required more than just "throw it at an LLM." It needed intelligent orchestration, specialized agents, and real validation. That's where Google Cloud Run and ADK came in.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Multi-Agent AI Orchestration
&lt;/h2&gt;

&lt;p&gt;NetGenius Instructor Copilot automates the entire lab creation lifecycle using four specialized AI agents, orchestrated by Google's Agent Development Kit and running on Cloud Run infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture Overview
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftsy4dqzjuuu28scpgfwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftsy4dqzjuuu28scpgfwg.png" alt="Architecture" width="800" height="821"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The system consists of three main components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt; (Next.js on Vercel): Web interface for instructors&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Orchestrator&lt;/strong&gt; (FastAPI + ADK on Cloud Run Service): Multi-agent coordination&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Simulator&lt;/strong&gt; (Cloud Run Job): Headless validation engine&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why Cloud Run Was Perfect for This
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cloud Run Services: Always-On Orchestrator
&lt;/h3&gt;

&lt;p&gt;The orchestrator runs as a &lt;strong&gt;Cloud Run Service&lt;/strong&gt;, handling incoming API requests and coordinating the four ADK agents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Cloud Run Service?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatic scaling based on traffic&lt;/li&gt;
&lt;li&gt;Pay only for actual usage&lt;/li&gt;
&lt;li&gt;HTTPS out of the box&lt;/li&gt;
&lt;li&gt;Fast cold starts (&amp;lt; 2 seconds with Python + FastAPI)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cloud Run Jobs: On-Demand Validation
&lt;/h3&gt;

&lt;p&gt;The most innovative part is the &lt;strong&gt;Validator Agent&lt;/strong&gt;, which triggers a Cloud Run Job to run headless network simulations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Cloud Run Jobs?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On-demand execution (only runs when validation needed)&lt;/li&gt;
&lt;li&gt;No server management&lt;/li&gt;
&lt;li&gt;Scales to zero when idle (zero cost)&lt;/li&gt;
&lt;li&gt;Isolated execution environment for network simulation&lt;/li&gt;
&lt;li&gt;Can run long-running tasks (up to 60 minutes)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Complete Flow
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhbi5lqmbkx0a580bk2lw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhbi5lqmbkx0a580bk2lw.png" alt="The Complete Flow" width="800" height="561"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Planner Agent&lt;/strong&gt; (LlmAgent) conducts multi-turn Q&amp;amp;A with the instructor&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Designer Agent&lt;/strong&gt; (LlmAgent with tools) generates network topology YAML and device configurations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Author Agent&lt;/strong&gt; (LlmAgent) writes step-by-step lab guide with verification commands&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validator Agent&lt;/strong&gt; (Custom BaseAgent):

&lt;ul&gt;
&lt;li&gt;Packages everything into &lt;code&gt;spec.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Uploads to Google Cloud Storage&lt;/li&gt;
&lt;li&gt;Triggers Cloud Run Job (&lt;code&gt;headless-runner&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Network simulator downloads spec, runs commands in containerized routers&lt;/li&gt;
&lt;li&gt;Uploads validation results back to GCS&lt;/li&gt;
&lt;li&gt;Validator polls GCS and returns success/failure&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Key Metrics &amp;amp; Results
&lt;/h2&gt;

&lt;p&gt;After deploying to production:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Time savings&lt;/strong&gt;: 2-4 hours → 5-10 minutes (70-90% reduction)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cold start time&lt;/strong&gt;: ~2 seconds for orchestrator&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation time&lt;/strong&gt;: 2-5 minutes per lab (Cloud Run Job execution)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt;: ~$0.50 per lab generation (mostly Gemini API + Cloud Run Job execution)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deployment Architecture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Orchestrator Deployment
&lt;/h3&gt;

&lt;p&gt;The orchestrator was deployed as a Cloud Run Service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Build and deploy to Cloud Run Service&lt;/span&gt;
gcloud builds submit &lt;span class="nt"&gt;--tag&lt;/span&gt; gcr.io/netgenius-hackathon/netgenius-orchestrator
gcloud run deploy netgenius-orchestrator &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--image&lt;/span&gt; gcr.io/netgenius-hackathon/netgenius-orchestrator &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; us-central1 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--allow-unauthenticated&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--set-env-vars&lt;/span&gt; &lt;span class="nv"&gt;GOOGLE_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;GOOGLE_API_KEY&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Headless Runner Job
&lt;/h3&gt;

&lt;p&gt;The network simulator engine was deployed as a Cloud Run Job, that is executed on demand each time a lab generation takes place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Deploy as Cloud Run Job&lt;/span&gt;
gcloud run &lt;span class="nb"&gt;jobs &lt;/span&gt;create headless-runner &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--image&lt;/span&gt; us-central1-docker.pkg.dev/netgenius-hackathon/netgenius/headless-runner:latest &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; us-central1 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--set-env-vars&lt;/span&gt; &lt;span class="nv"&gt;SPEC_GCS_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gs://netgenius-artifacts-dev/pending/latest/spec.json &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--max-retries&lt;/span&gt; 0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--task-timeout&lt;/span&gt; 10m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I Learned About Cloud Run
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Services vs Jobs: Complementary, Not Competing
&lt;/h3&gt;

&lt;p&gt;Cloud Run Services and Jobs work beautifully together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Services&lt;/strong&gt;: For APIs, webhooks, always-on endpoints&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jobs&lt;/strong&gt;: For batch processing, scheduled tasks, event-driven workloads&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In my architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Service handles HTTP requests and orchestration&lt;/li&gt;
&lt;li&gt;Jobs handle compute-intensive simulation (only when needed)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Scale-to-Zero is a Game Changer
&lt;/h3&gt;

&lt;p&gt;During development and testing, costs were negligible because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Orchestrator scales to zero between requests&lt;/li&gt;
&lt;li&gt;Validation jobs only run when explicitly triggered&lt;/li&gt;
&lt;li&gt;No idle server costs&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Container Portability is Real
&lt;/h3&gt;

&lt;p&gt;The same Docker containers run identically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Locally (for development)&lt;/li&gt;
&lt;li&gt;On Cloud Run (production)&lt;/li&gt;
&lt;li&gt;No environment-specific code needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Future Enhancements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Expose RCA Agent in UI
&lt;/h3&gt;

&lt;p&gt;The RCA (Root Cause Analysis) agent is already implemented in the backend:&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="c1"&gt;# Already working in backend!
&lt;/span&gt;&lt;span class="n"&gt;rca_agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;create_rca_agent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Analyzes validation failures
&lt;/span&gt;&lt;span class="n"&gt;patch_router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;create_patch_router_agent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Routes fixes to appropriate agent
&lt;/span&gt;
&lt;span class="c1"&gt;# Classifies failures as:
# - DESIGN: Topology/config issue → retry Designer
# - INSTRUCTION: Lab guide error → retry Author
# - OBJECTIVES: Spec problem → escalate to human
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just needs frontend UI to show retry progress.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Topology Visualization
&lt;/h3&gt;

&lt;p&gt;Generate visual network diagrams from topology YAML using D3.js or Cytoscape.js.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Lab Editing
&lt;/h3&gt;

&lt;p&gt;Allow instructors to request modifications: "Add a troubleshooting component" or "Simplify the IP addressing."&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo&lt;/strong&gt;: &lt;a href="https://copilot.netgenius.ai" rel="noopener noreferrer"&gt;https://copilot.netgenius.ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/racampos/cloud-run-hackathon" rel="noopener noreferrer"&gt;https://github.com/racampos/cloud-run-hackathon&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hackathon Submission&lt;/strong&gt;: &lt;a href="https://devpost.com/software/netgenius-instructor-copilot-nic" rel="noopener noreferrer"&gt;https://devpost.com/software/netgenius-instructor-copilot-nic&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The orchestrator is fully open-source. The network simulator is proprietary (our "secret sauce"), but the API contract is documented.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building NetGenius Instructor Copilot taught me that modern cloud infrastructure (Cloud Run) combined with intelligent orchestration frameworks (Google ADK) can solve real-world problems that seemed impossible just a year ago.&lt;/p&gt;

&lt;p&gt;The combination of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Run Services&lt;/strong&gt; for the always-on orchestrator&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Run Jobs&lt;/strong&gt; for on-demand validation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google ADK&lt;/strong&gt; for multi-agent coordination&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini 2.5 Flash&lt;/strong&gt; for AI reasoning&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;created a production-ready system that, once in production, will save instructors (including mysel) hours of manual work.&lt;/p&gt;

&lt;p&gt;If you're building multi-agent AI systems, I highly recommend exploring Google ADK and Cloud Run. The developer experience is excellent, and the scale-to-zero cost model is perfect for bootstrapped projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Questions? Feedback?&lt;/strong&gt; Drop a comment below or reach out on X/Twitter (&lt;a class="mentioned-user" href="https://dev.to/racampos"&gt;@racampos&lt;/a&gt;)&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built for the Google Cloud Run Hackathon. #CloudRunHackathon #GoogleCloud #AI #EdTech&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>google</category>
      <category>serverless</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
