Documentation Index
Fetch the complete documentation index at: https://mintlify.com/teng-lin/notebooklm-py/llms.txt
Use this file to discover all available pages before exploring further.
client.research gives you programmatic access to NotebookLM’s research agents. You start a research session with a natural-language query, poll until results are ready, and then selectively import the discovered web pages or Drive documents as notebook sources. The web agent supports both a fast mode and a deep-research mode for more thorough exploration.
Methods
start(notebook_id, query, source, mode)
Starts a new research session and returns immediately with a task ID for polling.
The notebook ID to associate research with.
Natural language research question or topic.
Data source to search. Valid values:
"web" or "drive".Research depth.
"fast" for a quick search; "deep" for a thorough multi-step investigation. Deep mode is only available when source="web".Dict with keys:
task_id (str), report_id (str), notebook_id (str), query (str), mode (str).ValueError when an invalid source/mode combination is used (e.g. source="drive" with mode="deep").
- Fast web research
- Deep web research
- Drive research
Google Drive research is always performed in fast mode. Passing
mode="deep" with source="drive" raises a ValueError.poll(notebook_id)
Checks the status of the most recent research session for a notebook.
The notebook ID.
Dict with keys:
task_id(str) — the research task IDstatus(str) —"completed","in_progress", or"no_research"query(str) — the original querysources(list) — discovered sources, each a dict withurlandtitlesummary(str) — brief AI-generated summary of findings
import_sources(notebook_id, task_id, sources)
Imports a selection of sources discovered during a research session into the notebook.
The notebook ID.
The
task_id from start() or poll().List of source dicts to import. Each dict must have
url (str) and title (str) keys — these come from the sources list returned by poll().List of imported source records, each containing
id and title.Polling loop example
The most common pattern is to start research, poll in a loop, and import once complete:Non-blocking pattern
If you want to start research and do other work while it runs, useasyncio.sleep() inside a non-blocking loop:
Source and mode reference
source | Valid mode values | Notes |
|---|---|---|
"web" | "fast" · "deep" | Default. Deep mode performs multi-step searching. |
"drive" | "fast" | Drive research always uses fast mode. |
poll() return structure
| Field | Type | Description |
|---|---|---|
task_id | str | Task identifier from start() |
status | str | "completed" · "in_progress" · "no_research" |
query | str | The original research query |
sources | list[dict] | Each dict has url and title |
summary | str | AI-generated summary of the research findings |