Member-only story
How to Connect Your AI Agent to the Real World (Google Sheets & Yahoo Finance)
Khurram Khan5 min read·Dec 16, 2025--
In Part 1, we designed the “glass box” architecture. In Part 2, we built its long-term “Memory” with Vertex AI Vector Search, allowing it to remember our personal goals.
But an agent with only a memory is like a historian who can’t read today’s newspaper. It’s disconnected from the real world.
To be truly useful, our agent needs “Hands.” It needs the ability to interact with live, external data. This article is a hands-on guide to building our agent’s toolbelt. We’ll write three custom tools that connect our agent to:
- Your Private Data: A Google Sheet containing your portfolio.
- Live Market Data: The
yfinancelibrary for real-time stock prices. - Live Web Data: Vertex AI Search for an up-to-the-minute “Google” search.
By the end, you’ll have a set of powerful, independent tools, ready to be plugged into the “Brain” we’ll build in our final article.
The Magic of the @tool Decorator
Before we build, we need to understand our most important piece of “magic”: the @tool decorator.
An LLM’s “brain” (like Gemini) cannot read or run Python code. It only understands text and JSON. So how do we give it…