NotebookLM-py
π Description
teng-lin/notebooklm-py β an unofficial Python API + CLI + MCP server + agent skill for Google NotebookLM, giving programmatic access to features the web UI doesnβt expose. Uses undocumented Google endpoints β use at your own risk: not affiliated with Google, APIs can break without notice, rate limits apply. Best for prototypes, research, personal projects.
The core idea: NotebookLM is a grounded engine β Gemini reads your sources and answers with citations. Let it do the expensive server-side reasoning while your agent (Claude Code, Codex, β¦) orchestrates and handles the final mile. A zero-token synthesis + memory layer an agent drives in a loop, plus bulk structured export out.
π§© Ways to use
| Method | Best for |
|---|---|
| CLI | shell scripts, quick tasks, CI/CD |
| Python API | app integration, async pipelines |
| MCP server | Claude Desktop/Code, Codex β local stdio or self-hosted remote connector (Cloudflare/Tailscale tunnel β claude.ai + ChatGPT, mobile included) |
| REST server | local automation over guarded HTTP routes |
| Agent skill | notebooklm skill install β ~/.claude/skills, ~/.agents/skills; or npx skills add teng-lin/notebooklm-py |
π§© What it covers
- Sources β bulk import URLs, YouTube, PDFs/Word/EPUB/audio/video/images, Google Drive, pasted text; web/Drive research agents (fast/deep) with auto-import
- Chat β cited Q&A (
ask --json), personas, save answers/history as notes - Generation β Audio Overview (podcast), video, slide deck, infographic, quiz, flashcards, report, data table, mind map
- Beyond the web UI β batch downloads, quiz/flashcard export (JSON/MD/HTML), mind-map JSON extraction, data-table CSV, slide deck PPTX/PDF + per-slide revision, programmatic sharing
- Auth β interactive Playwright login, import cookies from a signed-in browser, or a durable master token that self-heals expired sessions unattended (servers, CI, remote MCP)
Reasoning for
The recipe worth stealing: knowledge distillation β permanent skill β run Deep Research or load a doc corpus, let Gemini condense it, bake the result into a SKILL.md the agent loads at startup (build once, reuse with zero runtime tokens). Related patterns: a βMaster Brainβ notebook as persistent cross-session memory queried from CLAUDE.md; a source-grounded troubleshooting oracle over a fast-moving toolβs docs; and Obsidian sync β run the CLI from the vault root so reports/mind-map JSON/transcripts land as files, with community skills resolving NotebookLM citations into [[wikilinks]].
Install: uv tool install "notebooklm-py[browser]" then notebooklm login (auto-downloads Chromium). On Windows plain pip install also works (not externally-managed).
Alternatives considered
- Open Notebook β self-hostable open-source NotebookLM clone (own inference, runs local via Ollama). NotebookLM-py is the opposite tack: drive the real hosted NotebookLM via undocumented APIs. Clone = own your stack; py = Geminiβs quality + features, at API-break risk.
- Standing up your own vector DB + embedding pipeline β the zero-infra alternative NotebookLM-pyβs grounded-memory recipe replaces
- Manual clicking in the NotebookLM web app β no batch, no scriptable export, no mind-map JSON
π Links
- Repo: https://github.com/teng-lin/notebooklm-py
- Docs: CLI Reference Β· Python API Β· MCP Guide
- Walkthroughs: Claude Code + NotebookLM (video)
π Related notes
- Open Notebook β self-hosted NotebookLM clone (the inverse approach)
- Agent Skills β the skill packaging it ships as
- LLM Knowledge Bases β the distill-to-skill / grounded-memory pattern
- Obsidian β the knowledge-graph-sync recipe target
- Second Brain Design β PKM system this can feed
- Extending Claude Code β Tools for Its Blind Spots β compiled article featuring this tool
Template: tool