<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by mafabi piuskevin on Medium]]></title>
        <description><![CDATA[Stories by mafabi piuskevin on Medium]]></description>
        <link>https://medium.com/@mpavatarpius?source=rss-42c8922a5e32------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9VUWkZU6dBmE9B_1</url>
            <title>Stories by mafabi piuskevin on Medium</title>
            <link>https://medium.com/@mpavatarpius?source=rss-42c8922a5e32------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 04:36:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mpavatarpius/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Local Chrome-Powered AI Gateway with Google Antigravity 2.0]]></title>
            <link>https://medium.com/@mpavatarpius/building-a-local-chrome-powered-ai-gateway-with-google-antigravity-2-0-ba9bd026841f?source=rss-42c8922a5e32------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba9bd026841f</guid>
            <dc:creator><![CDATA[mafabi piuskevin]]></dc:creator>
            <pubDate>Thu, 09 Jul 2026 10:10:12 GMT</pubDate>
            <atom:updated>2026-07-09T11:29:24.332Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How I leveraged Antigravity’s multi-agent orchestration, safety gates, and background execution to package headless Chrome’s Gemini Nano and built-in AI APIs into an OpenAI-compatible server.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PmXk7E0v4ZaZlFS62PnIFQ.png" /></figure><p>Local AI execution is reshaping modern AI applications by delivering near-zero latency, improved privacy, and eliminating the recurring costs associated with cloud-based inference.</p><p>But running heavyweight models on-device has historically required complex native setups, specialized runtimes, or massive downloads.</p><p>What if the runtime you already have installed — <strong>Google Chrome</strong> — could act as your system-wide local AI provider?</p><p>Chrome v128+ comes shipped with built-in, hardware-accelerated client-side APIs including:</p><ul><li><strong>Gemini Nano</strong> (via the Prompt API)</li><li><strong>Translation API</strong></li><li><strong>Summarizer API</strong></li><li><strong>Writer/Rewriter APIs</strong></li><li><strong>Language Detector API</strong></li></ul><p>To turn this client-side browser technology into a developer-ready backend service, I built <strong>chrome-offline-ai-poc</strong> — an Express server that orchestrates headless Chrome via Puppeteer to expose Chrome’s built-in AI capabilities through standard JSON REST endpoints and an <strong>OpenAI-compatible streaming API</strong>.</p><p>Repository:</p><p><a href="https://github.com/PiusKevin3/chrome-offline-ai-poc">https://github.com/PiusKevin3/chrome-offline-ai-poc</a></p><p>Building a project that crosses multiple boundaries — handling native process spawning, headless browser automation, Express server setup, and API endpoint compatibility — would usually require days of manual debugging.</p><p>Instead, I built this in hours using the new <strong>Google Antigravity 2.0 IDE</strong>.</p><p>Here is a look behind the scenes at how Antigravity’s advanced multi-agent orchestration and safety features helped me build it.</p><h3>The Architecture: Connecting Server to Browser</h3><p>The core idea of the project is simple but structurally tricky:</p><ol><li>An <strong>Express Server</strong> starts on the local machine.</li><li>It boots a <strong>headless instance of Google Chrome</strong> using Puppeteer, passing the required flags to enable experimental on-device AI.</li><li>The server maintains a persistent background browser page.</li><li>When clients request completion through /v1/chat/completions, the Express server executes code inside the Puppeteer browser context, calls Chrome&#39;s AI APIs, streams the response, and pipes the output back to the caller using Server-Sent Events (SSE).</li></ol><p>Architecture:</p><pre>+--------------------------------+<br>|        Express Server          |<br>|        localhost:3010          |<br>+--------------------------------+<br>              |<br>              |<br>      OpenAI-Compatible API<br>              |<br>              |<br>+--------------------------------+<br>|        Headless Chrome         |<br>|        Puppeteer Context       |<br>+--------------------------------+<br>              |<br>              |<br>       Chrome AI APIs<br>              |<br>              |<br>      Gemini Nano / Local AI</pre><p>The result is a local AI gateway where applications can interact with Chrome’s built-in AI capabilities using familiar API patterns.</p><h3>How Google Antigravity 2.0 Guided the Build</h3><p>To tackle this full-stack challenge, I utilized several of Antigravity’s core features designed specifically for complex software engineering.</p><h3>1. Parallel Tasking with Dynamic Subagents</h3><p>Rather than feeding a single agent a massive prompt and risking context window pollution or code hallucination, I used Antigravity’s <strong>Dynamic Subagents</strong>.</p><p>I spun up isolated, short-lived child agents to handle specific standalone subtasks concurrently:</p><h3>Subagent A — Puppeteer Specialist</h3><p>Focused exclusively on browser orchestration:</p><ul><li>Locating Chrome binaries across different Windows installations</li><li>Managing headless browser lifecycle</li><li>Handling browser pooling and persistent sessions</li></ul><h3>Subagent B — API Parity Engineer</h3><p>Focused on the Express layer:</p><ul><li>Creating API routes</li><li>Mapping incoming JSON payloads</li><li>Maintaining compatibility with OpenAI request formats</li></ul><h3>Subagent C — Streaming Architect</h3><p>Focused entirely on:</p><ul><li>Translating Chrome’s client-side readable streams</li><li>Returning standard OpenAI-compatible Server-Sent Events (text/event-stream)</li></ul><p>This tree-based orchestration allowed me to keep the main agent thread clean, responsive, and focused on the overall system architecture.</p><h3>2. Guarding the System with Interactive Approval Gates</h3><p>A major requirement of this project was executing system-level actions:</p><ul><li>Installing Node dependencies</li><li>Verifying system paths</li><li>Spawning Chrome processes using child_process.spawn</li></ul><p>Example Chrome configuration:</p><pre>const args = [<br>    &quot;--headless=new&quot;,<br>    `--remote-debugging-port=${port}`,<br>    `--user-data-dir=${CHROME_PROFILE}`,<br>    &quot;--enable-features=OptimizationGuideOnDeviceModel:compatible_on_device_performance_classes/*,PromptAPIForGeminiNano,PromptAPI&quot;,<br>    &quot;--enable-experimental-web-platform-features&quot;<br>];</pre><p>In enterprise and local development scenarios, allowing an AI agent to execute arbitrary shell commands introduces security risks.</p><p>Antigravity addresses this through <strong>Declarative Safety Policies</strong> and <strong>Interactive Human-in-the-Loop Approval Gates</strong>.</p><p>Before executing commands on my machine, Antigravity paused execution and requested approval through the IDE.</p><p>This “deny-by-default” workflow allowed me to review, adjust, and approve system changes before execution.</p><h3>3. Ephemerality and Portability: Serverless Ad-hoc Skills</h3><p>To automate initial environment checks, I created an ephemeral file-based skill using Antigravity’s <strong>Serverless Ad-hoc Skill Engine</strong>.</p><p>The skill helped verify:</p><ul><li>Google Chrome availability</li><li>Node.js requirements</li><li>Required Chrome flags</li><li>Development environment readiness</li></ul><p>By defining a simple SKILL.md file containing instructions and configuration parameters, the agent workspace could temporarily load the required execution steps before implementation.</p><h3>4. Continuous Verification &amp; Headless Testing</h3><p>Once the server and browser bridge were implemented, the next challenge was verification.</p><p>The system needed to validate:</p><ul><li>Streaming responses</li><li>Connection handling</li><li>Token counting</li><li>API compatibility</li></ul><p>Instead of switching between terminals and API testing tools, I used Antigravity’s <strong>Non-Blocking Asynchronous Task Queues</strong> and <strong>Continuous Verification</strong> features.</p><p>The Express server could run in the background while automated checks tested the API.</p><p>This allowed issues to be detected and resolved quickly during development.</p><h3>The Outcome: Private, Fast, and Free Local AI</h3><p>The resulting repository, <strong>chrome-offline-ai-poc</strong>, provides:</p><ul><li>A local API running on <a href="http://localhost:3010/">http://localhost:3010</a></li><li>An interactive web playground dashboard</li><li>Real-time token usage logs</li><li>Request history metrics</li><li>OpenAI client compatibility</li></ul><p>Existing AI workflows can connect to the local machine by changing only the API base URL.</p><p>Example:</p><pre>import OpenAI from &quot;openai&quot;;</pre><pre>const openai = new OpenAI({<br>    baseURL: &quot;http://localhost:3010/v1&quot;,<br>    apiKey: &quot;local-no-key&quot;<br>});</pre><pre>const stream = await openai.chat.completions.create({<br>    model: &quot;gemini-nano&quot;,<br>    messages: [<br>        {<br>            role: &quot;user&quot;,<br>            content: &quot;Tell me a story about a coding AI.&quot;<br>        }<br>    ],<br>    stream: true<br>});</pre><pre>for await (const chunk of stream) {<br>    process.stdout.write(<br>        chunk.choices[0]?.delta?.content || &quot;&quot;<br>    );<br>}</pre><h3>Reflections on the “Agentic Architect” Mindset</h3><p>Building this POC highlighted a paradigm shift in how we build software with AI.</p><p>Using Google Antigravity 2.0 felt less like using an autocomplete tool and more like managing a remote engineering team.</p><p>By leveraging:</p><ul><li>Dynamic subagents</li><li>Safety policies</li><li>Background execution</li><li>Ephemeral skills</li></ul><p>I shifted my focus from debugging individual issues to designing the overall system architecture.</p><p>I highly recommend using Antigravity 2.0 to tackle complex, multi-repository, and on-device integrations.</p><p>Check out the full repository and setup instructions here:</p><p><strong>chrome-offline-ai-poc on GitHub</strong></p><p><a href="https://github.com/PiusKevin3/chrome-offline-ai-poc">https://github.com/PiusKevin3/chrome-offline-ai-poc</a></p><p>#GoogleAntigravity #AgenticArchitect #GenerativeAI #WebDev #Chrome</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba9bd026841f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[InfraScope AI: Rethinking Urban Planning with Multi-Agent Intelligence on Google Cloud]]></title>
            <link>https://medium.com/@mpavatarpius/infrascope-ai-rethinking-urban-planning-with-multi-agent-intelligence-on-google-cloud-f5394cee1bdd?source=rss-42c8922a5e32------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5394cee1bdd</guid>
            <category><![CDATA[adk]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[gemini-api]]></category>
            <category><![CDATA[urban-planning]]></category>
            <dc:creator><![CDATA[mafabi piuskevin]]></dc:creator>
            <pubDate>Sun, 22 Jun 2025 20:09:11 GMT</pubDate>
            <atom:updated>2025-06-23T05:50:04.080Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Building data-driven cities through AI collaboration, geospatial analysis, and cloud-native design.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GrPSChtvyNKfE-cg" /></figure><h3>🌍 Why InfraScope AI?</h3><p>Rapid urban growth demands smarter infrastructure planning. Yet, most urban planning tools are static, centralized, or locked behind legacy systems. Planners and decision-makers often lack tools that are real-time, scalable, and truly informed by local needs.</p><p>I built <strong>InfraScope AI</strong> to change that.</p><p>InfraScope AI is a <strong>multi-agent, autonomous assistant</strong> that allows urban planners to select any geographic area and instantly get:</p><ul><li>Infrastructure recommendations (schools, parks, clinics, etc.)</li><li>Zoning and regulatory validation</li><li>Visual suggestions for storytelling</li><li>Functional site layout proposals</li></ul><p>All powered by <strong>Google Cloud Run</strong>, <strong>Gemini</strong>, and the <strong>Agent Development Kit (ADK)</strong>.</p><h3>🛠️ Tech Architecture at a Glance</h3><p>The system is orchestrated by a <strong>SequentialAgent</strong> pipeline. Here’s a simplified diagram of our architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EUB1nyIxXT0IjeKH5faazw.png" /></figure><p>And here’s a basic summary of what runs under the hood:</p><pre># Define LLM agents for specific tasks<br>urban_research_agent = LlmAgent(<br>    name=&quot;UrbanResearcher&quot;,<br>    model=&quot;gemini-2.0-flash&quot;,<br>    instruction=URBAN_OPPORTUNITY_RESEARCH_AGENT_INSTRUCTION,<br>    tools=[google_search],<br>    output_key=&quot;urban_research_summary&quot;<br>)<br><br># Sequentially coordinate agents<br>campaign_orchestrator = SequentialAgent(<br>    name=&quot;InfraCampaignAssistant&quot;,<br>    sub_agents=[<br>        urban_research_agent,<br>        policy_validator_agent,<br>        visual_suggester_agent,<br>        blueprint_designer_agent,<br>        formatter_agent<br>    ]<br>)</pre><p>Each agent is designed to act autonomously, yet collaborate with others through a shared state pipeline.</p><h3>🧠 Core Agent Roles</h3><p>InfraScope AI’s planning intelligence emerges from its agents:</p><ul><li>🧭 <strong>UrbanResearcher</strong> — Analyzes land use, transport, demographics, environment</li><li>🏛️ <strong>PolicyValidator</strong> — Ensures zoning compliance and environmental clearance</li><li>📐 <strong>BlueprintDesigner</strong> — Suggests conceptual layouts (text-based for now)</li><li>🎨 <strong>VisualSuggester</strong> — Recommends visual ideas (heatmaps, overlays, buffers)</li><li>🧾 <strong>CampaignBriefFormatter</strong> — Formats everything into a presentation-ready brief</li></ul><p>These agents interact with tools like:</p><ul><li>🌐 <strong>Google Maps API</strong> — For location analysis</li><li>🧪 <strong>MongoDB (GeoJSON)</strong> — For spatial data querying</li><li>☁️ <strong>Google Cloud Run</strong> — For running agents independently and scalably</li></ul><h3>📍 Real-World Use Case</h3><p>Imagine a planner selects a fast-growing area in <strong><em>Wakiso, Uganda</em></strong>.</p><p>InfraScope AI returns:</p><ul><li>Youth-heavy population + no schools nearby → <em>Recommends school</em></li><li>Terrain slope warning in east → <em>Suggests avoiding construction</em></li><li>Zoning tag supports education use → <em>Marked legal for development</em></li><li>Blueprint layout divides site into learning blocks, green zones, and walkways</li><li>Visual suggestion includes accessibility radius heatmap for nearest roads</li></ul><h3>✨ Why It Matters</h3><p>Urban planning should be fast, transparent, and inclusive.</p><p>InfraScope AI:</p><p>✅ Works in the browser with simple map input<br> ✅ Requires no advanced GIS or ML knowledge<br> ✅ Helps governments, NGOs, and planners make <strong>data-backed decisions</strong><br> ✅ Is easily extendable with cost, impact, or SDG modules in future releases</p><h3>🧱 What’s Next?</h3><p>🔄 Add the <strong>Cost Estimator</strong> and <strong>Impact Modeler</strong> agents<br> 🗺️ Generate actual <strong>graphical blueprints</strong> from layout suggestions<br> 📱 Build a <strong>mobile-friendly</strong> UX for field officers<br> 📊 Connect to city dashboards for real-time metrics</p><h3>🙌 Final Thoughts</h3><p>InfraScope AI brings automation and clarity to the complex world of urban development. It shows how AI agents, when combined smartly, can produce real-world value beyond chatbot hype.</p><p>If you’re a city planner, researcher, or innovator passionate about equitable cities — we’d love to connect.</p><p>🔗 Live Demo: <a href="https://infrascope-ui-647675745295.me-west1.run.app/">https://infrascope-ui-647675745295.me-west1.run.app</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5394cee1bdd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>