My teammate Doddi and I took 2nd place at gShark Tank with BidBot, an autonomous negotiation platform that uses A2A and AP2 protocols to move LLMs from simple chat into structured settlement.
Building it required real-time infrastructure, leading me to publish pg-sse—a new open-source library that eliminates database polling—and pivot our frontend stack to use the latest native AI UI tools.
Along the way, we tested the bleeding edge of enterprise deployment and caught a critical platform routing bug when connecting our ADK-built agent on Agent Runtime to the Gemini Enterprise app.
Recently, my teammate Doddi and I secured 2nd place at gShark Tank, an internal innovation contest for the Google Cloud CE team.
Our project, BidBot, was born from an ambitious question: What happens when you pit AI agents against each other to dynamically automate complex procurement workflows?
If you want two Large Language Models to negotiate effectively, you cannot just pipe their raw text outputs into each other. You need structured, deterministic communication. To solve this, we integrated the Agent-to-Agent Protocol (A2A) and the Agent Payments Protocol (AP2) into BidBot's architecture.
A2A provided the framework for the agents to discover each other, establish a secure connection, and exchange structured negotiation intents. AP2 handled the secure checkout handoff—instead of just outputting a text agreement, the agents used AP2 to generate cryptographic mandates.
Agents don't need small talk to close a deal; they need structured intents and secure handshakes.
While the protocols gave us a solid conceptual foundation, engineering the real-time infrastructure and front-end to support it was where the real fun began. Here are three technical highlights and side-quests I experienced during the build.
1. Integrating Agent Runtime with Gemini Enterprise App
Some BidBot's agents were built using the Agent Development Kit (ADK) and deployed on Google Cloud Agent Runtime (fka. Agent Engine). However, the moment we tried connecting our Agent Runtime deployment to the Gemini Enterprise app, we immediately hit a wall. The agent started throwing fatal ValueError crashes right out of the gate.
I dug into the stack trace and uncovered a regression in google-adk v2.2.0. When querying the agent via the Gemini Enterprise app, the platform passes a fully qualified session resource path (complete with slashes). However, a recently added strict regex validation in the session service expected only a short ID, causing the runtime to panic and crash.
Instead of writing a brittle, temporary workaround for our app, I isolated the commit that introduced the regression and reported the exact routing mismatch on the official GitHub repository.
Filing Issue #6036 was a great reminder of how rapidly the Agent Runtime ecosystem is hardening, and why contributing back to the open-source tools we rely on is essential.
2. Eliminating Database Polling with SSE
A core UX requirement for BidBot was a live "negotiation room" where users could watch the AI agents pass offers back and forth in real-time.
Standard periodic database polling would have introduced unacceptable latency and unnecessary load. To solve this elegantly, I built and published a new open-source NPM library: pg-sse.
This library taps directly into PostgreSQL's native LISTEN/NOTIFY pub/sub features to stream Server-Sent Events (SSE) directly to our Next.js client. To ensure this was production-ready, I engineered a few critical features into the library:
- Database Pool Protection:
pg-ssemultiplexes all incoming client streams into exactly one PostgreSQL connection per Node.js process, preventing connection exhaustion. - Browser Tab Multiplexing: It uses
BroadcastChannelwith automated leader election to restrict active event streams to exactly one socket connection per browser.
When using Postgres NOTIFY for real-time events, always use the Thin Event Pattern. Never serialize sensitive data directly into the trigger payload. pg-sse is designed to send only identifiers and actions (e.g., { "table": "bids", "action": "INSERT", "id": 123 }). The client receives the notification and fetches the rich data via authenticated Server Actions, ensuring strict access control enforcement.
3. Navigating the Evolution of AI Frontends
Building BidBot was also a great moment to reflect on how fast the AI UI ecosystem is moving.
Last year, I built the @kentandrian/google-adk client library to bridge the gap between Google ADK agents and web clients. At the time, connecting everything required wrapping responses into the Vercel AI SDK just to get it to play nicely with React components.
When revisiting the stack for this project, I realized the team behind assistant-ui had officially released @assistant-ui/react-google-adk. This new package allows for direct, seamless integration with Google ADK agents (handling streaming, tool calls, and session management), without needing the Vercel AI SDK middleman layer at all.
The open-source AI frontend ecosystem is moving so fast that parts of my own custom library from last year were ready to be deprecated in favor of native tools.
But I didn't scrap my library entirely; I adapted to the ecosystem shift. Since we no longer needed the AI SDK connectors, I gutted that layer and repurposed @kentandrian/google-adk. It now serves two highly valuable functions for BidBot: providing robust TypeScript typing for the underlying ADK agent APIs, and creating secure ADK proxy server route handlers in Next.js.
Don't be afraid to gut your own custom libraries when better native tools emerge. Decoupling the UI layer (now handled by assistant-ui) from your secure server routing makes your frontend architecture much easier to maintain.
Looking Ahead
Taking second place at gShark Tank among so many brilliant engineers across SEA was a massive honor.
BidBot proved that agent-to-agent architectures are not just theoretical novelties. When backed by robust protocols like A2A and AP2, and supported by real-time infrastructure, they are highly viable, scalable solutions for complex business logic.
A huge shoutout to my partner-in-crime Doddi for co-engineering this system with me, and to the gShark Tank organizers for hosting an incredible event.
On to the next build. 🚀