FMP

FMP

Build a Multi-Agent 13F Filing Analyzer to Recreate Hedge Fund Strategies

Institutional investors in the United States with more than a specified level of assets under management are required to disclose their equity holdings through Form 13F filings. These filings, published quarterly, provide a snapshot of what large hedge funds and asset managers hold at a given point in time. While they do not reveal intraday trades or timing decisions, they remain one of the most widely used public sources for studying institutional positioning.

The Limits of Ad-Hoc 13F Analysis

In practice, however, 13F data is often reviewed in an ad-hoc way—through individual filings, static spreadsheets, or one-off comparisons between quarters. This makes it difficult to systematically analyze portfolio composition, track changes over time, or apply consistent logic across multiple funds. As the number of filings grows, manual approaches quickly become brittle and error-prone.

A Structured Approach Using FMP Data

In this article, we build a structured 13F filing analyzer using Financial Modeling Prep (FMP) as the primary data layer. FMP provides normalized access to 13F holdings data, removing the need to parse raw regulatory documents and align schemas across quarters. This allows the workflow to focus on repeatable analysis—such as aggregating positions, identifying allocation shifts, and comparing portfolios across reporting periods—rather than on data preparation.

Organizing the Workflow with a Multi-Agent Pipeline

The analyzer is organized using a multi-agent pipeline, where each agent is responsible for a specific stage of the workflow. One agent retrieves 13F data, another analyzes position-level changes across reporting periods, and a final agent synthesizes these observations into a higher-level view of a fund's strategy. The agents execute in a linear sequence, keeping the system easy to follow and straightforward to extend.

What This Analyzer Is and Is Not

The goal is not to replicate hedge fund performance or make predictive claims. Instead, the focus is on reconstructing observable strategy patterns—such as concentration, turnover, and position sizing—based on publicly available filings. By the end of this article, you will have a clear blueprint for building a compact, extensible 13F analysis system grounded in FMP data and structured using a clean multi-agent design. The resulting workflow makes it easier to perform repeatable quarter-over-quarter comparisons, surface portfolio changes consistently, and scale analysis across multiple filers without relying on manual spreadsheets.

System Overview: A Compact Multi-Agent 13F Analysis Pipeline

The 13F analyzer is organized as a compact, linear multi-agent pipeline. Each agent owns a clear responsibility, and data flows in one direction through a shared state. This keeps the system easy to reason about while still allowing extensions later.

End-to-End Flow

At a high level, the pipeline follows four steps:

  1. Retrieve filings for a target institution and reporting periods
  2. Normalize holdings into a consistent, analyzable table
  3. Compare positions across quarters to identify changes
  4. Synthesize insights that describe observable strategy patterns

Agents execute sequentially and communicate via a shared state object. There is no branching or dynamic routing; the emphasis is clarity and determinism.

Why Agents Here?

Agents act as organizational boundaries, not framework-heavy components:

  • They isolate data access from analysis logic.
  • They make quarter-over-quarter comparisons reusable.
  • They allow the synthesis step to evolve without touching ingestion.

This structure mirrors how 13F analysis is done in practice—data collection first, then position analysis, then interpretation—while keeping implementation overhead low.

Shared State as the Integration Point

All agents read from and write to a single shared state dictionary that carries the target institution (CIK), filing periods, normalized holdings, and derived comparisons and summaries. Using a shared state keeps the workflow deterministic and makes intermediate results easy to inspect, which simplifies debugging, validation, and experimentation when analyzing multiple filers or reporting periods.

With the architecture defined, the next step is to look at how FMP's 13F datasets fit naturally into this pipeline and what information they provide for analysis.

Using FMP 13F Data as the Core Input

The entire analyzer is built around 13F holdings data, and this is where Financial Modeling Prep (FMP) becomes the foundation of the workflow. Instead of working with raw SEC documents, the system relies on FMP's structured representation of 13F filings, which makes institutional holdings practical to analyze programmatically.

What 13F Data Represents in Practice

A 13F filing captures an institution's long equity positions at the end of a reporting quarter. At a high level, the data can be viewed as:

  • an institution identifier (CIK)
  • a reporting period (quarter)
  • a list of holdings with symbols, share counts, and market values

From an analysis perspective, this structure answers questions such as:

  • Which stocks does the fund hold?
  • How concentrated is the portfolio?
  • Which positions are largest by value?
  • How does the portfolio change from one quarter to the next?

How FMP's 13F Data Fits the Pipeline

Within the analyzer, FMP's 13F datasets are used as normalized inputs to the agent pipeline:

  • The filing data provides the authoritative snapshot of holdings for a given quarter.
  • Each holding is treated as a row-level observation that can be compared across reporting periods.
  • Consistent symbol-level data enables direct quarter-over-quarter analysis without additional reconciliation.

In workflow terms, this data becomes the starting table that all downstream agents operate on. The pipeline does not infer trades or timing; it works strictly with what is disclosed in the filings.

Why This Data Is Sufficient for Strategy Analysis

Even with quarterly granularity, 13F data is enough to surface meaningful patterns:

  • Position concentration reveals conviction and risk appetite.
  • Additions and reductions highlight evolving views.
  • Exits and initiations indicate shifts in portfolio focus.

By grounding the analyzer in FMP's 13F datasets, the system stays focused on observable, verifiable information. With the core data defined, the next step is to show how agents transform raw holdings into interpretable strategy insights.

Data Sources Behind the Article

  • Filings Extract API: This endpoint provides structured access to extracted Form 13F holdings, including issuer identifiers, security names, share counts, and reported values.
  • Form 13F Filings Dates API: This API provides the list of available reporting dates for an institution's Form 13F filings, allowing you to identify which quarters have disclosed holdings data before retrieving position-level details.

Agent Responsibilities: Data Extraction, Position Analysis, and Strategy Inference

With the 13F data defined, the analyzer organizes its logic into three tightly scoped agents. Each agent corresponds to a concrete stage of institutional holdings analysis, progressing from assembling disclosed positions, to comparing portfolio changes across quarters, and finally to summarizing observable allocation patterns. The goal is not to abstract the workflow, but to make each stage explicit, ordered, and replaceable.

Filing Data Agent

The Filing Data Agent is responsible for retrieving and structuring 13F holdings for a given institution and reporting period.

Its responsibilities are limited to:

  • Fetching 13F filings from FMP for a specified CIK and quarter
  • Returning holdings in a normalized tabular form (one row per holding)
  • Ensuring consistency in symbol, value, and share fields

From a workflow perspective, this agent converts public disclosures into a machine-readable portfolio snapshot. It does not attempt to interpret or compare data—it only establishes a reliable starting point for analysis.

Position Analysis Agent

The Position Analysis Agent operates on multiple quarters of normalized holdings. Its role is to identify how a portfolio evolves over time by comparing consecutive filings.

Typical analyses performed by this agent include:

  • Detecting new positions introduced in the latest quarter
  • Identifying exited positions that no longer appear
  • Measuring position size changes for continuing holdings
  • Ranking holdings by value to surface top convictions

This agent produces structured comparison outputs rather than narrative conclusions. It answers what changed between reporting periods, leaving interpretation to the next stage.

Strategy Inference Agent

The Strategy Inference Agent takes the outputs of the position analysis and produces higher-level observations about the fund's observable behavior.

Rather than making predictions or claims about intent, this agent focuses on patterns that can be inferred directly from the data, such as:

  • Portfolio concentration versus diversification
  • Turnover intensity across quarters
  • Dominance of a small number of positions
  • Consistent exposure to specific sectors or themes (when applicable)

The output of this agent is a concise, human-readable summary that describes how the fund appears to allocate capital, based strictly on disclosed holdings.

Execution Model

All three agents execute sequentially and share a common state. Each agent reads only the inputs it needs and appends its results to the state for downstream use. This linear execution keeps the system transparent and avoids hidden dependencies.

Implementing the Core 13F Analysis Flow

This section walks through a compact implementation of the analyzer. The focus is on showing how FMP's 13F data moves through the pipeline—from raw holdings to strategy-level insights—without expanding into a full production system.

When the pipeline completes, the output consists of structured tables and summaries that describe an institution's disclosed portfolio: normalized holdings by quarter, position-level changes across reporting periods, and a concise set of strategy indicators such as concentration, turnover, and top-position dominance. The steps below show how these outputs are constructed incrementally from raw 13F filings.

0) Get Your API Key

Before retrieving any 13F filings, you will need your own Financial Modeling Prep API key. You can generate an API key by creating a free account on the Financial Modeling Prep website, which enables authenticated access to the 13F filings endpoints used throughout this workflow.

1) Retrieve 13F filings using FMP

import requests

import pandas as pd


def fetch_13f_holdings(cik: str, quarter: str, api_key: str) -> pd.DataFrame:


# Example endpoint pattern for fetching 13F holdings by institution and period

url = f"https://financialmodelingprep.com/api/v3/form-thirteen/{cik}"

resp = requests.get(url, params={"date": quarter, "apikey": api_key})

resp.raise_for_status()


df = pd.DataFrame(resp.json())


return df

Workflow mapping:

This call returns the disclosed equity holdings for a given institution and reporting period, which becomes the base portfolio snapshot used for all downstream analysis.

2) Normalize holdings for comparison

def normalize_holdings(df: pd.DataFrame) -> pd.DataFrame:


# Keep only fields required for position-level analysis

cols = ["symbol", "name", "shares", "value"]

df = df[cols].copy()


# Ensure numeric fields are usable for comparisons

df["shares"] = pd.to_numeric(df["shares"], errors="coerce")

df["value"] = pd.to_numeric(df["value"], errors="coerce")


return df.dropna(subset=["symbol"])



Workflow mapping:

Normalization ensures that holdings from different quarters can be compared consistently at the symbol level.

3) Compare holdings across quarters

def compare_quarters(prev_df: pd.DataFrame, curr_df: pd.DataFrame) -> pd.DataFrame:


merged = curr_df.merge(

prev_df,

on="symbol",

how="outer",

suffixes=("_curr", "_prev"),

indicator=True,

)


def classify(row):

if row["_merge"] == "left_only":

return "NEW"

if row["_merge"] == "right_only":

return "EXITED"

return "CHANGED"


merged["position_status"] = merged.apply(classify, axis=1)

merged["value_change"] = merged["value_curr"] - merged["value_prev"]


return merged



Workflow mapping:

This comparison step highlights portfolio changes—new positions, exits, and size adjustments—between two reporting periods.

4) Synthesize strategy-level insights

def summarize_strategy(comp_df: pd.DataFrame) -> dict:


total_value = comp_df["value_curr"].sum()


top_positions = (

comp_df.sort_values("value_curr", ascending=False)

.head(5)[["symbol", "value_curr"]]

.to_dict("records")

)


concentration = sum(p["value_curr"] for p in top_positions) / total_value


return {

"top_positions": top_positions,

"top_5_concentration": round(concentration, 3),

"new_positions": int((comp_df["position_status"] == "NEW").sum()),

"exited_positions": int((comp_df["position_status"] == "EXITED").sum()),

}



Workflow mapping:

This step converts raw position changes into interpretable signals such as concentration and turnover, which are commonly used to describe institutional strategy.

End-to-end flow

At this point, the analyzer has:

  • Pulled structured 13F data from FMP
  • Normalized and compared holdings across quarters
  • Summarized observable portfolio behavior

Final Words: From 13F Filings to Repeatable Strategy Insights

You now have a compact blueprint for analyzing hedge fund positioning using 13F filings and a multi-agent pipeline. The workflow stays simple: one agent retrieves holdings, one agent compares quarters, and one agent converts those changes into strategy-level observations such as concentration, turnover, and top-position dominance.

This design keeps the system practical:

  • FMP data retrieval stays isolated inside the Filing Data Agent, so you can change filing periods or funds without touching analysis logic.
  • Quarter-over-quarter comparisons remain deterministic because the Position Analysis Agent operates on normalized holdings tables.
  • Strategy summaries remain grounded in disclosed data, which helps you avoid over-interpreting what filings can't show (like intraday trades or exact entry timing).

If you extend this analyzer next, the most natural upgrades are:

  • Track multiple funds and rank “consensus buys” and “consensus exits” across managers
  • Add multiple quarters to compute trends like persistent accumulation vs one-off changes

The key takeaway is straightforward: FMP's structured 13F holdings data provides the raw material, and the multi-agent design keeps your analysis modular, readable, and easy to evolve as your research questions grow.