How I Built an AI-Powered Investment Research Pipeline: From Filings to Conclusions
Doing investment research alone, there is never enough time: filings run hundreds of pages, then the earnings call transcripts, the 13F filings, the news flow. Over the past two years I rebuilt my entire research process into one pipeline where humans own judgment and machines own repetition. This post makes the whole architecture public, along with something more important than the tools: the verification rules that keep AI hallucination out.
The overall architecture: five stages
| Stage | What it does | Tools | The human's role |
|---|---|---|---|
| 1. Data collection | Prices, financial data, 13F, raw filing text | Python (yfinance, SEC EDGAR API) | Set the watchlist |
| 2. Document deep-reading | Extract the key points from 10-Ks, earnings call transcripts, and industry reports, and answer questions on them | Source-grounded AI Q&A tools | Design the questions, verify the citations |
| 3. Cross-verification | Check every key number against the primary source, line by line | Verification checklist + multi-source comparison | Final gatekeeping (cannot be outsourced to AI) |
| 4. Synthesis | Combine the data, the tax angle, and the industry read into conclusions | AI-assisted drafting | Judgment and the final stance (where the core value is) |
| 5. Output & maintenance | Analysis reports, tracking dashboards, scheduled periodic updates | Automation scripts + scheduler | Review before publishing |
The principle is simple: AI handles volume, humans handle quality. Any number that directly feeds a conclusion gets a final human check against the primary source.
Stage one: automating the data layer
The foundation is two Python pipelines. The first pulls market and financial data (yfinance covers most of what you need). The second pulls the raw filings from SEC EDGAR (I wrote up my approach to 13F tracking here). Both pipelines sit on a scheduler and run automatically on a set cadence, and both output a uniform format, so every downstream analysis references the same data source. That keeps the same number from showing up in three different versions across different documents.
Stage two: AI deep-reading, but source-grounded
To read a 10-K I use a source-grounded AI Q&A tool: feed in the filing PDF, and the AI can only answer from the uploaded document, with a citation attached to every answer. The difference from an open-ended chatbot is fundamental. An open chatbot fills the gaps from its training memory, and the filled-in numbers look convincing but may be three years old, or simply invented.
Question design is a method of its own. Instead of asking "how is this company doing financially," break it into a chain of questions that each have a definite answer: "what is this year's effective tax rate, what drove the change versus last year, what is management's guidance for next year's rate." The more verifiable the question, the more reliable the AI output.
Stage three: the anti-hallucination rules (the soul of the whole process)
The losses I have taken and the pitfalls I have watched others fall into distill down to four iron rules:
- Prices and market caps always get real-time, multi-source verification. An AI-remembered price is treated as stale by default. Any price that goes into a report is cross-checked against at least two independent real-time sources.
- Any YoY or growth rate: verify numerator and denominator against the primary source. AI fails most often on rates of change: mismatched periods, mixed definitions. When you verify, require the calculation and the source reference for both numbers.
- Cited page numbers must be checked against the original document. The "page 24" an AI gives you may come from a document that is only 5 pages long. If citation verification fails, redo the whole conclusion.
- Find one error, sweep for every same-class error. Hallucination is not a point event. One wrong number means the same batch of output may contain more errors from the same source, so re-verify the whole batch instead of fixing one spot and moving on.
Stages four and five: humans make the call, machines do the upkeep
The verified data and deep-reading notes flow into the synthesis stage, where AI helps me draft the structure and list the counterarguments, but the buy/sell decision, position sizing, and risk tolerance are not outsourced. Tracking after publication runs on scheduled automation: earnings season auto-pulls the new 10-Q to trigger an update, 13F filing season auto-diffs the holdings changes, and price moves beyond a threshold trigger an alert.
Where to start if you want to build your own
- Automate your single biggest pain point first (for most people that is "periodically pulling data into a spreadsheet"); one yfinance script already makes a difference.
- Add AI deep-reading second, but stand up the verification rules the same day. Do not wait until you get burned to add them.
- The tools keep changing; the architecture mostly does not: data layer, deep-reading layer, verification layer, judgment layer, maintenance layer. Stack them in that order and each layer can be swapped and upgraded independently.
Thoughts after reading?
Questions about this piece, or a different take? Email hello@taxcodeusstocks.com.
Notes
- The workflow described here is the author's actual research architecture; the tool chain keeps evolving as needs change
- Nothing here amounts to an investment conclusion about any specific security