Notebooks
A
Arize AI
Google Adk Financial Advisor

Google Adk Financial Advisor

arize-tutorialsgoogletracingLLMPython

This notebook demonstrates how to use the Financial Advisor agent with full observability through Arize AX tracing. The agent provides comprehensive financial advice through a team of specialized AI sub-agents:

  1. Data Analyst Agent: Creates market analysis reports for specific stock tickers
  2. Trading Analyst Agent: Develops trading strategies based on risk tolerance and investment duration
  3. Execution Agent: Creates implementation plans for trading strategies
  4. Risk Evaluation Agent: Analyzes risks and provides mitigation strategies

🔍 Arize Tracing: All agent interactions, tool usage, and LLM calls are automatically traced and sent to Arize for observability, performance monitoring, and evaluation.

⚠️ Important Disclaimer: This is for educational purposes only and does not constitute financial advice.

✅ You will need a Google Cloud account with Vertex AI enabled and an Arize account to run this notebook.

Set Up Keys & Dependencies

Install Dependencies

[ ]

Google Cloud Setup

The Financial Advisor agent requires Google Cloud setup because it uses:

  • Vertex AI for Gemini 2.5 Pro model
  • Google Search tools for market data analysis
  1. Create a Google Cloud Project (if you don't have one)

  2. Enable required APIs:

    • Vertex AI API
    • Generative AI API
  3. Set up authentication:

    gcloud auth application-default login
    gcloud auth application-default set-quota-project YOUR-PROJECT-ID
    

Environment Variables

Create a .env file in this directory with the following variables:

# Required for Google ADK
GOOGLE_GENAI_USE_VERTEXAI=1
GOOGLE_CLOUD_PROJECT=your-project-id
GOOGLE_CLOUD_LOCATION=your-project-location  # e.g., us-central1

# Required: Arize Configuration
ARIZE_SPACE_ID=your-arize-space-id       # Found in Space Settings page
ARIZE_API_KEY=your-arize-api-key         # Found in Space Settings page
[ ]

Configure Tracing

[ ]

Build Financial Advisor System

Here we define all the prompts and agents inline to make this notebook completely standalone.

[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]

Test the Financial Advisor Agent

The following helper functions allow you to interact with the financial advisor agent from within a Jupyter notebook. They handle agent initialization, session management, and provide async wrappers for querying the agent and displaying responses.

[ ]

📊 Arize Tracing Dashboard

Once you start running the examples below, you can view the traces in Arize:

Arize Platform:

  • Visit your Arize space dashboard at https://app.arize.com
  • Navigate to your project: "google-adk-financial-advisor"
  • View traces in real-time as agents execute
  • Access advanced analytics and collaboration features

What You'll See in Arize:

  • 🔗 Trace Trees: Complete execution flows from user query to final response
  • ⏱️ Timing Data: Latency for each agent and tool call
  • 💰 Token Usage: Input/output tokens and cost tracking
  • 🔍 Tool Calls: Detailed logs of Google Search and agent interactions
  • 📊 Performance Metrics: Aggregate statistics across all runs
  • 🎯 Model Performance: Drift detection and performance monitoring
  • 📈 Analytics: Advanced filtering, search, and analytics capabilities

The traces provide invaluable insights for debugging, optimization, and understanding how your multi-agent system performs in production.

[ ]
[ ]
[ ]
[ ]
[ ]