Notebooklm
2026-03-27
新闻来源:网淘吧
围观:20
电脑广告
手机广告
NotebookLM 研究助理技能
与 Google NotebookLM 交互,通过 Gemini 的源文件溯源答案来查询文档。每个问题都会开启一个新的浏览器会话,仅从您上传的文档中检索答案,然后关闭。
何时使用此技能
当用户出现以下情况时触发:
- 明确提及 NotebookLM
- 分享 NotebookLM 链接 (
https://notebooklm.google.com/notebook/...) - 要求查询其笔记/文档
- 想要将文档添加到 NotebookLM 库
- 使用诸如“问我的 NotebookLM”、“检查我的文档”、“查询我的笔记”等短语
⚠️ 关键:添加命令 - 智能发现
当用户想要添加笔记但未提供详细信息时:
智能添加(推荐):首先查询笔记以发现其内容:
# 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]"
# 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]"
手动添加:如果用户提供了所有详细信息:
--url- NotebookLM 链接--名称- 一个描述性的名称--描述- 笔记本包含的内容(必填!)--主题- 逗号分隔的主题(必填!)
切勿猜测或使用通用描述!如果缺少详细信息,请使用“智能添加”来发现它们。
关键:始终使用 run.py 包装器
切勿直接调用脚本。始终使用python scripts/run.py [脚本]:
# ✅ CORRECT - Always use 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 "..."
# ❌ WRONG - Never call directly:
python scripts/auth_manager.py status # Fails without venv!
该run.py包装器会自动:
- 创建
.venv如果需要的话 - 安装所有依赖项
- 激活环境
- 正确执行脚本
核心工作流程
步骤 1:检查认证状态
python scripts/run.py auth_manager.py status
如果未认证,则进行设置。
步骤二:身份验证(一次性设置)
# Browser MUST be visible for manual Google login
python scripts/run.py auth_manager.py setup
重要提示:
- 身份验证期间浏览器需保持可见状态
- 浏览器窗口将自动打开
- 用户需手动登录Google账户
- 告知用户:“即将打开浏览器窗口进行Google登录”
步骤三:管理笔记库
# List all notebooks
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!
# Search notebooks by topic
python scripts/run.py notebook_manager.py search --query "keyword"
# Set active notebook
python scripts/run.py notebook_manager.py activate --id notebook-id
# Remove notebook
python scripts/run.py notebook_manager.py remove --id notebook-id
快速工作流程
- 查看笔记库:
python scripts/run.py notebook_manager.py list - 提问操作:
python scripts/run.py ask_question.py --question "..." --notebook-id ID
步骤四:提问功能
# Basic query (uses active notebook if set)
python scripts/run.py ask_question.py --question "Your question here"
# Query specific notebook
python scripts/run.py ask_question.py --question "..." --notebook-id notebook-id
# Query with notebook URL directly
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
后续追问机制(关键)
每个NotebookLM回答均以以下提示结尾:“至关重要:这是您需要了解的全部信息吗?”
Claude必需执行的操作:
- 立即停止- 切勿立即回复用户
- 进行分析- 将回答内容与用户原始请求进行比对
- 识别信息缺口- 确定是否需要更多信息
- 进行追问- 如果存在信息缺口,立即询问:
python scripts/run.py ask_question.py --question "Follow-up with context..." - 重复- 持续此过程直到信息完整
- 综合处理- 在回复用户前整合所有答案
脚本参考
认证管理 (auth_manager.py)
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
笔记本管理 (notebook_manager.py)
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
问题界面 (ask_question.py)
python scripts/run.py ask_question.py --question "..." [--notebook-id ID] [--notebook-url URL] [--show-browser]
数据清理 (cleanup_manager.py)
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
环境管理
虚拟环境自动管理:
- 首次运行创建
.venv自动 - 依赖项自动安装
- Chromium浏览器自动安装
- 所有内容隔离在技能目录中
手动设置(仅在自动设置失败时进行):
python -m venv .venv
source .venv/bin/activate # Linux/Mac
pip install -r requirements.txt
python -m patchright install chromium
数据存储
所有数据存储在~/.claude/skills/notebooklm/data/:
library.json- 笔记本元数据auth_info.json- 认证状态browser_state/- 浏览器Cookie和会话
安全性:受.gitignore保护,切勿提交到git。
配置
可选.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
决策流程
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
故障排除
| 问题 | 解决方案 |
|---|---|
| ModuleNotFoundError | 使用run.py包装器 |
| 身份验证失败 | 浏览器必须可见才能进行设置!--show-browser |
| 速率限制(50次/天) | 等待或切换谷歌账户 |
| 浏览器崩溃 | python scripts/run.py cleanup_manager.py --preserve-library |
| 未找到笔记本 | 使用以下命令检查notebook_manager.py list |
最佳实践
- 始终使用run.py- 自动处理环境
- 首先检查身份验证- 在任何操作之前
- 后续问题- 不要停留在第一个答案
- 浏览器可见以便认证- 手动登录所需
- 包含上下文- 每个问题相互独立
- 综合答案- 合并多个回复
限制
- 无会话持久性(每个问题 = 新浏览器)
- 免费谷歌账户的速率限制(50次查询/天)
- 需要手动上传(用户必须将文档添加到NotebookLM)
- 浏览器开销(每个问题几秒钟)
资源(技能结构)
重要目录和文件:
scripts/- 所有自动化脚本(ask_question.py、notebook_manager.py等)data/- 用于认证和笔记本库的本地存储references/- 扩展文档:api_reference.md- 所有脚本的详细API文档故障排除.md- 常见问题及解决方案使用模式.md- 最佳实践与工作流示例
.venv/- 隔离的Python环境(首次运行时自动创建).gitignore- 防止敏感数据被提交
文章底部电脑广告
手机广告位-内容正文底部
上一篇:Google Search Console
下一篇:Daily Ai News


微信扫一扫,打赏作者吧~