NotebookLM Python Automation
Automate Gemini Notebook research, generation, and exports through Python, CLI, or coding agents.
The evidence shows a small base dependency set, optional extras for broader surfaces, read-only contents permissions, commit-pinned workflow actions, and an actor-plus-keyword trigger restricted to a trusted account. The security policy documents credential locations, POSIX modes, in-memory CI authentication, compromise recovery, and concrete dependency-audit commands, supporting full scores for sensitive-data handling, dependency security, and attribution. Deductions apply because the product can upload local files, extract browser cookies, create or delete notebooks and sources, change sharing permissions, and export to Google services, while the supplied files do not demonstrate per-operation confirmation for destructive or externally visible actions. Google/NotebookLM data transfer is disclosed but end-to-end retention is not, and rollback is largely limited to credential revocation.
The README, package metadata, security policy, and CLI contract-baseline code are mutually consistent and place structured controls around commands, aliases, versions, and supported releases. Dependency availability is reduced by reliance on undocumented Google APIs that may change without notice, plus optional dependencies with noted compatibility problems or a required last-known-good pin. Authentication checks, doctor commands, troubleshooting references, and a specific Linux workaround provide useful failure guidance, but implementation-level messages and a comprehensive failure taxonomy are not included.
The material addresses CLI users, Python developers, agents, MCP and REST integrations, headless servers, CI/CD, multiple accounts, supported Python versions, and platform-specific installation choices. Boundaries are explicit: the library is unofficial and beta, uses internal APIs, and is subject to rate limits, account tiers, and breakage. Trigger precision is not fully evidenced because SKILL.md itself is absent, preventing review of natural-language activation, false-positive avoidance, or agent confirmation rules; only the precise CLI tree and tightly gated repository workflow support a moderate score.
Information architecture, feature matrices, quick starts, API and CLI examples, installation alternatives, optional-extra guidance, and topical documentation links are extensive. The retained package name after the NotebookLM rebrand, frozen CLI contracts, stability references, and migration guide support naming stability. Limitations, security warnings, and the complete MIT license are explicit. Versioning is deducted because the referenced changelog, stability policy, and release guide were not supplied for inspection. A named author, email, vulnerability route, and supported-version policy establish responsibility, but team governance, response targets, and succession are unspecified, while publisher identity remains unknown under the stated provenance rule.
Python, CLI, MCP, and REST interfaces plus batch exports in MP3, MP4, PDF, PPTX, PNG, CSV, JSON, Markdown, and HTML make outputs directly usable in scripts and downstream tools. The programmatic and bulk capabilities provide substantial marginal value over a manual web workflow. Cost-benefit is not fully established: the 'zero-token' framing moves computation to an external service, and practical costs include a Google account, browser download, authentication upkeep, quotas, throttling, network dependence, and undocumented-API breakage, none of which are quantitatively compared.
Core claims are traceable to command examples, project metadata, dependency declarations, the security policy, and CLI contract introspection, with multiple supplied files corroborating versions, dependencies, entry points, and risk disclosures. Deductions apply because many claims about complete coverage, web-UI-exclusive capabilities, community outcomes, and savings occur only in the README; the corresponding implementation, linked documentation, test outcomes, and external materials were not supplied. The unofficial status and known risks are separated clearly, but promotional examples and inferred benefits remain partly mixed with directly evidenced facts.
- The library relies on undocumented Google internal APIs; endpoints, authentication flows, or account restrictions may change without warning even if this repository does not.
- Local authentication files contain Google session cookies capable of impersonating the user to NotebookLM. Keep owner-only permissions, never commit them, and use a secret manager for CI credentials.
- Browser-cookie import, master tokens, remote MCP, and the REST server enlarge the credential and network attack surface. Enable only required extras and protect remote endpoints with authentication and a trusted tunnel.
- Create, delete, upload, sharing, and export operations have Google-side or local external effects. Unattended agents should add explicit confirmation, allowlists, quota controls, and audit logging.
- Claims of complete coverage, zero-token operation, and community outcomes in the README were not independently substantiated by the supplied implementation or test results.
What does this agent do, and when should you use it?
notebooklm-py is an unofficial Python API and agent skill for Google Gemini Notebook, formerly NotebookLM. It packages an asynchronous Python SDK, a CLI, an MCP server, an experimental local REST server, and integration paths for Claude Code, Codex, and OpenClaw. Using undocumented Google APIs, it manages notebooks and sources, runs cited question answering, and requests server-side generation of audio, video, slides, quizzes, flashcards, reports, infographics, data tables, and mind maps. Depending on the artifact, outputs can be downloaded in MP3, MP4, PDF, PPTX, PNG, CSV, JSON, Markdown, or HTML, including batch exports not offered by the web workflow. It fits teams that need repeatable research pipelines or agent-accessible knowledge bases, provided they accept Google account dependencies, quotas, and the breakage risk of an unofficial interface.
A typical workflow authenticates a Google session with notebooklm login, creates a notebook through notebooklm create, and ingests URLs, YouTube pages, PDFs, text, Markdown, Word, EPUB, audio, video, images, Google Drive items, or pasted text with notebooklm source add. notebooklm ask then returns answers grounded in the imported sources with citations, while source add-research can run fast or deep web and Drive research and import its findings. The notebooklm generate command creates audio overviews, videos, slide decks, quizzes, flashcards, reports, infographics, data tables, and interactive or note-backed mind maps. notebooklm download saves those artifacts locally and can retrieve every artifact of a selected type. Python applications use the asynchronous NotebookLMClient.from_storage() client and its notebooks, sources, chat, artifacts, and mind_maps interfaces. Agent deployments can expose the same service through stdio MCP, a self-hosted remote MCP connector, or an experimental localhost FastAPI REST server.
- A researcher imports a large collection of webpages, PDFs, YouTube material, and Drive documents, delegates synthesis to Gemini Notebook, and collects the results with a repeatable script.
- A Claude Code or Codex user exposes internal documentation, RFCs, and architecture notes as a cited project knowledge base that the coding agent can query before making changes.
- A content team turns one curated source set into podcasts, videos, slide decks, blog drafts, quizzes, and flashcards, then downloads each deliverable in bulk.
- An instructor or learner builds notebooks by subject and generates study guides, audio lessons, quizzes, flashcards, and mind maps for each topic.
- An operations team assembles relevant documentation after an alert, asks targeted diagnostic questions, and generates a downloadable briefing document as an incident runbook.
- A user combines master-token authentication,
auth refresh --quiet, and a scheduler to produce recurring personalized audio briefings without an interactive browser session.
What are this agent's strengths and limitations?
- It covers the documented notebook, source, chat, note, research, sharing, and Studio artifact operations through Python, CLI, MCP, and REST entry points.
- It adds automation-oriented operations beyond ordinary web interaction, including batch artifact downloads, source full-text retrieval, programmatic permissions, and saving an entire conversation as a note.
- Exports are unusually broad: quizzes and flashcards in JSON, Markdown, or HTML; data tables in CSV; mind maps in JSON; and slide decks in PDF or PPTX.
- Interactive browser login, existing-browser cookies, durable master tokens, and multiple account profiles support both desktop and unattended deployments.
- The repository documents direct workflows for Claude Code, Codex, OpenClaw, Claude.ai, and ChatGPT connectors.
- It is an unofficial client built on undocumented Google APIs, so endpoint changes can break it without notice.
- The core research, Q&A, and generation functions remain tied to Google Gemini Notebook, an eligible Google account, and network availability.
- Google rate limits and account-tier quotas constrain heavy automation and per-notebook source counts; large jobs may need pacing and notebook partitioning.
- The default authentication path adds Playwright and an approximately 170 MB Chromium download; headless systems require master-token or cookie-management setup.
- Remote MCP access requires operators to host and secure a connector through infrastructure such as a Cloudflare or Tailscale tunnel, and ChatGPT connectors are web-only.
How do you install or deploy this agent?
Use Python 3.10–3.14 and a Google account that can access Gemini Notebook. For the CLI and agent workflows, install an isolated tool environment and authenticate:
uv tool install "notebooklm-py[browser]"
notebooklm login
notebooklm auth check --test --jsonpipx install "notebooklm-py[browser]" is also documented. The default login downloads roughly 170 MB of Chromium and opens Google sign-in; alternatively, import cookies from an authenticated Chrome profile or configure a master token. For library-only use without Playwright or Chromium, run uv add notebooklm-py. Install the bundled agent skill with notebooklm skill install, or fetch the canonical skill with npx skills add teng-lin/notebooklm-py.
How do you use this agent?
After authentication, this is a minimal CLI workflow:
notebooklm create "My Research"
notebooklm use <notebook_id>
notebooklm source add "https://en.wikipedia.org/wiki/Artificial_intelligence"
notebooklm source add "./paper.pdf"
notebooklm ask "What are the key themes?"
notebooklm generate audio "make it engaging" --wait
notebooklm download audio ./podcast.m4aIn Python, open async with NotebookLMClient.from_storage() as client, then call methods such as client.notebooks.create(), client.sources.add_url(), client.chat.ask(), and client.artifacts.generate_audio(). For remote agent access, self-host the MCP connector behind a Cloudflare or Tailscale tunnel. ChatGPT requires its web-based Developer Mode for this connector, while Claude.ai can also reach a configured connector from its mobile application.
How does this agent compare with similar options?
Compared with the Gemini Notebook web interface, notebooklm-py emphasizes scripted control and local extraction. It supports batch downloads, structured quiz and flashcard exports, mind-map JSON, CSV data tables, source full text, individual slide revision, and programmatic sharing. That additional reach comes with greater maintenance risk because the client relies on undocumented endpoints rather than an official Google SDK.
FAQ
Is this an official Google SDK?
What credentials are required?
Can it run fully offline or independently of Google?
What happens when authentication expires or requests are throttled?
notebooklm auth check --test and auth refresh --quiet for diagnosis and cookie maintenance. The project also warns that heavy usage may be throttled, so automated workloads may require slower pacing or multiple notebooks.