Refactoring a Sales Agent to Production with ADK & Vectors
Non-technical builder Jacob's Gemini agent for sales outreach gets refactored live using Google's ADK: swaps hardcoded case studies for dynamic vector search over 1,600 Google cases, adds parallelism, reliability, and UI for team scalability.
From Weekend Hack to Scalable Sales Tool
Jacob Battish, a non-technical Google executive, built "Titanium"—a sales agent that researches target companies, identifies executive pain points, and drafts personalized outreach emails tying them to Google's strengths. Coded in evenings and weekends using Gemini SDK, it parallelizes research via fan-out (processing multiple companies simultaneously), employs low-temperature prompts for factual grounding with Google Search, verifies intel to curb hallucinations, and includes exponential backoff for reliability. However, it relies on just 10-12 hardcoded case studies, limiting scalability for his team.
"I vibe coded this in the evenings and weekends. I was blown away at how doable it was. If I can do it, anyone can do it," Jacob shared, highlighting how iterative prompting with Gemini taught him production techniques like parallelism, reducing runtime from 15 minutes.
Luis, the host, praised the structure: parallel sub-agents per company, grounded generation, and verification. But scalability demanded dynamic access to Google's 1,600+ public case studies.
Migrating to ADK for Robust Agent Workflows
To productionize, they ported to Google's Agent Development Kit (ADK), a specialized SDK for agentic flows. ADK replaces nested if-loops and manual orchestration with declarative constructs like sequential agents (step-by-step execution) and root agents orchestrating sub-tasks.
A coding agent (using ADK dev skills compatible with tools like Anti-Gravity and Gemini CLI) generated a plan: replicate v1 workflow, then enhance. Side-by-side, original Python used raw Gemini calls in loops; ADK expresses the same as modular agents: research → verify → generate email, with built-in error handling and maintainability.
"When developing an agent, it is absolutely perfectly a legitimate tactic to use the native SDK... however, to set yourself up for success... shift over to a specialized SDK specifically designed for agents," Luis advised. Jacob's instinct: "Create a plan to do this and... go step by step."
They preserved fan-out parallelism, added ENV-based GCP credentials, and iterated prompts like "then reverify your work" to catch misses.
Dynamic Case Study Retrieval via Crawler and Vector Search
Core upgrade: a Playwright-based crawler scrapes Google's case study site (https://cloud.google.com/customers). Phase 1: Load pages, click "show more" repeatedly to extract ~1,600 URLs. Phase 2: Fetch HTML, use Gemini to extract/reformat as Markdown JSON, chunk and embed into Google Vector Search 2.0.
Luis chose managed Vector Search over local options like Chroma DB or Pinecone for seamless GCP integration. Querying uses hybrid search: semantic + text, combined and reranked for relevance.
Agent tools expose vector search: input query (e.g., company pains), retrieve top matches, feed to email generation. Demo: Target a CTO—agent searches exec details, company priorities, vectors relevant cases, drafts punchy email like "I know you're struggling with ABC. Google's really good at XYZ."
"The agent developed a tool that goes to the website and it's actually manually clicking show more... figuring out the links," Luis noted, showcasing autonomous tool use.
Production Polish: UI, Reliability, and Trade-offs
Post-refactor: Simple web UI for company/role input, copy-paste outputs. Benefits over v1: Scalable (full case studies), robust (ADK workflows, hybrid search), team-ready. Trade-offs: Initial setup time (60-min live refactor hit snags like laptop freezes), but ADK accelerates iteration.
Q&A unpacked: Chunking via Gemini-structured JSON; hybrid search boosts recall; ADK simplifies orchestration vs. raw code. Jacob: "Taking it from a tool that I'm using as really a pilot into now something that's much more production ready... incredible."
They committed to polish: Clean code, blog post, full repo. Chat feedback: Get to coding faster (Luis: "I probably talked too much").
Key Takeaways
- Start agents with native SDKs like Gemini for prototypes, migrate to ADK for production workflows—declarative agents beat nested loops.
- Build reliability early: Fan-out parallelism, exponential backoff, low temperature, verification prompts, reverify steps.
- For dynamic RAG, crawler + vector DB: Use Playwright for JS-heavy sites, Gemini for extraction, hybrid semantic/text search.
- Non-technical builders: Iterate via prompting—"how can we improve this?" yields exponential gains.
- Expose agent tools clearly: Vector functions for retrieval, grounded search for facts.
- Add UI last for usability; share repos/blogs for team adoption.
- Plan before code: Coding agents excel at step-by-step porting.
- Choose managed vectors (e.g., Google Vector Search) for scale over local for speed.
- Hybrid search > single mode: Rerank results for relevance.
"Something I've learned: I always now add in then reverify your work. Make it go back a second time cuz it catches things that it misses." – Jacob Battish
"Structured messaging is the best way to connect one system to another." – Luis
"This is awesome... much more confident talking about ADK... with my customers." – Jacob Battish