Automate the complete stock investment research process: use NotebookLM to collect and extract structured data, then have the agent perform in-depth analysis and insight generation.
Prerequisites
NotebookLM authentication and the agent must be configured first:
# 设置代理环境变量(如需要)
$env:HTTP_PROXY='http://127.0.0.1:<PORT>' # 替换为你的代理端口
$env:HTTPS_PROXY='http://127.0.0.1:<PORT>'
$env:PYTHONIOENCODING='utf-8'
# 验证 NotebookLM 认证状态
notebooklm status
If not logged in, refer to the notebooklm skill instructions to complete login.
Workflow Overview
The complete research process is divided into 4 stages:
- Data Collection(NotebookLM): Create notebook → Deep Research → Import materials
- Structured Extraction(NotebookLM): Extract structured data from 40-50 files
- Deep Analysis(Agent): Perform 6-stage professional analysis based on structured data
- Output Report: Generate a complete investment research report
Stage 1: Data Collection (NotebookLM)
Step 1.1: Parse the target company
Extract from user input:
- Company name (Chinese/English)
- Stock ticker (if provided)
- Exchange (if provided)
Step 1.2: Create a dedicated notebook
notebooklm create "投资研究: [公司名称]" --json
Parse the returned notebook_id and set the context:
notebooklm use <notebook_id>
Step 1.3: Launch Deep Research
notebooklm source add-research "[公司名称] [股票代码] 财报 年报 10-K 10-Q 电话会 earnings call 券商研报 analyst report" --mode deep --no-wait -n <notebook_id>
Step 1.4: Wait for research to complete
notebooklm research wait -n <notebook_id> --import-all --timeout 1800
After completion, the notebook will contain 40-50 imported materials (financial reports, research reports, earnings call transcripts, etc.).
Stage 2: Structured Data Extraction (NotebookLM)
Core Strategy: Complete structured extraction inside NotebookLM to avoid loading large amounts of raw full text into the context.
Use the notebooklm ask command to execute the following 5 extraction tasks. For the prompts for each task, see references/prompts.md。
Extraction Task List
| Task | Objective | Output Format |
|---|---|---|
| 1. Business Composition Data | Revenue structure, profit composition, product descriptions | Structured table |
| 2. Financial KPI Data | Key financial metrics for the past 3-5 years | Structured table |
| 3. Valuation Data | Historical valuation multiples, competitor list | Structured table + list |
| 4. Market View Summary | Analyst ratings, consensus views | Structured list |
| 5. Verbatim Management and Analyst Views | Drivers, risk points (verbatim excerpts) | Verbatim quotes |
| 6. Core Risks and Downside Scenarios | 10-K Item 1A Risk Factors, litigation, customer concentration | Structured list |
| 7. Forward Guidance and Catalysts | Guidance, new product launches, major events | Structured list |
Execute Extraction
For each task, run:
notebooklm ask "<提取提示词>" -n <notebook_id> --json
Save the returned structured data to variables for use in subsequent analysis.
Supplement: Competitor valuation data (fetched online)
After obtaining the competitor list from Extraction Task 3, use search_web or directly query Yahoo Finance to obtain real-time valuation data:
搜索: "[竞争对手名称] PE ratio PS ratio PB ratio site:finance.yahoo.com"
Build a comparison table (target company vs. competitors).
Phase 3: In-depth analysis (agent side)
At this point, the context contains only structured data, no longer a large amount of raw full text.
Based on the extracted structured data, execute the 6-phase professional analysis. For the detailed prompts for each phase, see references/prompts.md。
Analysis Phase Checklist
| Phase | Analysis Content | Data Source |
|---|---|---|
| 1. Business composition and competitiveness | Revenue/profit breakdown, moat analysis | Extraction Task 1 |
| 2. Financial indicators and health | KPI trends, auditor perspective | Extraction Task 2 |
| 3. Valuation analysis | Historical valuation, peer comparison, reasonableness assessment | Extraction Task 3 + online data |
| 4. Market consensus and unique perspective | Consensus view + model insights | Extraction Task 4 + model reasoning |
| 5. Key drivers and system map | Model constructioncausal relationships | Extraction Tasks 5, 7 + model reasoning |
| 6. Comprehensive investment recommendation | Investment thesis, risks, valuation range, action recommendations | Integrate all analyses + Extraction Task 6 |
Important notes:
- The "unique perspective" in Phase 4: it is not excerpted from the materials, but actively uncovered by the model based on all data as insights the market may overlook.
- The "drivers and system map" in Phase 5: the model identifies core drivers, analyzes their interrelationships, and constructs causal chains, rather than simply listing viewpoints from the materials.
User investment preferences
When giving recommendations in Phase 6, incorporate the following preferences:
- Solid fundamentals: financially healthy, clear business logic
- Reasonable valuation: do not chase highs, seek a reasonable valuation range
- Has elasticity (growth potential): has clear future growth drivers
Phase 4: Output report
Integrate the analysis content from the 6 phases to generate a complete investment research report.
Report structure
# [公司名称] 投资研究报告
## 执行摘要
[1-2 段概括核心投资逻辑和建议]
## 1. 业务构成与竞争力分析
[阶段 1 的分析内容,包含表格]
## 2. 财务指标与健康度分析
[阶段 2 的分析内容,包含表格]
## 3. 估值分析
[阶段 3 的分析内容,包含对比表格]
## 4. 市场共识与独特视角
[阶段 4 的分析内容,突出独特洞察]
## 5. 关键驱动因子与系统图谱
[阶段 5 的分析内容,包含因果关系图]
## 6. 投资建议
[阶段 6 的综合建议]
---
*本报告由 stock-research skill 自动生成,基于 NotebookLM Deep Research 搜集的公开资料。*
Autonomy rules
Run automatically (no confirmation required):
- Create notebook
- Launch Deep Research
- Execute all extraction tasks
- Execute all analysis phases
- Generate final report
Prompt the user (confirmation required):
- If Deep Research times out (30 minutes), ask whether to continue waiting or use existing materials
- If the extracted data is clearly incomplete (e.g., missing key financial indicators), ask whether to supplement manually
Error handling
| Error scenario | Handling method |
|---|---|
| NotebookLM authentication failure | Prompt the user to run notebooklm login |
| Deep Research timed out | Ask whether to continue waiting or use existing materials |
| Extracted data incomplete | Record missing items, continue the analysis, and note them in the report |
| Web query failed | Use the valuation data in the materials, and note that competitor data is missing |
Notes
- Proxy configuration: If the user's network requires a proxy, make sure to set the environment variable before all
notebooklmcommands. - Time estimate: The complete process takes about 20-30 minutes (Deep Research 15-30 minutes + extraction and analysis 5-10 minutes).
- Data timeliness: The report is based on public materials collected by Deep Research, and its timeliness depends on when the materials were published.
- Investment advice disclaimer: The report generated by this Skill is for reference only and does not constitute investment advice.