notebooklm

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

NotebookLM Research Assistant Skill

NotebookLM 研究助手技能

Interact with Google NotebookLM to query documentation with Gemini's source-grounded answers. Each question opens a fresh browser session, retrieves the answer exclusively from your uploaded documents, and closes.
与Google NotebookLM交互,查询文档并获得Gemini提供的有来源支撑的答案。每次提问都会打开一个全新的浏览器会话,仅从你上传的文档中检索答案后关闭会话。

When to Use This Skill

何时使用该技能

Trigger when user:
  • Mentions NotebookLM explicitly
  • Shares NotebookLM URL (
    https://notebooklm.google.com/notebook/...
    )
  • Asks to query their notebooks/documentation
  • Wants to add documentation to NotebookLM library
  • Uses phrases like "ask my NotebookLM", "check my docs", "query my notebook"
当用户出现以下行为时触发:
  • 明确提到NotebookLM
  • 分享NotebookLM链接(
    https://notebooklm.google.com/notebook/...
  • 要求查询自己的笔记本/文档
  • 想要将文档添加到NotebookLM库中
  • 使用类似“询问我的NotebookLM”、“检查我的文档”、“查询我的笔记本”这类表述

⚠️ CRITICAL: Add Command - Smart Discovery

⚠️ 关键要求:添加命令 - 智能发现

When user wants to add a notebook without providing details:
SMART ADD (Recommended): Query the notebook first to discover its content:
bash
undefined
当用户想要添加笔记本但未提供细节时:
智能添加(推荐):先查询笔记本内容,自动识别相关信息:
bash
undefined

Step 1: Query the notebook about its content

步骤1:查询笔记本的内容信息

python scripts/run.py ask_question.py --question "What is the content of this notebook? What topics are covered? Provide a complete overview briefly and concisely" --notebook-url "[URL]"
python scripts/run.py ask_question.py --question "What is the content of this notebook? What topics are covered? Provide a complete overview briefly and concisely" --notebook-url "[URL]"

Step 2: Use the discovered information to add it

步骤2:使用识别到的信息添加笔记本

python scripts/run.py notebook_manager.py add --url "[URL]" --name "[Based on content]" --description "[Based on content]" --topics "[Based on content]"

**MANUAL ADD**: If user provides all details:
- `--url` - The NotebookLM URL
- `--name` - A descriptive name
- `--description` - What the notebook contains (REQUIRED!)
- `--topics` - Comma-separated topics (REQUIRED!)

NEVER guess or use generic descriptions! If details missing, use Smart Add to discover them.
python scripts/run.py notebook_manager.py add --url "[URL]" --name "[基于内容生成]" --description "[基于内容生成]" --topics "[基于内容生成]"

**手动添加**:如果用户提供了所有信息:
- `--url` - NotebookLM链接
- `--name` - 描述性名称
- `--description` - 笔记本包含的内容(必填!)
- `--topics` - 英文逗号分隔的主题标签(必填!)

绝对不要猜测或使用通用描述!如果信息缺失,请使用智能添加功能自动识别。

Critical: Always Use run.py Wrapper

关键要求:始终使用run.py封装脚本

NEVER call scripts directly. ALWAYS use
python scripts/run.py [script]
:
bash
undefined
绝对不要直接调用脚本,始终使用
python scripts/run.py [脚本名称]
bash
undefined

✅ CORRECT - Always use run.py:

✅ 正确用法 - 始终使用run.py:

python scripts/run.py auth_manager.py status python scripts/run.py notebook_manager.py list python scripts/run.py ask_question.py --question "..."
python scripts/run.py auth_manager.py status python scripts/run.py notebook_manager.py list python scripts/run.py ask_question.py --question "..."

❌ WRONG - Never call directly:

❌ 错误用法 - 不要直接调用:

python scripts/auth_manager.py status # Fails without venv!

The `run.py` wrapper automatically:
1. Creates `.venv` if needed
2. Installs all dependencies
3. Activates environment
4. Executes script properly
python scripts/auth_manager.py status # 没有虚拟环境会运行失败!

`run.py` 封装脚本会自动完成以下操作:
1. 必要时自动创建 `.venv` 虚拟环境
2. 安装所有依赖
3. 激活虚拟环境
4. 正确执行脚本

Core Workflow

核心工作流

Step 1: Check Authentication Status

步骤1:检查认证状态

bash
python scripts/run.py auth_manager.py status
If not authenticated, proceed to setup.
bash
python scripts/run.py auth_manager.py status
如果未认证,继续进行认证设置。

Step 2: Authenticate (One-Time Setup)

步骤2:认证(仅需首次设置)

bash
undefined
bash
undefined

Browser MUST be visible for manual Google login

浏览器必须可见,用于手动完成Google登录

python scripts/run.py auth_manager.py setup

**Important:**
- Browser is VISIBLE for authentication
- Browser window opens automatically
- User must manually log in to Google
- Tell user: "A browser window will open for Google login"
python scripts/run.py auth_manager.py setup

**重要说明:**
- 认证过程中浏览器是可见的
- 浏览器窗口会自动打开
- 用户需要手动完成Google账号登录
- 需要告知用户:"将打开一个浏览器窗口用于Google登录"

Step 3: Manage Notebook Library

步骤3:管理笔记本库

bash
undefined
bash
undefined

List all notebooks

列出所有笔记本

python scripts/run.py notebook_manager.py list
python scripts/run.py notebook_manager.py list

BEFORE ADDING: Ask user for metadata if unknown!

添加前注意:如果不知道元数据,需要先询问用户!

"What does this notebook contain?"

"这个笔记本包含什么内容?"

"What topics should I tag it with?"

"我应该给它打上什么主题标签?"

Add notebook to library (ALL parameters are REQUIRED!)

添加笔记本到库中(所有参数均为必填项!)

python scripts/run.py notebook_manager.py add
--url "https://notebooklm.google.com/notebook/..."
--name "Descriptive Name"
--description "What this notebook contains" \ # REQUIRED - ASK USER IF UNKNOWN! --topics "topic1,topic2,topic3" # REQUIRED - ASK USER IF UNKNOWN!
python scripts/run.py notebook_manager.py add
--url "https://notebooklm.google.com/notebook/..."
--name "描述性名称"
--description "笔记本包含的内容" \ # 必填 - 未知时请询问用户! --topics "主题1,主题2,主题3" # 必填 - 未知时请询问用户!

Search notebooks by topic

按主题搜索笔记本

python scripts/run.py notebook_manager.py search --query "keyword"
python scripts/run.py notebook_manager.py search --query "关键词"

Set active notebook

设置当前活跃笔记本

python scripts/run.py notebook_manager.py activate --id notebook-id
python scripts/run.py notebook_manager.py activate --id 笔记本ID

Remove notebook

删除笔记本

python scripts/run.py notebook_manager.py remove --id notebook-id
undefined
python scripts/run.py notebook_manager.py remove --id 笔记本ID
undefined

Quick Workflow

快速工作流

  1. Check library:
    python scripts/run.py notebook_manager.py list
  2. Ask question:
    python scripts/run.py ask_question.py --question "..." --notebook-id ID
  1. 查看笔记本库:
    python scripts/run.py notebook_manager.py list
  2. 提问:
    python scripts/run.py ask_question.py --question "..." --notebook-id 笔记本ID

Step 4: Ask Questions

步骤4:提问查询

bash
undefined
bash
undefined

Basic query (uses active notebook if set)

基础查询(如果设置了活跃笔记本则默认使用)

python scripts/run.py ask_question.py --question "Your question here"
python scripts/run.py ask_question.py --question "你的问题在这里"

Query specific notebook

查询指定笔记本

python scripts/run.py ask_question.py --question "..." --notebook-id notebook-id
python scripts/run.py ask_question.py --question "..." --notebook-id 笔记本ID

Query with notebook URL directly

直接通过笔记本链接查询

python scripts/run.py ask_question.py --question "..." --notebook-url "https://..."
python scripts/run.py ask_question.py --question "..." --notebook-url "https://..."

Show browser for debugging

显示浏览器用于调试

python scripts/run.py ask_question.py --question "..." --show-browser
undefined
python scripts/run.py ask_question.py --question "..." --show-browser
undefined

Follow-Up Mechanism (CRITICAL)

追问机制(关键要求)

Every NotebookLM answer ends with: "EXTREMELY IMPORTANT: Is that ALL you need to know?"
Required Claude Behavior:
  1. STOP - Do not immediately respond to user
  2. ANALYZE - Compare answer to user's original request
  3. IDENTIFY GAPS - Determine if more information needed
  4. ASK FOLLOW-UP - If gaps exist, immediately ask:
    bash
    python scripts/run.py ask_question.py --question "Follow-up with context..."
  5. REPEAT - Continue until information is complete
  6. SYNTHESIZE - Combine all answers before responding to user
每个NotebookLM的回答都会以:"EXTREMELY IMPORTANT: Is that ALL you need to know?" 结尾
Claude必须遵循的行为规范:
  1. 停止 - 不要立即回复用户
  2. 分析 - 将返回的答案和用户的原始请求进行对比
  3. 识别差距 - 判断是否需要更多信息
  4. 发起追问 - 如果存在信息缺口,立即执行:
    bash
    python scripts/run.py ask_question.py --question "带上下文的追问内容..."
  5. 重复 - 持续追问直到获取完整信息
  6. 整合 - 回复用户前整合所有答案内容

Script Reference

脚本参考

Authentication Management (
auth_manager.py
)

认证管理(
auth_manager.py

bash
python scripts/run.py auth_manager.py setup    # Initial setup (browser visible)
python scripts/run.py auth_manager.py status   # Check authentication
python scripts/run.py auth_manager.py reauth   # Re-authenticate (browser visible)
python scripts/run.py auth_manager.py clear    # Clear authentication
bash
python scripts/run.py auth_manager.py setup    # 初始设置(浏览器可见)
python scripts/run.py auth_manager.py status   # 检查认证状态
python scripts/run.py auth_manager.py reauth   # 重新认证(浏览器可见)
python scripts/run.py auth_manager.py clear    # 清除认证信息

Notebook Management (
notebook_manager.py
)

笔记本管理(
notebook_manager.py

bash
python scripts/run.py notebook_manager.py add --url URL --name NAME --description DESC --topics TOPICS
python scripts/run.py notebook_manager.py list
python scripts/run.py notebook_manager.py search --query QUERY
python scripts/run.py notebook_manager.py activate --id ID
python scripts/run.py notebook_manager.py remove --id ID
python scripts/run.py notebook_manager.py stats
bash
python scripts/run.py notebook_manager.py add --url URL --name NAME --description DESC --topics TOPICS
python scripts/run.py notebook_manager.py list
python scripts/run.py notebook_manager.py search --query QUERY
python scripts/run.py notebook_manager.py activate --id ID
python scripts/run.py notebook_manager.py remove --id ID
python scripts/run.py notebook_manager.py stats

Question Interface (
ask_question.py
)

提问接口(
ask_question.py

bash
python scripts/run.py ask_question.py --question "..." [--notebook-id ID] [--notebook-url URL] [--show-browser]
bash
python scripts/run.py ask_question.py --question "..." [--notebook-id ID] [--notebook-url URL] [--show-browser]

Data Cleanup (
cleanup_manager.py
)

数据清理(
cleanup_manager.py

bash
python scripts/run.py cleanup_manager.py                    # Preview cleanup
python scripts/run.py cleanup_manager.py --confirm          # Execute cleanup
python scripts/run.py cleanup_manager.py --preserve-library # Keep notebooks
bash
python scripts/run.py cleanup_manager.py                    # 预览清理内容
python scripts/run.py cleanup_manager.py --confirm          # 执行清理
python scripts/run.py cleanup_manager.py --preserve-library # 保留笔记本库

Environment Management

环境管理

The virtual environment is automatically managed:
  • First run creates
    .venv
    automatically
  • Dependencies install automatically
  • Chromium browser installs automatically
  • Everything isolated in skill directory
Manual setup (only if automatic fails):
bash
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
pip install -r requirements.txt
python -m patchright install chromium
虚拟环境会自动管理:
  • 首次运行会自动创建
    .venv
  • 自动安装所有依赖
  • 自动安装Chromium浏览器
  • 所有内容都隔离在技能目录下
手动设置(仅自动安装失败时使用):
bash
python -m venv .venv
source .venv/bin/activate  # Linux/Mac系统
pip install -r requirements.txt
python -m patchright install chromium

Data Storage

数据存储

All data stored in
~/.claude/skills/notebooklm/data/
:
  • library.json
    - Notebook metadata
  • auth_info.json
    - Authentication status
  • browser_state/
    - Browser cookies and session
Security: Protected by
.gitignore
, never commit to git.
所有数据存储在
~/.claude/skills/notebooklm/data/
路径下:
  • library.json
    - 笔记本元数据
  • auth_info.json
    - 认证状态
  • browser_state/
    - 浏览器Cookie和会话信息
安全说明: 已通过
.gitignore
保护,永远不会提交到git。

Configuration

配置

Optional
.env
file in skill directory:
env
HEADLESS=false           # Browser visibility
SHOW_BROWSER=false       # Default browser display
STEALTH_ENABLED=true     # Human-like behavior
TYPING_WPM_MIN=160       # Typing speed
TYPING_WPM_MAX=240
DEFAULT_NOTEBOOK_ID=     # Default notebook
可在技能目录下添加可选的
.env
文件:
env
HEADLESS=false           # 浏览器可见性设置
SHOW_BROWSER=false       # 默认浏览器显示设置
STEALTH_ENABLED=true     # 模拟人类行为
TYPING_WPM_MIN=160       # 打字速度下限
TYPING_WPM_MAX=240
DEFAULT_NOTEBOOK_ID=     # 默认笔记本ID

Decision Flow

决策流程

User mentions NotebookLM
Check auth → python scripts/run.py auth_manager.py status
If not authenticated → python scripts/run.py auth_manager.py setup
Check/Add notebook → python scripts/run.py notebook_manager.py list/add (with --description)
Activate notebook → python scripts/run.py notebook_manager.py activate --id ID
Ask question → python scripts/run.py ask_question.py --question "..."
See "Is that ALL you need?" → Ask follow-ups until complete
Synthesize and respond to user
用户提到NotebookLM
检查认证 → python scripts/run.py auth_manager.py status
未认证 → python scripts/run.py auth_manager.py setup
检查/添加笔记本 → python scripts/run.py notebook_manager.py list/add(带--description参数)
激活笔记本 → python scripts/run.py notebook_manager.py activate --id ID
提问 → python scripts/run.py ask_question.py --question "..."
看到"Is that ALL you need?"提示 → 持续追问直到信息完整
整合答案后回复用户

Troubleshooting

故障排查

ProblemSolution
ModuleNotFoundErrorUse
run.py
wrapper
Authentication failsBrowser must be visible for setup! --show-browser
Rate limit (50/day)Wait or switch Google account
Browser crashes
python scripts/run.py cleanup_manager.py --preserve-library
Notebook not foundCheck with
notebook_manager.py list
问题解决方案
ModuleNotFoundError使用
run.py
封装脚本
认证失败认证设置过程中浏览器必须可见!添加--show-browser参数
速率限制(每天50次)等待后重试或切换Google账号
浏览器崩溃执行
python scripts/run.py cleanup_manager.py --preserve-library
找不到笔记本使用
notebook_manager.py list
命令检查

Best Practices

最佳实践

  1. Always use run.py - Handles environment automatically
  2. Check auth first - Before any operations
  3. Follow-up questions - Don't stop at first answer
  4. Browser visible for auth - Required for manual login
  5. Include context - Each question is independent
  6. Synthesize answers - Combine multiple responses
  1. 始终使用run.py - 自动处理环境配置
  2. 优先检查认证状态 - 执行任何操作前先确认认证
  3. 及时追问 - 不要停留在第一个答案
  4. 认证时保持浏览器可见 - 手动登录需要可见窗口
  5. 携带上下文 - 每个提问都是独立会话
  6. 整合答案 - 合并多轮返回结果再回复用户

Limitations

限制说明

  • No session persistence (each question = new browser)
  • Rate limits on free Google accounts (50 queries/day)
  • Manual upload required (user must add docs to NotebookLM)
  • Browser overhead (few seconds per question)
  • 无会话持久化(每次提问都是全新浏览器会话)
  • 免费Google账号有速率限制(每天最多50次查询)
  • 需要用户手动上传文档到NotebookLM
  • 浏览器有启动开销(每次提问需要几秒加载时间)

Resources (Skill Structure)

资源(技能结构)

Important directories and files:
  • scripts/
    - All automation scripts (ask_question.py, notebook_manager.py, etc.)
  • data/
    - Local storage for authentication and notebook library
  • references/
    - Extended documentation:
    • api_reference.md
      - Detailed API documentation for all scripts
    • troubleshooting.md
      - Common issues and solutions
    • usage_patterns.md
      - Best practices and workflow examples
  • .venv/
    - Isolated Python environment (auto-created on first run)
  • .gitignore
    - Protects sensitive data from being committed
重要目录和文件:
  • scripts/
    - 所有自动化脚本(ask_question.py、notebook_manager.py等)
  • data/
    - 认证信息和笔记本库的本地存储
  • references/
    - 扩展文档:
    • api_reference.md
      - 所有脚本的详细API文档
    • troubleshooting.md
      - 常见问题和解决方案
    • usage_patterns.md
      - 最佳实践和工作流示例
  • .venv/
    - 隔离Python虚拟环境(首次运行自动创建)
  • .gitignore
    - 防止敏感数据被提交到git