Stop Wasting Tokens: Building Deterministic Custom Agents with Google ADK [GDE]
In the world of AI orchestration, it's tempting to use a Large Language Model (LLM) for every step of a workflow. However, as applications scale, the "LLM-first" approach can introduce unnecessary ...
![Stop Wasting Tokens: Building Deterministic Custom Agents with Google ADK [GDE]](https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz44ccb8ysfrceeyxy1eo.jpg)
Source: DEV Community
In the world of AI orchestration, it's tempting to use a Large Language Model (LLM) for every step of a workflow. However, as applications scale, the "LLM-first" approach can introduce unnecessary latency, costs, and unpredictability. The Google Agent Development Kit (ADK) provides a powerful alternative: the BaseAgent. This post explores how to create a custom, programmatic agent—specifically an Email Agent—that handles deterministic tasks while still participating seamlessly in an AI-driven ecosystem. Why is the Email Agent a Custom Agent? The agent is 100% deterministic and relies on external APIs to format text and send emails. It uses the marked library to convert a Markdown string into HTML and the nodemailer library to send mail to an SMTP server. On the contrary, if I created a LlmAgent, the instruction, tool, and structured output would introduce LLM latency, input, and output tokens. The Benefits of Programmatic Execution Using a custom agent instead of an LLM-wrapped prompt