teng-lin/notebooklm-py

Unofficial Python API and agentic skill for Google Gemini Notebook. Full programmatic access to Gemini Notebook's features—including capabilities the web UI doesn't expose—via Python, CLI, and AI agents like Claude Code, Codex, and OpenClaw.

notebooklm-py

What it is – An unofficial Python client, CLI, and server for Google’s Gemini Notebook (formerly Notebook LM). It lets you program‑matically drive the notebook service – adding sources, asking questions, and generating a wide range of AI‑created artifacts (audio, video, slides, quizzes, flashcards, mind‑maps, etc.) – all from Python code, a command‑line tool, or via an MCP/REST server that LLM agents such as Claude Code or Codex can call.


Why it matters

  • Zero‑token research – Let Gemini do the heavy reading of dozens of documents, then only spend model tokens on the final polishing step.
  • Grounded memory for agents – A notebook acts as a persistent, citation‑backed knowledge base that agents can query instead of building their own vector store.
  • Bulk, scriptable exports – Download audio, video, PDFs, JSON quizzes, mind‑map trees, CSV tables, etc., in one command – something the web UI cannot do.
  • Agent‑ready skill – Ships a ready‑to‑install Claude Code skill (SKILL.md) so agents can invoke Notebook LM actions directly.

Core capabilities (as described in the README)

Area What you can do
Notebook management Create, copy, list, rename, delete notebooks; switch active notebook.
Source ingestion Add URLs, PDFs, Word, EPUB, audio/video, images, YouTube links, Google Drive files, or raw text. Supports bulk import and automatic refresh.
Chat / Q&A Ask Gemini‑powered questions against the notebook’s sources, keep conversation history, use custom personas, and save answers as notes.
Content generation Generate audio overviews, video overviews, slide decks (PDF/PPTX), infographics, quizzes, flashcards, reports, data tables (CSV), and mind‑maps (JSON).
Export / download Batch‑download any artifact type, choose formats (MP3, MP4, PNG, JSON, Markdown, HTML, CSV, PPTX).
Sharing & permissions Create public/private links, set viewer/editor rights.
Automation hooks CLI, Python API, MCP server (for Claude Code/Codex), and a lightweight REST server for headless scripts.
Back‑ends Default web‑RPC (batchexecute) and optional Android gRPC backend for token‑less auth via a master token.

Typical workflow (CLI example from the README)

# 1. Authenticate (browser or master‑token)
notebooklm login

# 2. Create a notebook and add material
notebooklm create "My Research"
notebooklm use <notebook_id>
notebooklm source add "https://en.wikipedia.org/wiki/Artificial_intelligence"
notebooklm source add "paper.pdf"

# 3. Ask a grounded question
notebooklm ask "What are the key themes?"

# 4. Generate an artifact (e.g., a podcast)
notebooklm generate audio "make it engaging" --wait

# 5. Download the result
notebooklm download audio ./podcast.m4a

The same steps can be performed from Python via NotebookLMClient or called by an LLM agent through the MCP/REST server.


Who would use it?

  • Researchers & writers who want to ingest many documents, let Gemini summarise them, and then export ready‑to‑publish media.
  • LLM‑agent developers (Claude Code, Codex, OpenClaw, etc.) needing a grounded knowledge base and a set of tool actions the agent can call.
  • Automation engineers building CI/CD pipelines, scheduled briefings, or incident‑runbook generators that require bulk content creation.
  • Power users who want batch downloads, custom formats, or integration with personal knowledge‑graph tools like Obsidian.

Limitations & cautions (as the README warns)

  • Unofficial & undocumented – It talks to Google’s internal APIs; they can change without notice.
  • Rate limits & quota – Heavy or automated usage may be throttled by Google.
  • Authentication complexity – Requires Playwright‑driven browser login or a master‑token; the Android backend needs a durable master token.
  • Not a replacement for a vector DB – While it provides grounded recall, it depends on Google’s service availability.

Quick start checklist

  1. Install the CLI (recommended via uv tool install "notebooklm-py[browser]" or pipx).
  2. Run notebooklm login (or master‑token login for headless use).
  3. Follow the CLI workflow above or import NotebookLMClient in Python.
  4. Optionally install the Claude Code skill with notebooklm skill install or npx skills add teng-lin/notebooklm-py.

All information is taken directly from the repository’s README; no additional features are inferred.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Project