# How AI Berkshire Performs Industry Research from an Investment Theme: A 10-Stage Systematic Pipeline

> AI Berkshire performs industry research from an investment theme using a 10-stage pipeline blending Buffett's philosophies with automated data validation for smarter investment decisions. Learn more.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: how-to-guide
- Published: 2026-07-06

---

**AI Berkshire performs industry research from an investment theme by executing a reproducible 10-stage pipeline that blends the investment philosophies of Warren Buffett, Charlie Munger, Duan Yongping, and Li Lu with automated data validation through [`financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/financial_rigor.py) and [`report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/report_audit.py).**

AI Berkshire, an open-source investment research framework hosted at `xbtlin/ai-berkshire`, encodes systematic value investing principles into an auditable workflow. The methodology to perform industry research from an investment theme is fully documented in [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md) and executed through specialized validation tools in the `tools/` directory.

## The 10-Stage Investment Research Pipeline

The research process follows a rigorously-defined sequence that begins with bias acknowledgment and ends with automated quality assurance.

### Stage 1: Bias Self-Awareness (Pre-Step)

Before data collection begins, the system rates the target company's **information richness** (A/B/C classification) and records a confidence checklist. This forces the model to identify data gaps and recognize whether conclusions stem from verified facts or inference chains.

### Stage 2: Data Collection via Task Agent

The internal *Task* agent issues structured requests to gather revenue breakdowns, financial metrics, competitive positioning, management details, industry outlook, and risk factors. Data sources include Macrotrends, StockAnalysis, AASTocks, and 东方财富, as specified in [`skills/financial-data.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/financial-data.md).

### Stage 3: Cross-Verification with financial_rigor.py

Every key numeric field (share count, market cap, income, cash) is processed by [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py). This script performs multi-source consistency checks, precise decimal arithmetic (avoiding floating-point rounding errors), and generates a verification log appended to the final report.

### Stage 4: Business-Model Analysis

Guided by Duan Yongping's "right business" framework, the model produces a concise analysis of the company's core value proposition, revenue streams, profitability trends, and ecosystem lock-in mechanisms.

### Stage 5: Moat Evaluation

Buffett's five-moat framework assesses **branding**, **switching costs**, **network effects**, **scale**, and **tech patents**. Each moat claim is validated against the data collected in Stage 2.

### Stage 6: Reverse-Thinking & Risk Listing

Applying Munger's "invert-the-problem" approach, the system generates a failure-path matrix, identifies historical analogues, and flags cognitive biases including anchoring, survivorship, and narrative traps.

### Stage 7: Management Assessment

Leadership evaluation covers capital allocation decisions, ownership alignment, and cultural factors, combining Duan Yongping's "right people" criteria with Buffett's integrity lens.

### Stage 8: Industry & Civilization Trend Analysis

Li Lu's "civilization-evolution" view prompts analysis of paradigm shifts (e.g., AI, renewable energy) and forecasts Total Addressable Market (TAM) growth trajectories.

### Stage 9: Valuation & Safety Margin

Using [`financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/financial_rigor.py), the system runs three-scenario DCF/PE calculations (optimistic, base-case, bearish) and compares outcomes against historical and peer valuations to derive a **margin of safety**.

### Stage 10: Decision Memo & Audit

A final decision matrix (buy/hold/sell) is compiled, followed by execution of [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py), which randomly samples 15% of data points, re-validates them, and blocks publication unless all deviations are ≤ 1%.

## Automated Validation Tools in Practice

The `tools/` directory contains executable scripts that enforce numerical rigor throughout the pipeline.

### Verifying Market Capitalization

Use [`financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/financial_rigor.py) to verify that price × shares equals the reported market cap:

```bash
python3 tools/financial_rigor.py verify-market-cap \
    --price 42.37 \
    --shares 1500000000 \
    --reported 63400000000 \
    --currency USD

```

### Cross-Validating Financial Metrics

Cross-check net profit figures from multiple independent sources:

```bash
python3 tools/financial_rigor.py cross-validate \
    --field net_profit \
    --values '{"macrotrends": 5.23e9, "stockanalysis": 5.20e9}' \
    --unit USD

```

### Running Three-Scenario Valuations

Calculate valuation ranges across optimistic, base, and bearish cases:

```bash
python3 tools/financial_rigor.py three-scenario \
    --price 42.37 \
    --eps 3.12 \
    --shares 1.5e9 \
    --growth 0.12 0.08 0.03 \
    --pe 15 20 30 \
    --years 3 \
    --currency USD

```

### Auditing Final Reports

Before publication, extract audit samples and verify them:

```bash

# Extract 15% random sample from the report

python3 tools/report_audit.py extract \
    --report reports/Alibaba/Alibaba-Research-20260707.md > audit_samples.json

# After filling in fetched values, run the verdict

python3 tools/report_audit.py verdict \
    --results audit_samples_filled.json \
    --report reports/Alibaba/Alibaba-Research-20260707.md

```

## Key Source Files and Architecture

The pipeline is orchestrated through the `skills/` framework, ensuring every stage is reproducible and traceable to its data sources.

| Component | Path | Purpose |
|-----------|------|---------|
| Research workflow definition | [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md) | Step-by-step guide for the AI agent |
| Financial validation | [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) | Multi-source cross-check and precise arithmetic |
| Report auditing | [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py) | Random-sample verification and quality gate |
| Data source conventions | [`skills/financial-data.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/financial-data.md) | Lists primary and secondary data providers per market |
| Sample output | [`reports/Alibaba/Alibaba-Research-20260707.md`](https://github.com/xbtlin/ai-berkshire/blob/main/reports/Alibaba/Alibaba-Research-20260707.md) | Reference implementation of the final report format |

## Summary

- AI Berkshire performs industry research from an investment theme through a **10-stage pipeline** combining legendary investor frameworks with automated validation.
- **[`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py)** enforces numerical precision via multi-source cross-verification and decimal arithmetic.
- **[`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py)** provides a 15% random-sample quality gate that blocks publication if deviations exceed 1%.
- The methodology is defined in **[`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md)** and supports reproducible, auditable research workflows.

## Frequently Asked Questions

### How does AI Berkshire validate financial data accuracy?

AI Berkshire validates financial data through [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py), which performs multi-source consistency checks using precise decimal arithmetic to avoid floating-point errors. Every key numeric field (market cap, income, cash) generates a verification log that is appended to the final report's appendix.

### What investor frameworks guide the AI Berkshire research process?

The system integrates four legendary investor frameworks: **Warren Buffett's** moat and integrity criteria, **Charlie Munger's** reverse-thinking and bias detection, **Duan Yongping's** "right business, right people" principles, and **Li Lu's** civilization-evolution trend analysis. These are encoded in [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md).

### How does the automated audit process work in AI Berkshire?

The [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py) script randomly samples 15% of data points from the completed report, re-validates them against primary sources, and calculates deviation rates. The report is only published if all deviations are ≤ 1%, ensuring statistical reliability of the final investment thesis.

### Where can I find the complete methodology definition for AI Berkshire's research pipeline?

The complete 10-stage methodology is documented in [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md) in the `xbtlin/ai-berkshire` repository. This file defines each analytical stage, the required data inputs, and the validation criteria used to perform industry research from an investment theme.