Inspiration

Gulf Sovereign Wealth Funds — ADIA, PIF, QIA, Mubadala, and ADQ — collectively manage over $4 trillion in assets. Every significant position change they make must be disclosed via SEC 13D/13G filings. Yet institutional investors and researchers have no automated way to monitor, parse, and interpret these filings in real time.

As a quantitative researcher with five years of equity research experience on the Pakistan Stock Exchange, I wanted to build a tool I would actually use: an agent that watches SEC EDGAR continuously, understands what it finds, and tells me what matters.

What It Does

Gulf SWF Filing Intelligence Agent is a multi-step agentic system that:

  1. Monitors SEC EDGAR for new 13D/13G filings from the five major Gulf SWFs
  2. Fetches and parses each filing to extract issuer, ownership percentage, transaction type, and filing date
  3. Stores structured filing records in MongoDB Atlas via MCP
  4. Reasons over the data using Gemini to identify patterns, concentration changes, and emerging investment themes
  5. Delivers a natural language intelligence brief and structured dashboard to the user — without any manual intervention

The agent operates under human oversight: users can query it, request summaries, or trigger deep-dive analysis on any fund or sector.

How I Built It

The system is built on Google Cloud Agent Builder with Gemini as the reasoning engine. The agent is orchestrated as a multi-step pipeline:

  • SEC EDGAR API → filing discovery and document retrieval
  • Gemini → document parsing, entity extraction, and intelligence synthesis
  • MongoDB Atlas MCP server → persistent storage of filing records and historical position data
  • Google Cloud Run → hosting the agent backend
  • Next.js → web dashboard frontend

The MongoDB MCP server gives the agent direct tool-call access to the database, enabling it to store, query, and aggregate filing data without manual intervention. Gemini's reasoning layer transforms raw XBRL/text filings into structured investment signals.

Challenges

SEC EDGAR rate limits required careful request throttling and caching strategies to avoid being blocked during bulk historical ingestion.

13D/13G filing formats vary significantly across filers and time periods — building a robust parser that handles both XBRL-structured and legacy text filings required multiple extraction strategies with Gemini as the fallback parser for unstructured content.

Learning Google Cloud Agent Builder from scratch within the contest window was the steepest part of the curve — the low-code orchestration paradigm is different from writing LangGraph pipelines manually, but ultimately more accessible for rapid prototyping.

What I Learned

  • Google Cloud Agent Builder's tool-calling architecture maps cleanly onto real-world data pipeline problems
  • MCP servers as "superpowers" is an accurate metaphor — MongoDB MCP eliminated an entire layer of database integration code
  • Gemini's document reasoning capability handles messy financial filings surprisingly well with the right prompting strategy

Potential Impact

Any institutional investor, analyst, or researcher tracking Gulf capital flows can use this agent. The system is generalizable beyond SWFs — the same architecture applies to any class of SEC filers (activist investors, pension funds, ETF managers). With minor modifications, it becomes a universal SEC filing intelligence platform.

Built With

  • gemini
  • google-cloud-agent-builder
  • google-cloud-run
  • mongodb-atlas
  • mongodb-mcp
  • next.js
  • python
  • sec-edgar-api
Share this project:

Updates