Human Plus AI Analyst: Defying Gravity

Zack Martin

Can an AI Agent handle a messy schema and a live Snowflake connection, or will it crash and burn? We test Google Antigravity against the ultimate stress test: An urgent executive request.

In my previous article, Human Analyst vs. AI Analyst, I examined how three different AI tools would stack up against me (using Tableau) in analyzing a basic CSV dataset to find some insights.

Today, we go beyond the nice clean dataset (minus the date errors!) in a CSV. We’re going to connect directly to a live Snowflake database and run queries, all within Google’s New AI IDE: Antigravity

The goal? To see if an AI Agent can act as a true extension of the analyst; navigating schemas, writing production-ready SQL, and visualizing the data within the IDE, all from a natural language prompt.

Want to follow along in greater detail? I’ve documented it all in this GitHub repo so you can see examples of code, prompts and more.

The Scenario: The Monday Morning “Fire Drill”

We are roleplaying a Senior Analyst at SunSpectra (our fictional retail company). It’s Monday morning, and the VP of Sales needs an “Executive Update” immediately. They aren’t looking for a deep dive; they want a pulse check on performance to help them tell a story in their afternoon meeting with the C-suite.

The Request

The VP has asked for three specific insights:

  1. Quarterly Performance: What are the total sales, broken down by category and quarter? (Visual: Small Multiples Chart + Table)
  2. Product Extremes: What are the top 5 and worst 5 performing products for each quarter? (Visual: Horizontal Bar Chart + Table)
  3. Customer Demographics: Which 3 customer age segments purchased the most in the last two quarters? (Visual: Bar Chart with Avg Spend Line + Table)

Note: For this analysis, Quarters are defined as calendar Q1 (Jan-Mar), Q2 (Apr-Jun), etc. and should be grouped by in charts & tables and labeled as Q1, Q2, Q3.

The Tool Stack

  • Database: Snowflake (Hosting the SunSpectra Retail Dataset)
  • The Agent/IDE: Google Antigravity, Utilizing Google Gemini 3 Pro (High) Model
  • The Talent: Me

The Approach

The biggest difference from how we used the Cursor IDE previously for data analysis, is that we’re connecting to a live database this time.

Antigravity is very similar to Cursor, the IDE is the same, it’s just a difference in the agents. Therefore, everything we’re doing here should also work in Cursor.‍

Phase 1: Connection

Before asking the Agent to do anything, I need to connect it to the database and give it a context of the schema.

  • Goal: Establish a “Context Layer” so the AI knows how tables join (e.g., PRODUCT_ID to SKU) without us explicitly writing the joins every time.

Key Discoveries documented, as in data_documentation.md :

  • Schemas identified: CATALOG (Products), FINANCE (Transactions), CUSTOMER (Demographics), and SHIPBOB (Fulfillment).
  • The Glue: The Agent correctly identified that FINANCE.TRANSACTIONS did not contain customer or product IDs directly. It found the necessary bridge tables:
    • Sales to Products: SHIPBOB.ORDER_PRODUCTS
    • Sales to Customers: PUBLIC.ORDERS (Initially assumed) vs SHIPBOB.ORDERS (Actual).

The Handshake (Connecting Antigravity to Snowflake)

Admittedly, the first time I set this up, it required asking some questions to my coworker and Gemini. I was able to first make a connection to Snowflake via their extension for VS Code, but the agent couldn’t interact with it.

  1. Install Dependencies: Open the Antigravity terminal and install the Snowflake connector and Dotenv to handle credentials securely.

pip install snowflake-connector-python[pandas] python-dotenv

  1. Create the “Bridge” Script: We created a Python script (snowflake_client.py) to handle the connection. We opted for standard password authentication stored in environment variables.
   def get_connection():
       return snowflake.connector.connect(
           # ... params ...
           password=os.getenv('SNOWFLAKE_PASSWORD')
       )
  1. Set Environment Variables: We created a .env file to store our credentials. Crucially, since we’re using Github for this repository, we added .env to our .gitignore file to prevent leaking secrets.
   SNOWFLAKE_ACCOUNT=YOURACCOUNT-IDENTIFIER
   SNOWFLAKE_USER=YOUR_USERNAME
   SNOWFLAKE_PASSWORD=YOUR_PASSWORD
   SNOWFLAKE_ROLE=YOUR_ROLE
   SNOWFLAKE_WAREHOUSE=YOUR_WH
   SNOWFLAKE_DATABASE=YOUR_DB
   SNOWFLAKE_SCHEMA=YOUR_SCHEMA

Phase 2: Prompting & Generating

Instead of blind prompting, I used a separate instance of Gemini to generate an Instruction Document for the Antigravity Agent. Think of this as translating “Business Ask” into “Robot Instructions”.

In my experience, this creates a better output with fewer follow-up steps since you’re giving the tools a framework and criteria to work from.

Phase 3: Execution (The Analysis)

Utilizing your discoveries within data_documentation.md, answer our three key questions from our executive and generate the charts needed for each question in a Streamlit dashboard that I can easily copy to a slide deck. For easy reference, here are the questions and charts requested:

  1. Quarterly Performance: What are the total sales, broken down by category and quarter? (Visual: Small Multiples Chart + Table)
  2. Product Extremes: What are the top 5 and worst 5 performing products for each quarter? (Visual: Horizontal Bar Chart + Table)
  3. Customer Demographics: Which 3 customer age segments purchased the most in the last two quarters? (Visual: Grouped Bar Chart with Avg Spend Line + Table)

Phase 4: The Analysis of the Analysis

It’s done! We get the message that our Streamlit app is live and we can go view it on localhost:8501. Good news.

We also requested full documentation of the dashboard and data, so we have data_documentation.md and dashboard.md files for those of you who want all of the technical details.

Key Takeaways

  1. Schema Context is King: The Agent performed well overall, but the way we prompted it played a big role in that. It’s worth it, to get quality results, to do this prompting up front. Having an agent just start to go write SQL without any discovery or context, has been well-documented in analytics blogs that it doesn’t go well.
  2. Not Perfect, but Damn Good: We needed to dig deeper when things failed, but that’s to be expected.
  3. The “Black Box” Problem: This is generally just a problem with AI or complex systems where you’re not seeing all of the individual inner workings happening, so it’s harder to trust. This feels partly like a human problem, rather than an AI problem.
  4. Future Outlook: This tool isn’t going to replace an analyst. With the right context & documentation prepared, it could take over SQL generation for an analyst. I think that’s a good thing.