How the Industry Funnel Filtering Feature Works in AI Berkshire: A 4-Layer Investment Screening System
The industry funnel filtering feature in AI Berkshire implements a multi-stage, rule-driven pipeline that narrows a broad market universe down to three high-conviction investment targets through systematic liquidity, momentum, valuation, and qualitative moat analysis.
This deterministic screening system is defined in the repository's skill framework and executed via the /industry-funnel slash command. According to the AI Berkshire source code in skills/industry-funnel.md, the feature combines quantitative hard metrics with qualitative "four-master" investment philosophy to generate auditable research reports.
Four-Layer Funnel Architecture
The industry funnel operates as a sequential filter, with each layer reducing the candidate pool while increasing analytical depth.
Layer 1: Full-Market Liquidity and Momentum Scan
The entry point begins when a user supplies an industry or theme (e.g., "AI算力" or "创新药") as the $ARGUMENTS parameter. The system then constructs three distinct subsets from the full market universe:
- A类 (Class A) – The 30 stocks with the highest average daily turnover over the last 30 days per market.
- B类 (Class B) – The top 20 performers in both 30-day and 90-day price momentum.
- C类 (Class C) – The 30 largest market-capitalization companies within the specified sector.
The union of these three categories produces a 30-to-60 company pool that balances liquidity, trend strength, and sector dominance.
Layer 2: Hard-Metric Value Filter
Every candidate from Layer 1 undergoes rigorous quantitative screening against five value-investment criteria:
- PE Ratio – Must be reasonable versus historical range, with PEG < 1.5 serving as a relaxed threshold.
- ROE – Minimum 15% or demonstrating a clear improving trend.
- Operating Cash Flow – Positive and greater than or equal to 70% of net profit.
- Debt-to-Equity – Below 60% (extended to 70% for utility companies).
- Moat Rating – Minimum three stars (★★★) based on brand strength, network effects, or scale advantages.
Companies meeting all five criteria advance automatically. Those meeting four with a near-miss on the fifth receive yellow flags. All others are eliminated with explicit reasoning logged. The goal is to reduce the pool to ≤10 survivors.
Layer 3: Structured "精细分析" (Detailed Analysis)
For each remaining firm, the system generates a 300-500 word structured analysis covering:
- Business model mechanics
- Financial quality assessment
- Moat depth evaluation
- Top three risk factors
- Quick valuation snapshot
- Binary "enter final-3?" decision
This layer transforms raw metrics into investment narrative while maintaining elimination discipline.
Layer 4: Four-Master Deep Dive
The final three candidates undergo qualitative review through the investment frameworks of 段永平 (Duan Yongping), 巴菲特 (Warren Buffett), 芒格 (Charlie Munger), and 李录 (Li Lu). Each "master" contributes a concise perspective on:
- Business essence and durability
- Moat depth and erosion risks
- Potential failure modes
- Alignment with civilizational trends
This multi-perspective validation reduces single-analyst bias before final selection.
Invocation and Execution
You can trigger the industry funnel filtering feature through two primary interfaces.
Via slash command (Claude/Claude-Code or Codex UI):
/industry-funnel AI算力
Via Python programmatic wrapper:
import subprocess
import pathlib
# Assuming the repo is cloned at ~/ai-berkshire
skill_path = pathlib.Path("~/ai-berkshire/skills/industry-funnel.md")
args = "AI算力"
# Execute via the CLI entry point
result = subprocess.check_output(
["bash", "-c",
f"python3 ~/ai-berkshire/tools/run_skill.py industry-funnel \"{args}\""]
)
print(result.decode())
The codex-prompts/industry-funnel.md file provides the prompt wrapper for the slash-command interface, while AGENTS.md maintains synchronization between skill definitions and execution prompts.
Output Format and Audit Trail
The system generates a comprehensive markdown report saved to reports/{行业}-funnel-{YYYYMMDD}.md. This document contains:
- Stage-by-stage data tables showing progression through the funnel
- Explicit elimination reasons for every rejected company
- Final recommendation table with position sizing, weight recommendations, and investment rationale
Bias mitigation is enforced throughout the pipeline. The skill logs all elimination reasons, flags "沾边股" (peripheral stocks that barely qualify), and mandates both English and Chinese source searches to avoid data-source bias (see the "AI 研究偏见自觉" section in skills/industry-funnel.md).
After generation, tools/report_audit.py validates the output against a data-extraction checklist to ensure analytical completeness and traceability.
Summary
- The industry funnel is defined in
skills/industry-funnel.mdand invoked via/industry-funnel {theme}. - Layer 1 creates a 30-60 stock universe from liquidity (A类), momentum (B类), and market-cap (C类) leaders.
- Layer 2 applies five hard metrics (PE, ROE, cash flow, debt, moat) to filter down to ≤10 candidates.
- Layer 3 generates structured 300-500 word qualitative analyses for remaining firms.
- Layer 4 applies four-master investment philosophy (段永平, 巴菲特, 芒格, 李录) to select the final three recommendations.
- Output includes full audit trails, elimination reasoning, and bias safeguards in markdown format.
Frequently Asked Questions
What are the specific financial thresholds used in the hard-metric filter?
The hard-metric layer requires PEG ratios below 1.5, ROE exceeding 15% or improving, operating cash flow at least 70% of net profit, debt-to-equity under 60% (70% for utilities), and a minimum three-star moat rating. Companies must meet all five criteria to advance automatically; those meeting four with near-misses receive yellow flags but may still progress.
How does the system prevent bias in industry analysis?
According to the source code in skills/industry-funnel.md, the system implements "AI 研究偏见自觉" (AI research bias awareness) by logging all elimination reasons explicitly, flagging peripheral stocks that barely qualify ("沾边股"), and enforcing dual-language source requirements (both English and Chinese) to avoid geographic data-source bias.
Where is the final investment report stored and what does it contain?
The markdown report is saved to reports/{行业}-funnel-{YYYYMMDD}.md and contains tables for each funnel stage, specific elimination reasons for rejected companies, and a final recommendation table with position weights and investment rationale. The tools/report_audit.py script validates this output against compliance checklists.
Can the industry funnel be customized for specific investment themes?
Yes. The skill accepts any industry or investment direction as the $ARGUMENTS parameter (e.g., "创新药", "新能源", "AI算力"). The underlying logic in skills/industry-funnel.md remains consistent, but the initial universe scan adapts to the specified sector while maintaining the same four-layer filtering methodology and four-master review process.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →