AI/MLProject 3 of 5
Stock Analysis System
An experiment with Google's Agent Development Kit: five agents that answer plain-English questions about a stock. Built solo.
- Kind
- Experiment
- With
- Solo
01 / The experiment
This was my experiment with Google's new Agent Development Kit (ADK), built on my own. It runs as a FastAPI service and also plugs into the ADK web interface.
02 / Five agents
Each agent does one job: identify the ticker, get the price, gather the news, work out the price change, and analyse it all with Google Gemini.
03 / The data
Finnhub, Alpha Vantage, Twelve Data, Marketaux and Yahoo Finance. If one source fails or hits its rate limit, the system tries another.
04 / Ask it anything
You ask in plain English, for example: Why did Tesla stock drop today?
Code
# adk_agents/ticker_price.py
async def fetch_price(ticker: str) -> Dict[str, Any]:
"""Fetch the current price data for a stock ticker."""
if not ticker:
return {"error": "No ticker provided"}
response = await ticker_price_agent_impl.execute({"ticker": ticker})
if response.success and response.data:
return response.data
return {
"ticker": ticker,
"error": response.error_message or f"Failed to fetch price data for {ticker}",
}
fetch_price_tool = FunctionTool(fetch_price)
ticker_price_agent = Agent(
name="TickerPriceAgent",
tools=[fetch_price_tool],
description="Fetches the current price and related data for a stock",
)