AI Berkshire Core Features: Modular Agent-Driven Investment Research Framework Explained

AI Berkshire is a modular, agent-driven research framework that transforms individual investors into full-stack research operations through 18 canonical skills, four parallel AI agents emulating value-investment masters, and precision financial tools.

AI Berkshire is an open-source investment research framework that structures complex equity analysis into reproducible, automated workflows. According to the xbtlin/ai-berkshire repository, the system organizes functionality into three interoperating layers—Skill, Agent, and Tool—each implemented as Markdown files, Python utilities, or shell scripts designed to eliminate cognitive bias and ensure mathematical exactness.

The Three-Layer Architecture

AI Berkshire organizes its functionality into distinct Skill, Agent, and Tool layers. This architecture is visually documented in assets/architecture.png and defined in README.md (lines 31-46). The design ensures that high-level research commands translate into deterministic, auditable workflows across data collection, multi-perspective analysis, and rigorous validation.

Skill Layer: 18 Canonical Research Capabilities

The Skill Layer provides 18 high-level research capabilities exposed via slash-commands (Claude Code) or skill names (Codex). These skills reside in the skills/ directory and are auto-generated into codex-skills/ via scripts/sync-codex-skills.py.

The 18 skills cluster into five functional families:

Deep Research

  • investment-research: Full-company analysis synthesizing four value-investment perspectives
  • investment-team: Parallel-agent team research for rapid comprehensive coverage
  • management-deep-dive: Executive and leadership quality assessment
  • private-company-research: Detective work for non-public entities
  • deep-company-series: Multi-part series production

Financial Analysis

  • earnings-review: First-hand SEC filing analysis
  • earnings-team: Team-based earnings deep-dive for publication-ready output

Industry Screening

  • industry-research: Whole-industry chain mapping
  • industry-funnel: Multi-stage filtering from market to final three picks
  • quality-screen: Fast hard-filters based on 7-point quality checklist
  • bottleneck-hunter: Supply chain constraint identification
  • investment-checklist: Rapid buy-decision validation

Portfolio Management

  • portfolio-review: Position sizing and allocation optimization
  • thesis-tracker: Investment thesis monitoring and drift detection
  • news-pulse: Immediate price-move attribution to news events

Thinking Tools

  • dyp-ask: "Ask Duan Yongping" style Q&A simulation
  • financial-data: Rigorous data cross-validation
  • wechat-article: Collaborative article generation

Each skill is a self-contained Markdown file documenting workflows, required parameters, and example invocations.

Agent Layer: Four-Parallel-Agent Synthesis

Every skill invocation spawns four autonomous agents representing the viewpoints of value-investment masters: 段永平 (Duan Yongping), 巴菲特 (Buffett), 芒格 (Munger), and 李录 (Li Lu). This design is implemented in the Agent Layer and documented in the architecture diagram (assets/architecture.mmd).

Each agent performs three operations concurrently:

  • Data collection from web sources or tools/ utilities
  • Independent analysis of business models, moats, valuation, and risks
  • Adversarial challenge through "reverse-thinking" and "mirror-tests"

A Team Lead agent synthesizes these outputs, applies the "快速否决清单" (8-point red-line checklist), and produces a structured decision containing:

  • Decision: Pass / Grey / Fail
  • Price ranges: Aggressive, balanced, and conservative allocation targets
  • Confidence levels: A/B/C information richness ratings with source citations

Tool Layer: Precision Finance Utilities

The Tool Layer guarantees data integrity and mathematical exactness through Python utilities in tools/. All calculations use Python's decimal.Decimal to prevent floating-point drift, as implemented in tools/financial_rigor.py.

financial_rigor.py The primary precision mathematics module exposing CLI commands:

  • verify-market-cap: Cross-validates market capitalization calculations
  • verify-valuation: Checks valuation metric consistency
  • cross-validate: Multi-source data verification
  • three-scenario: Scenario analysis with precise decimal arithmetic
  • benford: Benford's Law anomaly detection for financial fraud screening
  • calc: Decimal-based calculator

stock_screener.py Implements the 7-point quality checklist for fast hard-filtering used by /quality-screen.

xueqiu_scraper.py Pulls real-time market data from Xueqiu.

morningstar_fair_value.py Generates fair-value estimates from Morningstar data.

momentum_backtest*.py Momentum strategy back-testing utilities.

Deterministic Workflow Execution

The AI Berkshire pipeline follows a deterministic sequence ensuring identical inputs always generate the same structured output.

  1. Skill invocation: User triggers a skill (e.g., /investment-research 腾讯)
  2. Agent dispatch: Skill dispatcher launches four parallel agents with tool access
  3. Independent analysis: Agents produce sub-reports with uncertainty ratings
  4. Synthesis: Team Lead aggregates outputs, applies red-line checklists, and delivers decision-ready reports

This reproducibility enables side-by-side comparison and audit trails, as documented in the "可复现的研究流程" section (lines 110-118) of README.md.

Practical Command Examples

The following commands demonstrate AI Berkshire's core features, compatible with both Claude Code (slash commands) and Codex CLI:


# Deep company research with four-master synthesis

investment-research 腾讯

# Parallel-agent team research for comprehensive coverage

investment-team 美团

# Quick buy-decision checklist across multiple tickers

investment-checklist 腾讯,阿里巴巴,茅台,英伟达

# Industry funnel screening from market to final three

industry-funnel "AI算力"

# Private company deep dive

private-company-research SpaceX

# Earnings report analysis

earnings-review PDD 2025Q4

# News-driven price attribution

news-pulse 腾讯

# Financial data validation

python3 tools/financial_rigor.py verify-market-cap \
  --price 510 --shares 9.11e9 --reported 4.65e12 --currency HKD

Extensibility and Customization

AI Berkshire supports expansion through plain-text file additions:

  • New skills: Create Markdown files in skills/ and run scripts/sync-codex-skills.py to regenerate Codex packages
  • New tools: Add Python modules to tools/ and expose CLI entries in financial_rigor.py
  • Architecture updates: Edit assets/architecture.mmd (Mermaid source) and regenerate PNG assets

Summary

  • AI Berkshire organizes investment research into three layers: Skill (18 capabilities), Agent (four parallel value masters), and Tool (precision finance utilities)
  • The Agent Layer synthesizes perspectives from Duan Yongping, Buffett, Munger, and Li Lu through adversarial analysis and mirror-tests
  • Deterministic workflows ensure reproducible research outputs with audit trails and confidence ratings
  • Extensible architecture allows researchers to add new skills via Markdown files and precision tools via Python modules
  • Source files including skills/, tools/financial_rigor.py, and scripts/sync-codex-skills.py provide the functional backbone for the framework

Frequently Asked Questions

What makes AI Berkshire different from other investment research tools?

Unlike single-perspective analysis tools, AI Berkshire implements four parallel autonomous agents representing distinct value-investment philosophies (段永平, 巴菲特, 芒格, 李录). According to the repository's architecture diagram (assets/architecture.png), these agents challenge each other through reverse-thinking and mirror-tests before synthesis, reducing cognitive bias. The system also enforces mathematical exactness using Python's decimal.Decimal in tools/financial_rigor.py, eliminating floating-point errors common in financial spreadsheets.

How does the 18-skill system work in practice?

The Skill Layer exposes research capabilities as simple commands like /investment-research or /industry-funnel. Each skill is a self-contained Markdown file in skills/ that defines workflows, parameters, and expected outputs. When invoked, the skill dispatcher coordinates the Agent and Tool layers to execute the research pipeline. The repository's scripts/sync-codex-skills.py automatically converts these Markdown definitions into Codex-compatible packages, ensuring Claude Code and Codex CLI users access identical functionality.

What is the "快速否决清单" (fast rejection checklist)?

The 8-point red-line checklist is applied by the Team Lead agent during the synthesis phase to immediately disqualify investments failing critical criteria. This checklist, referenced in the workflow documentation, evaluates factors like business integrity, financial health, and valuation reasonableness. If any red line is crossed, the system returns a "Fail" decision before proceeding to detailed valuation, saving research time and enforcing investment discipline.

Can I use AI Berkshire for private companies and non-US equities?

Yes. The private-company-research skill specifically handles non-public entities (e.g., SpaceX) through detective work and alternative data sources. For public equities, the xueqiu_scraper.py tool in tools/ pulls real-time data from Xueqiu, supporting Chinese and Hong Kong markets. The framework's modular design allows researchers to add region-specific data sources by creating new Python modules in tools/ and registering them in the skill definitions.

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 →