notebooklm

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

NotebookLM Research Assistant Skill

NotebookLM 研究助手Skill

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

何时使用该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

Step 1: Query the notebook about its content

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

Step 2: Use the discovered information to add it

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 "[Based on content]" --description "[Based on content]" --topics "[Based on content]"

**手动添加**:如果用户提供了所有详细信息:
- `--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 [script]
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 notebook-id

Remove notebook

删除笔记本

python scripts/run.py notebook_manager.py remove --id notebook-id
undefined
python scripts/run.py notebook_manager.py remove --id notebook-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 notebook-id

Query with notebook URL directly

直接通过NotebookLM链接查询

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的答案结尾都要加上:“非常重要:这就是你需要的全部信息吗?”
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浏览器
  • 所有内容都隔离在Skill目录中
手动设置(仅当自动设置失败时使用):
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
可在Skill目录中创建可选的
.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 "..."
显示“这就是你需要的全部信息吗?” → 持续跟进直到信息完整
整合答案并回复用户

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)

资源(Skill结构)

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
    - 保护敏感数据不被提交到仓库