# bhupesh-debug/notebooklm-py architecture

> Architecture diagram of the GitHub repository bhupesh-debug/notebooklm-py, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhupesh-debug/notebooklm-py
- Repository: https://github.com/bhupesh-debug/notebooklm-py

## Overview

notebooklm-py is an unofficial Python client and automation interface for Google NotebookLM, exposed through a Python API, CLI, MCP agent server, and local REST server. A typical workflow authenticates, creates or selects a notebook, imports sources, asks grounded questions or runs research, then generates and downloads artifacts. The graph preserves these documented capabilities and highlights the shared client, authentication, and Web transport layers. Some domain implementations were not sampled, so documented features are included but uncertain internal call links are omitted.

Main entry points: [`src/notebooklm/client.py`](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/client.py) (NotebookLM client), [`src/notebooklm/cli`](https://github.com/bhupesh-debug/notebooklm-py/tree/main/src/notebooklm/cli) (CLI), [`src/notebooklm/mcp/server.py`](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/mcp/server.py) (MCP server), [`src/notebooklm/server/app.py`](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/server/app.py) (REST server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI"]
  node_python["Python API<br/>[client.py]"]
  node_mcp["MCP server<br/>[server.py]"]
  node_rest["REST server<br/>[app.py]"]
end

subgraph group_client["Client runtime"]
  node_client["NotebookLM client<br/>[client.py]"]
  node_transport["Web transport"]
  node_types["Public data types<br/>[types.py]"]
end

subgraph group_domain["Notebook operations"]
  node_notebooks["Notebook management<br/>[_notebooks.py]"]
  node_sources["Source import and research<br/>[_sources.py]"]
  node_chat["Grounded chat<br/>[_chat.py]"]
  node_generation["Artifact generation<br/>[_artifacts.py]"]
  node_downloads["Artifact downloads<br/>[downloads.py]"]
end

subgraph group_auth["Authentication"]
  node_auth["Authentication facade<br/>[auth.py]"]
  node_profiles["Profile admission<br/>[web_profiles.py]"]
  node_authstorage[("Credential persistence<br/>[storage.py]")]
end

node_user(("User or agent"))
node_google(("Google NotebookLM"))

node_user -->|"runs commands"| node_cli
node_user -->|"calls API"| node_python
node_user -->|"uses agent tools"| node_mcp
node_user -->|"uses REST"| node_rest
node_cli -.->|"automates NotebookLM"| node_client
node_python -->|"constructs client"| node_client
node_mcp -->|"provides client"| node_client
node_rest -->|"provides client"| node_client
node_client -.->|"uses transport"| node_transport
node_client -->|"uses credentials"| node_auth
node_auth -->|"reads and writes"| node_authstorage
node_profiles -->|"checks profile state"| node_authstorage
node_client -->|"exposes operations"| node_notebooks
node_client -->|"exposes operations"| node_sources
node_client -->|"exposes operations"| node_chat
node_client -->|"exposes operations"| node_generation
node_client -.->|"exposes downloads"| node_downloads
node_client -->|"uses data types"| node_types
node_transport -.->|"sends requests"| node_google
node_sources -->|"imports and researches"| node_google
node_chat -->|"queries sources"| node_google
node_generation -->|"generates media"| node_google
node_downloads -->|"exports artifacts"| node_user

click node_cli "https://github.com/bhupesh-debug/notebooklm-py/tree/main/src/notebooklm/cli"
click node_python "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/client.py"
click node_mcp "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/mcp/server.py"
click node_rest "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/server/app.py"
click node_client "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/client.py"
click node_transport "https://github.com/bhupesh-debug/notebooklm-py/tree/main/src/notebooklm/_web/transport"
click node_types "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/types.py"
click node_auth "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/auth.py"
click node_profiles "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_app/web_profiles.py"
click node_authstorage "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_auth/storage.py"
click node_notebooks "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_notebooks.py"
click node_sources "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_sources.py"
click node_chat "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_chat.py"
click node_generation "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_artifacts.py"
click node_downloads "https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/downloads.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_python,node_mcp,node_rest,node_user toneBlue
class node_client,node_transport,node_types toneAmber
class node_notebooks,node_sources,node_chat,node_generation,node_downloads toneMint
class node_auth,node_profiles,node_authstorage toneRose
class node_google toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/bhupesh-debug/notebooklm-py/tree/main/src/notebooklm/cli): `src/notebooklm/cli`
- [Python API](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/client.py): `src/notebooklm/client.py`
- [MCP server](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/mcp/server.py): `src/notebooklm/mcp/server.py`
- [REST server](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/server/app.py): `src/notebooklm/server/app.py`

### Client runtime

- [NotebookLM client](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/client.py): `src/notebooklm/client.py`
- [Web transport](https://github.com/bhupesh-debug/notebooklm-py/tree/main/src/notebooklm/_web/transport): `src/notebooklm/_web/transport`
- [Public data types](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/types.py): `src/notebooklm/types.py`

### Notebook operations

- [Notebook management](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_notebooks.py): `src/notebooklm/_notebooks.py`
- [Source import and research](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_sources.py): `src/notebooklm/_sources.py`
- [Grounded chat](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_chat.py): `src/notebooklm/_chat.py`
- [Artifact generation](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_artifacts.py): `src/notebooklm/_artifacts.py`
- [Artifact downloads](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/downloads.py): `src/notebooklm/downloads.py`

### Authentication

- [Authentication facade](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/auth.py): `src/notebooklm/auth.py`
- [Profile admission](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_app/web_profiles.py): `src/notebooklm/_app/web_profiles.py`
- [Credential persistence](https://github.com/bhupesh-debug/notebooklm-py/blob/main/src/notebooklm/_auth/storage.py): `src/notebooklm/_auth/storage.py`

### Other components

- **User or agent**
- **Google NotebookLM**

## Connections

- User or agent → CLI: runs commands (evidence: `README.md`)
- User or agent → Python API: calls API (evidence: `README.md`)
- User or agent → MCP server: uses agent tools (evidence: `README.md`)
- User or agent → REST server: uses REST (evidence: `README.md`)
- CLI → NotebookLM client: automates NotebookLM
- Python API → NotebookLM client: constructs client (evidence: `src/notebooklm/client.py`)
- MCP server → NotebookLM client: provides client (evidence: `src/notebooklm/mcp/server.py`)
- REST server → NotebookLM client: provides client (evidence: `src/notebooklm/server/app.py`)
- NotebookLM client → Web transport: uses transport
- NotebookLM client → Authentication facade: uses credentials (evidence: `src/notebooklm/client.py`)
- Authentication facade → Credential persistence: reads and writes (evidence: `src/notebooklm/auth.py`)
- Profile admission → Credential persistence: checks profile state (evidence: `src/notebooklm/_app/web_profiles.py`)
- NotebookLM client → Notebook management: exposes operations (evidence: `src/notebooklm/client.py`)
- NotebookLM client → Source import and research: exposes operations (evidence: `src/notebooklm/client.py`)
- NotebookLM client → Grounded chat: exposes operations (evidence: `src/notebooklm/client.py`)
- NotebookLM client → Artifact generation: exposes operations (evidence: `src/notebooklm/client.py`)
- NotebookLM client → Artifact downloads: exposes downloads
- NotebookLM client → Public data types: uses data types (evidence: `src/notebooklm/client.py`)
- Web transport → Google NotebookLM: sends requests
- Source import and research → Google NotebookLM: imports and researches (evidence: `README.md`)
- Grounded chat → Google NotebookLM: queries sources (evidence: `README.md`)
- Artifact generation → Google NotebookLM: generates media (evidence: `README.md`)
- Artifact downloads → User or agent: exports artifacts (evidence: `README.md`)
