# From Basic Spreadsheets to an AI Portfolio Engine: Tracking My Entire Net Worth with Antigravity, Sheets, and Gemini (Part 2)

> \[!WARNING\]
> 
> ### ⚠️ Disclaimer: Not Financial Advice
> 
> The information provided in this article is strictly for educational, informational, and personal workflow demonstration purposes. Nothing contained herein constitutes financial, investment, legal, or tax advice, nor should it be construed as an offer, solicitation, or recommendation to buy or sell any security, financial product, or instrument.
> 
> Large Language Models (LLMs) are generative artificial intelligence systems trained on statistical language patterns. They are not licensed financial advisors, certified fiduciaries, or registered broker-dealers. LLM outputs may contain factual inaccuracies, hallucinations, or outdated data.
> 
> Investing in equities, funds, and financial products involves risk of financial loss, including potential loss of principal. Past performance is no guarantee of future results. Always conduct independent due diligence and consult a qualified, licensed financial professional before making financial decisions.

* * *

> \[!NOTE\] This is **Part 2** of the AI & Personal Finance series. If you missed it, catch up on [Part 1: Prompting Through Financial Chaos: How I Use AI to Learn Terminology, Compare ETFs, and Build Dynamic Sheets](https://wiwiwig.hashnode.dev/prompting-through-financial-chaos-part-1), where we covered using AI as an investment tutor, uncovering hidden costs in S&P 500 ETFs, and setting up our first tracking spreadsheet.

* * *

## 🏦 The Journey: From Bank Accounts to Scattered Assets

Growing up, the bank was the only financial playbook our parents knew: work hard, put your savings in the bank, and earn modest interest. Without an economics degree, the stock market felt like a risky black box reserved for Wall Street insiders.

So like many people, I started my investment journey in the comfortable middle ground: bank-managed plans and Investment-Linked Policies (ILPs). The pitch was simple: pay a fee to professionals to manage your money and save for a rainy day. Over the years, I committed to plenty of them.

Then AI arrived. As I shared in [Part 1](https://wiwiwig.hashnode.dev/prompting-through-financial-chaos-part-1), having a patient, 24/7 tutor explained the jargon and showed me that broad index ETFs track the wider market at a fraction of the cost. I realized I could invest directly instead of paying heavy ongoing fees to middlemen.

So I took the plunge and started buying ETFs on my own.

**And that is how my money ended up everywhere.**

My net worth was suddenly scattered across legacy ILPs, national retirement funds, multiple brokerage accounts, and cash savings.

In Part 1, we built a basic Google Sheet to pull live prices. But once your holdings are spread across different institutions, currencies, and account types, a basic spreadsheet quickly hits its limits. It requires constant manual upkeep, and it cannot give AI the full picture without you copying and pasting numbers into a chat window every single time.

Commercial portfolio apps are not the answer either. Beyond charging monthly subscriptions and demanding your sensitive bank credentials, they share the exact same limitation: they are built narrowly for active stock trading, completely ignoring national retirement funds, insurance cash values, and real-life commitments.

To gain complete, private control over my scattered money, I needed an automated system that I actually owned.

* * *

## 💡 The AI Tool Landscape (and the Editability Wall)

When you look at the AI tools available today to help manage a portfolio, each brings clear strengths alongside hard limitations:

### NotebookLM: Grounded Context, but Walled Off

*   **What it does**: NotebookLM is built to read and analyze your uploaded files, spreadsheets, and policy PDFs. It gives you reliable, grounded answers with zero hallucinations because it is anchored strictly to your sources.
    
*   **The limitation**: It is completely walled off. It only knows what you upload and cannot fetch real-time market data, live stock prices, or current news from the outside world.
    

### Gemini: Live Web Data, but Zero Editability

*   **What it does**: Gemini can connect to your Google Drive to read your sheets and notes, while also searching the live web for real-time market news, analyst reports, and macroeconomic updates.
    
*   **The limitation**: Zero editability. Like NotebookLM, Gemini is a conversational chat interface. It can read your numbers and tell you what it thinks, but it cannot reach into your files to update a formula, log a new transaction, or run an automation script. You are still stuck manually editing spreadsheets and copying snippets back and forth.
    

### Enter IDE\_A & Antigravity: The Missing Execution Engine

This is where **IDE\_A** (Integrated Development Environment for Agents) and **Antigravity** (Google's AI IDE) enter the picture.

Antigravity is not a conversational chatbot; it is an active execution environment running directly on your computer. It solves the editability bottleneck:

*   It directly edits your local Markdown files and spreadsheets.
    
*   It writes and executes Python and PowerShell scripts to push live data to the cloud.
    
*   It lets you inspect every change line by line using git diffs before accepting it.
    

By pairing Antigravity on your local desktop with Gemini in the cloud, you get a complete system: an active engine that modifies and automates your data, alongside Gemini to analyze it and pull real-time market context.

* * *

## 📄 The Foundation: Plain Markdown Files

I did not need another subscription or another complicated dashboard.

The practical solution was simple: plain Markdown files (`.md`).

```mermaid
flowchart LR
    A["Financial Records\n(Retirement, ILPs, Equities, Cashflow)"] 
    -->|Antigravity Structuring| B["Local Markdown Files\n(01_allocation.md, 02_theses.md, 09_cashflow.md)"]
    B --> C["Private and Local\n(No Subscriptions, Zero Lock-in)"]
    B --> D["Clean AI Context\n(Read directly by Gemini)"]
```

### Why Plain Markdown Works:

1.  **Private and permanent**: Your financial records stay as text files on your computer. No third party holds your data, and no company can shut down your access.
    
2.  **Easy for AI to read**: LLMs do best with structured tables, bullet points, and clean headers. Antigravity and Gemini parse Markdown without extra formatting issues.
    
3.  **Flexible**: A Markdown file can document a stock, an employer pension rule, or an insurance policy surrender schedule with equal ease.
    
4.  **Complemented by a spreadsheet for math**: A companion sheet handles live price feeds via `=GOOGLEFINANCE`, keeping the Markdown documents clean and focused on strategy.
    

* * *

## 📝 The System Setup

Here is how the components connect, from the local computer to Google Drive and into Gemini:

```mermaid
flowchart TD
    subgraph LocalMachine ["1. Local Folder (Source of Truth)"]
        A1["Portfolio Policies & Theses\n(Markdown docs: Retirement, ILPs, Cashflow)"]
        A2["Personal_Portfolio_Master_Tracker.xlsx\n(Excel Sheet with formulas)"]
        A1 & A2 --> S1["PowerShell & Python Scripts\n(sync-docs.ps1 & upload-to-gdrive.ps1)"]
    end

    subgraph CloudBridge ["2. Google Drive Bridge (Finance > Portfolio)"]
        S1 --> GD1["00_PORTFOLIO_CONSOLIDATED.md"]
        S1 --> GD2["Live Google Sheet (with =GOOGLEFINANCE)"]
    end

    subgraph AIEngines ["3. Gemini with Drive (Analyst)"]
        GD1 & GD2 --> GEM["Gemini\nLive P&L reviews, rebalancing checks,\nand market lookups"]
    end
```

* * *

## 📂 The File Structure

Antigravity generated three main components to keep the data structured:

### `portfolio_tracker` (Google Sheet with `=GOOGLEFINANCE`)

*   **Live market pricing**: Uses `=GOOGLEFINANCE(Ticker, "price")` and `=GOOGLEFINANCE(Ticker, "changepct")`.
    
*   **Automatic math**: Calculates position values, cost basis, unrealized profit and loss, and portfolio weight percentages.
    
*   **Summary tab**: A clean tab designed for Gemini to read easily without digging through transaction archives.
    

### `investment_thesis_and_rules.md` (Strategy and Rules)

*   **Goals and horizon**: Timeframe, risk tolerance, and cash reserve targets.
    
*   **Reason for buying**: Short notes on why each holding was bought and planned exit criteria.
    
*   **Rebalancing limits**: Clear rules (for example, rebalance if tech allocation exceeds 35%).
    
*   **Drawdown plan**: Written rules on how to respond if the market drops 10%, 20%, or 30%, keeping panic selling in check.
    

### `watchlist_catalysts.md` (Notes to Monitor)

*   **Upcoming dates**: Earnings reports, rate announcements, or product launches.
    
*   **Questions to answer**: Specific points to check when new quarterly reports come out.
    

* * *

## 🔍 Spot the Error: Desktop Excel vs. Google Sheets

When setting this up, I hit an annoying cross-platform problem: **Excel and Google Sheets handle live market formulas differently.**

### The `#NAME?` Trap

*   In Google Sheets, you get live stock prices by writing `=GOOGLEFINANCE("VOO", "price")`.
    
*   In desktop Excel, `=GOOGLEFINANCE` does not exist. If you put that formula into a local `.xlsx` file and open it on your PC, Excel throws `#NAME?` errors across every row.
    
*   But if you leave out the formula, Google Sheets will not update prices automatically in the cloud for Gemini to read.
    

Here were the two ways to handle it:

### The Two-File Approach (Why It Fails)

*   One local file for Excel with static values, and one cloud file in Google Sheets with formulas.
    
*   **Why it fails**: You have to enter every trade twice. Before long, one file inevitably falls out of date.
    

### The Automated Fix: Formula Injection on Upload

*   Keep one master `.xlsx` file locally. It uses standard Excel formulas and opens cleanly on your desktop without errors.
    
*   When syncing, a small Python script (`inject_cloud_formulas.py`, called by `upload-to-gdrive.ps1`) updates the uploaded Google Sheet via the Google Sheets API.
    
*   The script injects the live `=GOOGLEFINANCE` formulas directly into the cloud copy for tickers and currency pairs like `EURUSD`.
    
*   **Result**: The local Excel file stays clean and error-free, the cloud Google Sheet streams live prices for Gemini, and you only maintain one file.
    

* * *

## 🛠️ Step-by-Step Workflow

### Step 1: Set Up Local Files

*   Antigravity organizes your financial records into Markdown files (`01_asset_allocation.md`, `02_investment_theses.md`, `03_trade_history_log.md`, plus retirement and policy notes).
    
*   Antigravity creates the master workbook (`Personal_Portfolio_Master_Tracker.xlsx`) with your baseline numbers.
    

### Step 2: Run the Sync Scripts

*   `sync-docs.ps1`: Combines the individual Markdown files into a single bundle (`00_PORTFOLIO_CONSOLIDATED.md`).
    
*   `upload-to-gdrive.ps1`: Uploads the consolidated file and the master spreadsheet to Google Drive under `Finance > Portfolio`, injecting cloud formulas automatically.
    

### Step 3: Chat with Gemini for Market and Portfolio Reviews

*   Connect your Google Drive folder in Gemini.
    
*   Gemini reads the current computed numbers from your spreadsheet and pairs them with live web search for earnings news and macro updates.
    

* * *

## 🌟 Wrapping Up

You do not need expensive software or paid subscriptions to run a clean, disciplined portfolio.

*   **Antigravity** sets up, updates, and maintains your local files and tracker.
    
*   **Google Drive** keeps your local files in sync with the cloud.
    
*   **Gemini** reads the live numbers, checks market updates, and helps you review your portfolio against your own rules.
    

What I Want Is What I Get: complete visibility into my money without extra subscriptions or privacy concerns.
