AI & Agents

An AI Agent Stock Research Workflow That Cites Sources

A practical end-to-end workflow for agent-driven stock research: entity resolution, 13F ownership, Form 4 insider activity, and citations back to EDGAR.

Updated July 2, 20269 min read
An AI Agent Stock Research Workflow That Cites Sources

The short version

A dependable AI agent stock research workflow has four stages: resolve the security to stable identifiers (CIK and CUSIP, not a raw ticker string), pull institutional ownership from 13F filings, layer in Form 4 insider activity, then cross-check the two signals and cite every datapoint back to its SEC accession number. Fetching the data is the easy part. The discipline that separates a useful research agent from a confident hallucination machine is that every number in the final answer traces to a primary source with an as-of date.

Why unstructured agent research goes wrong

Ask a general-purpose LLM "what do hedge funds think of NVIDIA" and you get a fluent, plausible answer. That fluency is the trap. The model is sampling from training data with a cutoff, so the "holdings" it describes may be quarters stale, blended across reporting periods, or simply invented. Models routinely produce position sizes that never appeared in any filing and attach them to funds that exited the name long ago. We dissected these failure modes in how to stop AI hallucinating market data.

The fix is structural, not prompt-level. A research agent should be built so that:

  1. Every factual claim originates in a tool call, never in the model's parametric memory.
  2. Every tool result carries provenance: the filing it came from, the accession number, the period it covers.
  3. The agent reports dates alongside numbers. "This fund held X as of March 31, disclosed May 15" is research. "This fund holds X" is a guess wearing a suit.

SEC filings data is unusually well suited to this discipline because the primary source is public and addressable. Every 13F, Form 4, and Schedule 13D lives on EDGAR under a unique accession number, so an agent that cites accession numbers is auditable end to end. The rest of this article walks the workflow stage by stage.

Restrained editorial illustration of a developer desk and data connectors: image for

Step 1: Resolve the entity, not the string

Tickers are convenient for humans and treacherous for agents. They get reused after delistings, they differ across exchanges, and one company can have several: Alphabet trades as both GOOG and GOOGL, Berkshire as BRK.A and BRK.B. Meanwhile the filings themselves do not use tickers at all. A 13F identifies each position by CUSIP, and the filer by CIK, the SEC's permanent registrant identifier.

So the first tool call is always resolution: turn the user's string into a verified entity with its full identifier set.

curl -H "Authorization: Bearer YOUR_KEY" \
  "https://arkolith.com/api/v1/search?q=nvidia"

The response gives the agent what it needs downstream: ticker, issuer name, and the CUSIPs that institutional filings will reference. From this point on, the agent should join on identifiers, never on name strings. Name matching is where silent errors breed: filers spell issuer names dozens of different ways ("NVIDIA CORP", "Nvidia Corporation", and worse), so string joins either miss positions or quietly merge two companies into one.

Two resolution rules worth hardcoding into the agent's instructions:

  • If resolution is ambiguous, stop and ask. Returning polished research about the wrong company is worse than returning nothing.
  • Carry the resolved identifiers through the whole session. Resolve once, reuse everywhere, and include them in the final citations so the chain of custody is visible.

Step 2: Pull the institutional ownership picture

With the entity resolved, the agent pulls who owns it. The backbone is the 13F: institutional investment managers with at least $100 million in covered US equities must disclose their long positions quarterly, within 45 days of quarter end. The SEC's own Form 13F FAQ covers the mechanics. For 2026 the deadlines are February 17, May 15, August 14, and November 16.

That cadence shapes what the data can and cannot tell you. Arkolith's Q1 2026 dataset covers 1,824 institutional filers reporting 1.87 million long positions worth $53.7 trillion in disclosed value. That is a deep cross-section of institutional positioning, but it is a snapshot as of quarter end, published with a lag. How to read a 13F filing walks the line-item anatomy.

A holdings pull for a specific fund looks like this (the CIK here is Berkshire Hathaway's):

curl -H "Authorization: Bearer YOUR_KEY" \
  "https://arkolith.com/api/v1/funds/0001067983/holdings"

From the ownership data the agent should compute, not just retrieve:

  • Who holds the name, and at what portfolio weight. A 4% position at a concentrated fund says more than a 0.1% position at a broadly diversified one.
  • Quarter-over-quarter deltas. New positions, adds, trims, and full exits carry the signal. Static holdings are mostly noise.
  • Breadth and concentration. Is ownership broadening or narrowing across the tracked investor universe?

For a megacap, the interesting question is rarely "who owns it" (nearly everyone) but "who changed their position last quarter, and how aggressively."

Step 3: Layer in insider activity

13F data is broad but slow. Insider filings are the opposite: narrow but fast. Corporate officers, directors, and 10%+ owners must report their trades on Form 4 within two business days. That makes insider data the freshest ownership signal in the public record, and the natural cross-check on a quarter-old 13F snapshot. Arkolith tracks 51,000+ insider transactions alongside the institutional data; see for example the insider page for TSM.

The agent needs the filing taxonomy to query this layer correctly:

Filing Who files Deadline What it tells the agent
Form 3 New insiders Within 10 days of becoming an insider Baseline ownership stake
Form 4 Officers, directors, 10%+ owners Within 2 business days of the trade Near-real-time insider buys and sells
Form 5 Insiders Within 45 days of fiscal year end Late or exempt transactions
Schedule 13D Acquirers crossing 5% with intent Within 5 business days Activist stakes and intentions
Form 13F Managers over $100M 45 days after quarter end The full quarterly long book

The full comparison lives in 13F vs 13D vs 13G vs Form 4, and the SEC's investor education glossary is a good plain-English reference for the form types.

One practical caution: not every Form 4 is informative. Option exercises, scheduled plan sales, and tax-withholding dispositions are routine plumbing. Open-market purchases made with the insider's own cash are the category academic work has generally treated as most informative, particularly when several insiders at the same company buy in a cluster. The agent should classify transaction codes before drawing conclusions, not just sum buys and sells.

Step 4: Cross-check, then cite or discard

The agent now holds two datasets with different latencies and different biases, and the real analysis is reconciling them. Rules worth encoding:

  • Date discipline. A 13F position is "as of" quarter end but only knowable at filing time. An agent that treats a May 15 filing as a May 15 position will misread momentum. Academic work on 13F replication has generally found the reporting lag erodes much of the copyable value, which is exactly why the fresher Form 4 layer earns its place in the loop.
  • Amendments supersede. Both 13Fs and Form 4s get amended, and amendments can restate or replace earlier figures. The agent must read the latest filing in a chain or it will double-count positions or resurrect corrected errors. How accurate is 13F data covers these sharp edges.
  • Options are not longs. 13F filings include put and call positions. A fund's headline "position" in a stock may actually be a bearish put. Aggregate the long equity book only, and surface option legs separately with their direction labeled.
  • Conflicting signals are findings, not errors. Institutions adding while insiders sell heavily, or the reverse, is precisely the divergence worth surfacing to the user, with both sides dated and cited.

Then comes the non-negotiable final step: every number in the output carries the accession number of the filing it came from. Per-datapoint provenance is the anti-hallucination mechanism. Each value Arkolith returns traces to a specific EDGAR accession, and a skeptical human can pull the original document through EDGAR full-text search to confirm it. If a claim cannot be cited, the agent should drop it.

Wiring the loop into your agent

The complete loop is compact: resolve the entity, pull institutional ownership, pull insider activity, classify and cross-check, then write the summary with a citation on every figure. Over REST it is three or four calls. Listing or screening the fund universe first is one more:

curl -H "Authorization: Bearer YOUR_KEY" \
  "https://arkolith.com/api/v1/funds"

REST works from any runtime. For Claude and other MCP-capable agents, the same tools are exposed over MCP, so the agent chains them natively in conversation without glue code. Setup for both paths is in the quickstart.

Keep the agent's standing instructions short and structural rather than clever: resolve first, join on identifiers, classify transactions before aggregating, date every claim, cite every number, and say "the tool call failed" instead of filling a gap from memory. The model supplies reasoning and synthesis. The workflow supplies ground truth. Research quality comes from refusing to let either one do the other's job.

Restrained editorial illustration of a developer desk and data connectors, alternate view: image for

Frequently asked questions about AI agent stock research

Can an AI agent do stock research without a structured data API?

It can browse and summarize commentary, but it cannot reliably produce verifiable numbers that way. Scraped pages mix as-of dates, lack identifiers, and give the agent nothing stable to cite. A structured filings API gives the agent identifiers, dates, and accession-level provenance, which is what makes the output checkable.

How fresh is the ownership data an agent can pull?

It depends on the filing type. Form 4 insider trades must be reported within two business days, so that layer is nearly current. 13F institutional positions are quarter-end snapshots that can arrive up to 45 days after quarter end, so the agent should always present them with their as-of date.

Should the agent weight 13F data or insider data more heavily?

Neither dominates; they answer different questions. 13F data is broad and slow: the whole long book of every large manager, once a quarter. Form 4 data is narrow and fast: a handful of insiders, within days. The workflow above treats agreement between them as reinforcement and divergence as a finding to report.

How do I stop the agent from inventing numbers in the final write-up?

Constrain it structurally: instruct it that every figure must come from a tool result in the current session and carry the filing's accession number. Reject or regenerate any draft containing an uncited number. Provenance-first data makes this enforceable, because each datapoint already ships with its source attached.

This article explains public filings and data concepts. It is not investment advice.

#AI agents#stock research#MCP#13F#Form 4#provenance#workflow