What is notebooklm-py?
notebooklm-py gives programmatic access to Google's Gemini Notebook — the product formerly called NotebookLM — through a Python API, a `notebooklm` CLI, an MCP server and a local REST server. It sits in the Notes & Knowledge Bases category of the AI Productivity & Writing tools and is open-source, written in Python and licensed MIT.
Overview
notebooklm-py gives programmatic access to Google's Gemini Notebook — the product formerly called NotebookLM — through a Python API, a `notebooklm` CLI, an MCP server and a local REST server. Google rebranded the product in July 2026; the service and this library are unchanged, and the package kept its original name.
The appeal for agent builders is that a notebook is a grounded engine: Gemini reads your sources and answers from them with citations, on Google's infrastructure. That makes it usable as a synthesis and memory layer an agent drives in a loop — bulk-import a corpus, ask questions against it, and spend your own model's tokens only on the final step. It also covers the reverse direction, pulling artifacts back out in bulk: mind maps as JSON, quizzes and flashcards as JSON, Markdown or HTML, data tables as CSV, slide decks as PDF or PPTX.
Coverage is deliberately complete rather than a thin wrapper. Notebooks, sources, chat, notes, source labels, research agents and sharing all have typed namespaces, and every generated artifact type is supported — audio overviews, video overviews, slide decks, infographics, quizzes, flashcards, reports, data tables and mind maps. Several capabilities have no equivalent in the web UI, including batch downloads, quiz and flashcard export, mind-map JSON extraction and saving a whole chat history as a note. Two authentication backends exist: the default web transport and an opt-in Android gRPC backend for unattended servers. This is an unofficial library built on undocumented Google endpoints, so the maintainers position it for prototypes, research and personal projects.
What it does
- Full API coverage — notebooks, sources, chat, notes, source labels, web and Drive research agents, and sharing
- Every artifact type generated and downloaded: audio and video overviews, slide decks, infographics, quizzes, flashcards, reports, data tables and mind maps
- Capabilities the web UI does not expose: batch downloads, quiz and flashcard export, mind-map JSON, CSV data tables and per-slide revision
- Four surfaces — Python API, CLI, MCP server (local stdio or a self-hosted remote connector) and a local REST server
- Master-token auth mints fresh cookies on demand, so headless servers, CI and remote MCP connectors self-heal expired sessions
- Ships an agent skill installable with `notebooklm skill install` or `npx skills add`, plus multi-account profiles
Getting started
Install the CLI into its own isolated environment with uv or pipx — this avoids the externally-managed-environment error on modern macOS and Debian/Ubuntu. Embedding it as a library needs neither Playwright nor Chromium.
Install the CLI and sign in
The first run downloads Chromium (~170 MB) and opens a Google sign-in.
uv tool install "notebooklm-py[browser]" # or: pipx install "notebooklm-py[browser]"
notebooklm login
notebooklm auth check --test --json # expect "status": "ok"Or add it as a library
No browser dependency when you only use the Python API with stored credentials.
uv add notebooklm-py # or, inside a virtualenv: pip install notebooklm-pyCreate a notebook, add sources, ask
Sources can be URLs, local files, YouTube links or Google Drive documents.
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?"Generate and download artifacts
`--wait` blocks until generation finishes; downloads write straight to local files.
notebooklm generate audio "make it engaging" --wait
notebooklm generate quiz --difficulty hard
notebooklm download quiz --format markdown ./quiz.md
notebooklm download mind-map ./mindmap.jsonFrom Python
The client is async and loads credentials written by `notebooklm login`.
import asyncio
from notebooklm import NotebookLMClient
async def main():
async with NotebookLMClient.from_storage() as client:
nb = await client.notebooks.create("Research")
await client.sources.add_url(nb.id, "https://example.com", wait=True)
result = await client.chat.ask(nb.id, "Summarize this")
print(result.answer)
asyncio.run(main())Install the agent skill
Adds a NotebookLM skill to Claude Code and `.agents` skill directories.
notebooklm skill install
# or via the open skills ecosystem
npx skills add teng-lin/notebooklm-pyCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Offload analysis of a large document set to Gemini Notebook and have your own agent spend tokens only on the final answer
- Give a coding agent a grounded, cited knowledge base of your internal docs without standing up a vector database
- Batch-export quizzes, flashcards, mind maps and data tables into a repo, Anki or an Obsidian vault
- Run scheduled audio briefings or automated runbook generation from a headless server using master-token auth
How notebooklm-py compares
notebooklm-py alongside other open-source notes & knowledge bases tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| SiYuan | ★ 47k | A self-hosted, block-level knowledge base with Markdown WYSIWYG editing, SQL queries over blocks, spaced-repetition flashcards and AI writing and Q&A through an OpenAI-compatible API. |
| notebooklm-py | ★ 20.1k | Drive Google's Gemini Notebook from Python, a CLI or an agent |
| MineContext | ★ 5.5k | Local-first desktop app that captures and understands your screen context, then proactively delivers summaries, to-do lists and activity records. |
| Smart Connections | ★ 5.5k | Obsidian plugin that surfaces semantically related notes and excerpts as you write, using a bundled local embedding model that needs no API key and works offline and on mobile. |
| OpenKnowledge | ★ 4.8k | A local-first WYSIWYG markdown IDE and LLM wiki that keeps a knowledge base as plain files in git and exposes it to Claude, Codex and OpenCode over MCP. |
| ReadAny | ★ 2.9k | A local-first e-book reader for desktop and mobile that indexes your library into a local vector store, then answers questions about a book with hybrid vector + BM25 retrieval, alongside highlights, notes, TTS and WebDAV sync. |
| LLM Wiki Compiler | ★ 2.2k | CLI, MCP server and TypeScript SDK (llmwiki) that compiles raw sources into an interlinked, citation-traceable markdown wiki for people and agents. |
| LLM Wiki | ★ 1.7k | An open-source take on Karpathy's LLM Wiki that has Claude compile your documents, web clips and highlights into a cited, cross-linked Markdown wiki over MCP, with a web app, graph viewer and Chrome clipper. |
