How AI Berkshire Performs Earnings Reviews: A 9-Step Automated Workflow

AI Berkshire performs earnings reviews through a fully automated nine-stage pipeline that mirrors Warren Buffett and Li Lu's manual analysis, combining parallel document retrieval, Decimal-based financial validation, and deterministic quality auditing to generate publication-ready investment reports.

The xbtlin/ai-berkshire repository implements a sophisticated earnings review system that automates the rigorous analysis of corporate financial filings. This skill, defined in skills/earnings-review.md, orchestrates parallel agents to fetch primary source documents, validate financial data with exact precision, and produce auditable markdown reports through a deterministic quality gate.

Data Ingestion and Material Rating

The workflow begins by assessing source reliability and fetching primary documents in parallel.

Material Availability Classification

AI Berkshire first classifies source material into A / B / C levels: full original filings, partial filings, or only secondary summaries. This rating, defined in skills/earnings-review.md under "前置步骤:资料可得性评级", adjusts downstream weighting to ensure analysis quality matches data confidence.

Parallel Document Retrieval

The system spins up parallel Task agents to scrape primary sources simultaneously, including company IR pages, SEC EDGAR, HKEX, and 巨潮 (CNINF). These agents retrieve annual/quarterly reports, earnings-call transcripts, shareholder letters, and investor-day decks. If primary sources are missing, the workflow falls back to the financial-data skill's standardized providers (macrotrends, stockanalysis, aastocks, 东方财富).

Core Financial Extraction and Validation

Once documents are collected, the system extracts and rigorously validates all numerical data.

Financial Data Extraction

The skill extracts income-statement, cash-flow, and balance-sheet metrics—including revenue, gross profit, operating profit, EPS, operating cash flow, capex, free cash flow, and debt ratios. All calculations use exact Decimal arithmetic (never floating-point) to eliminate drift and guarantee reproducible results.

Cross-Validation Pipeline

The tools/financial_rigor.py module provides deterministic validation through three core functions:

  • cross_validate – Verifies financial metrics against ≥ 2 independent sources
  • verify_market_cap – Checks price × shares outstanding against reported valuations
  • verify_valuation – Validates P/E, P/B, and other ratios using cross-referenced inputs

These functions ensure numeric accuracy before any narrative analysis begins.

Narrative Analysis and Footnote Mining

Beyond raw numbers, the system performs deep semantic analysis of management communications.

MD&A and Sentiment Parsing

The Management Discussion & Analysis (MD&A) parser and earnings-call Q&A analyzer tag each paragraph with sentiment signals: 坦诚信号 (candor), 清晰信号 (clarity), 模糊信号 (ambiguity), 转移信号 (deflection), and 归因外部化 (externalization). The system also extracts prior-period management commitments and checks their fulfillment status.

Hidden-Information Extraction

The footnote scanner in skills/earnings-review.md (section "附注与隐藏信息挖掘") flags 关联交易 (related-party transactions), 股权激励 (equity incentives), 或有负债 (contingent liabilities), 会计政策变更 (accounting policy changes), 分部信息 (segment disclosures), and customer/supplier concentration. It automatically triggers alerts when accounts-receivable growth exceeds revenue growth or other anomalous trends appear.

Trend Analysis and Report Generation

Historical Comparison

The system builds multi-quarter time-series tables and contrasts actual results against prior management guidance. This "与历史数据对比" step ensures the analysis contextualizes current performance within the company's stated trajectory and historical volatility.

Structured Report Output

The final report renders to reports/{company}-earnings-{period}.md following a strict seven-section template:

  1. Data snapshot
  2. Three headline changes
  3. Management tone analysis
  4. Hidden footnote insights
  5. Q&A highlights
  6. Impact on investment thesis
  7. Decisive recommendation (加仓/持有/减仓 – increase/hold/reduce position)

This standardization allows downstream portfolio-review scripts to parse outputs reliably.

Quality Assurance and Auditing

Before publication, every report undergoes a deterministic audit process.

Report Audit Extraction

The tools/report_audit.py module executes an 准出流程 (exit process) that:

  • Extracts ~15% of reported numbers using deterministic random-seeded sampling
  • Cross-checks values against trusted data sources
  • Issues a PASS or FAIL verdict via the render_verdict logic

Correction Workflow

Reports receiving FAIL must be corrected and re-run through the audit. Only PASS reports are considered publishable. This quality gate ensures that codex-skills/earnings-review/SKILL.md (the Claude-Code artifact) maintains the same rigorous standards as the primary skill definition.

Invoking the Earnings Review Skill

Trigger the workflow via the slash-command interface:

/earnings-review 腾讯 2025Q4

This command dispatches the full pipeline defined in skills/earnings-review.md.

Manual Tool Invocation

For targeted validation, call the financial rigor tools directly:


# Verify market-cap consistency

python3 tools/financial_rigor.py verify-market-cap \
  --price 101 --shares 1.488e9 --reported 1.44e11 --currency USD

# Cross-validate revenue from multiple sources

python3 tools/financial_rigor.py cross-validate \
  --field revenue \
  --values '{"年报": 7518, "Yahoo": 7500, "StockAnalysis": 7520}' \
  --unit 亿

Run the report audit extraction (stage 8):

python3 tools/report_audit.py extract \
  --report reports/腾讯/腾讯-earnings-2025Q4.md \
  --ratio 0.15 --seed 42

Generate the final verdict:

python3 tools/report_audit.py verdict \
  --results '[{"id":1,"label":"营业收入","reported_value":7518,"unit":"亿","fetched_value":7518,"fetched_source":"macrotrends"}]' \
  --report "腾讯‑earnings‑2025Q4"

Summary

  • AI Berkshire implements a 9-stage automated pipeline for earnings reviews that mirrors top-tier investor due diligence.
  • Parallel Task agents fetch primary sources (SEC EDGAR, HKEX, company IR) while Decimal-based validation in tools/financial_rigor.py eliminates numeric error.
  • Sentiment analysis of MD&A and footnote mining expose hidden risks like related-party transactions and contingent liabilities.
  • Deterministic auditing via tools/report_audit.py samples 15% of data points and issues PASS/FAIL verdicts before publication.
  • Standardized markdown output enables automated downstream portfolio analysis while maintaining human-readable investment recommendations.

Frequently Asked Questions

What triggers the AI Berkshire earnings review process?

The process initiates when a user invokes the /earnings-review command followed by a company identifier and reporting period (e.g., /earnings-review 腾讯 2025Q4). This command is parsed by the AI-Berkshire dispatcher, which loads the workflow definition from skills/earnings-review.md and spawns the parallel agent infrastructure to begin data retrieval.

How does AI Berkshire ensure financial data accuracy?

The system enforces accuracy through cross-validation against ≥ 2 independent sources using tools/financial_rigor.py. All calculations use Python's Decimal class instead of floating-point numbers to prevent precision drift. The verify_market_cap and verify_valuation functions specifically check that calculated market capitalizations and valuation ratios match the reported figures within tight tolerances.

What happens if an earnings report fails the quality audit?

Reports that receive a FAIL verdict from tools/report_audit.py must be corrected and re-run through the entire audit pipeline. The render_verdict logic blocks publication until the extraction and verification process returns PASS, ensuring that only verified, accurate reports reach the final output stage.

Which primary sources does the earnings review system query?

The parallel Task agents query company IR pages, SEC EDGAR (for US listings), HKEX (for Hong Kong listings), and 巨潮 (CNINF) (for A-shares). If primary sources are unavailable, the system falls back to standardized data providers including macrotrends, stockanalysis, aastocks, and 东方财富 (East Money).

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →