Did you think AI assistants just needed a button click? You haven’t seen the backend frantically adjusting APIs.
Brothers, sisters, workers, tech enthusiasts, AI players—have you ever had this experience:
You just typed a sentence in Google’s NotebookLM, and in three seconds it summarizes a well-structured, logically sound mini-paper complete with references. Just as you’re about to take a screenshot to show off, you suddenly realize one thing:
“Can this thing be automated? I have to handle 50 documents a day, and my hand is cramping from clicking!”
Don’t worry, in 2025, we no longer need to rely on “manual clicks” to navigate AI tools.
This September, Google finally made a big move—launching the NotebookLM Enterprise API, allowing enterprise users to programmatically access this powerful AI summarization and knowledge management tool.
But here’s the catch: the official documentation only provides a cold REST API interface, and there are hardly any SDKs available. Want to write a script to automatically import PDFs, generate summaries, and push them to Slack? Sorry, you’re on your own with <span>curl</span> commands.
At this moment, a mysterious developer (GitHub ID: K-dash) quietly launched a project—nblm-rs.
The name sounds like a new type of alloy, but it is actually the most complete, reliable, fastest, and easiest unofficial NotebookLM Enterprise API client, primarily written in Rust, and it provides both a command-line tool and a Python SDK.
In summary:
It allows you to turn NotebookLM into your fully automated knowledge pipeline with just one command or a few lines of code.
Don’t believe it? Today, let’s dive deep into this treasure project and see how it transforms the “high-end” enterprise-level AI interface into a “down-to-earth” productivity tool.
Why do we need nblm-rs? Because the native API is too user-unfriendly!
Let’s get straight to the point:Directly calling the NotebookLM REST API is like writing a WeChat mini-program in assembly language—technically feasible, but practically a nightmare.
Don’t believe me? Let me walk you through the native process, and you’ll understand.
Want to call an API? First, get the OAuth token sorted out.
To access Google’s enterprise services, the first step is authentication. And Google’s OAuth process… well, how should I put it, it’s as complicated as teaching you to get a driver’s license.
You need to:
- Register an application
- Download the JSON key file
- Set environment variables
- Call
<span>gcloud auth login</span>or manually obtain an access token - Handle token expiration and refresh mechanisms
- Store credentials while considering security issues…
One small mistake, and you’ll receive this error:
401 Unauthorized: Request had invalid authentication credentials.
Then you start flipping through documentation, checking Stack Overflow, and questioning your life choices.
Meanwhile, nblm-rs directly integrates the <span>gcloud</span> CLI, so as long as you’ve run <span>gcloud auth login</span> locally, it can automatically read and cache valid tokens, refreshing them when they expire.
In short:You don’t have to worry about authentication; it takes care of it for you.
Constructing requests? Writing JSON will make you question your existence.
Suppose you want to create a notebook; the native API requires you to send a POST request with a body that looks like this:
{
"notebook": {
"title": "My Annual Report",
"createTime": "2025-10-25T10:00:00Z"
},
"parent": "projects/123456789/locations/global"
}
You also have to remember the resource name format: <span>projects/{project_number}/locations/{location}</span><span>, missing even one slash will result in an error.</span>
However, in the nblm-rs CLI, you only need to type this:
nblm notebooks create --title "My Annual Report"
It will automatically complete the parent path, set the timestamp, construct the correct JSON, and even help you validate parameter types.
Isn’t that much more comfortable?
Abstract error messages? nblm-rs gives you “human-readable” hints.
The native API often returns errors like this:
{
"error": {
"code": 400,
"message": "Invalid resource name format.",
"status": "INVALID_ARGUMENT"
}
}
Translated, it means: “You made a mistake, but I can’t be bothered to tell you where.”
In contrast, nblm-rs will tell you:
❌ Parameter error:
<span>--notebook-id</span><span> format should be </span><code><span>projects/123/locations/global/notebooks/abc</span><span>, but you provided </span><code><span>abc</span><span>. It is recommended to use </span><code><span>nblm notebooks list</span><span> to view valid IDs.</span>
Even better, it automatically retries for temporary failures like network jitter and rate limiting, so you don’t have to write <span>while True: try...except...sleep(1)</span><span> in your scripts.</span>
Output hard to parse? CLI supports <span>--json</span><span>, Python directly returns objects.</span>
The raw API returns a large chunk of JSON, and if you want to extract a specific field, you have to use <span>jq</span><span> or Python’s </span><code><span>json.loads()</span><span> to parse it manually.</span>
In contrast, nblm-rs’s CLI supports <span>--json</span><span> output mode:</span>
nblm notebooks list --json | jq '.notebooks[].title'
Clean and straightforward.
The Python SDK directly returns typed objects:
from nblm import NblmClient
client = NblmClient(project_number="123456789")
notebooks = client.list_notebooks()
for nb in notebooks:
print(nb.title) # Directly access properties without dict['title']
This is the experience modern development should have.
Technical Architecture Revealed: Rust Core + Python Bindings, Fast, Stable, Accurate
The most impressive aspect of nblm-rs is not its many features, but its highly professional architectural design.
We can break it down into three layers:
+---------------------+
| Python SDK | ← For data scientists/back-end use
+---------------------+
| CLI (Command Line)| ← For operations/automation scripts
+---------------------+
| Core (Rust Lib) | ← The real engine that does the work
+---------------------+
Bottom Layer: Rust Implements Core Logic, Safe and Efficient
The core of the entire project is a Rust library called <span>crates/nblm-core</span><span>, responsible for:</span>
- HTTP request encapsulation
- Authentication management (integrated with
<span>gcloud</span><span>)</span> - Type definitions (struct mapping API model)
- Error handling and retry strategies
- Logging output and debugging support
The advantages of Rust are fully demonstrated here:
- Memory safety: No worries about null pointers or buffer overflows.
- Zero-cost abstractions: Performance is nearly equivalent to pure C.
- Compile-time checks: Many errors are caught during the
<span>cargo build</span><span> phase.</span> - Cross-platform compilation: One-click generation of binaries for macOS, Linux, and Windows.
This is why the CLI version can be “plug-and-play,” running immediately after download without relying on any runtime.
Middle Layer: CLI Tool, A Great Partner for Shell Scripts
The CLI is built on the <span>clap</span><span> Rust command-line library, featuring concise syntax, automatic help documentation generation, and support for subcommands.</span>
For example:
nblm notebooks create --title "Test Notebook"
nblm sources add --notebook-id xxx --web-url https://example.com
nblm audio create --notebook-id xxx
Each command corresponds to an API call, complete with parameter validation, default value filling, and beautified error messages.
Most importantly—it can easily be embedded in shell scripts, CI/CD processes, and scheduled tasks..
For example, you can write a cron job to automatically fetch the company intranet announcement page every morning and import it into NotebookLM to generate a summary:
#!/bin/bash
export NBLM_PROJECT_NUMBER=123456789
export NBLM_LOCATION=global
URL=$(curl -s http://intranet/api/latest-announcement | jq -r .url)
nblm notebooks create --title "Daily Briefing $(date +%Y-%m-%d)" \
&& nblm sources add --web-url "$URL" --web-name "Today's News"
Say goodbye to manual copy-pasting.
Upper Layer: Python SDK, Seamless Integration into AI Workflows
The Python layer is implemented using PyO3, a framework that allows deep interoperability between Rust and Python.
This means:
- Python calls actual Rust functions, not subprocess calls to the CLI.
- Performance is close to native, with no extra process overhead.
- The type system is integrated, providing smooth IDE auto-completion.
Installation is also extremely simple:
pip install nblm
# Or faster with uv
uv add nblm
Then you can directly call it in Jupyter Notebook:
from nblm import NblmClient, WebSource
client = NblmClient(project_number="123456789")
# Create a notebook
nb = client.create_noteboot(title="Financial Report Analysis")
# Add web sources
client.add_sources(nb.notebook_id, [
WebSource(url="https://investor.google.com", name="Google Q3 Report"),
WebSource(url="https://news.cnblogs.com", name="Industry Trends")
])
# Wait for processing to complete (pseudo code)
time.sleep(30)
# Get summary
summary = client.get_summary(nb.notebook_id)
print(summary.text)
Imagine being able to use NotebookLM as a “super summary node” in LangChain or LlamaIndex, specifically for preprocessing long texts.
Functionality Test: From Creating Notebooks to Generating Audio, Full Linkage Achieved
Next, let’s demonstrate what nblm-rs can actually do.
Step 1: Installation & Configuration
Install CLI (recommended via Homebrew)
brew tap k-dash/nblm https://github.com/K-dash/homebrew-nblm
brew install k-dash/nblm/nblm
Verify successful installation:
nblm --version
# Output: nblm 0.3.1
Install Python SDK
pip install nblm
Authentication Preparation
Make sure you are logged into Google Cloud:
gcloud auth login
And enable the NotebookLM Enterprise API (just search in the GCP console).
Set environment variables:
export NBLM_PROJECT_NUMBER="your_project_number"
export NBLM_LOCATION="global"
Done, you can start operating now!
Step 2: Create a Notebook + Add Data Sources
# Create a notebook
nblm notebooks create --title "AI Trend Report"
# Output similar to:
# Created notebook: projects/123/locations/global/notebooks/abc
# Title: AI Trend Report
# State: ACTIVE
Note down the returned notebook ID (e.g., <span>abc</span>), and then add data.
Supports various sources:
✅ Add Web Links
nblm sources add \
--notebook-id abc \
--web-url "https://www.theverge.com/ai" \
--web-name "The Verge AI Column"
✅ Upload Local Files (PDF/TXT/DOCX, etc.)
nblm sources add \
--notebook-id abc \
--file-path ./report.pdf \
--file-name "Q3 Technical White Paper"
✅ Add YouTube Videos
nblm sources add \
--notebook-id abc \
--youtube-url "https://youtube.com/watch?v=dQw4w9WgXcQ" \
--youtube-name "AI Introduction Lecture"
✅ Add Google Drive Files
Provided you included Drive permissions during authorization:
nblm sources add \
--notebook-id abc \
--drive-file-id "1A2B3C..." \
--drive-file-name "Meeting Minutes"
All these operations call the same <span>/v1beta/{parent=projects/*/locations/*}/sources:add</span><span> interface, but nblm-rs handles parameter mapping, MIME type checking, and chunk uploads for you.</span>
Step 3: Generate Audio Overview
NotebookLM has a cool feature: it can generate a voice explanation of the entire notebook’s content, suitable for listening during commutes or quickly understanding before meetings.
CLI call:
nblm audio create --notebook-id abc
Python call:
client.create_audio_overview(notebook_id="abc")
Although the current configuration options are not supported (like speech rate, tone), the basic functionality is available.
Deleting is also convenient:
nblm audio delete --notebook-id abc
Step 4: View & Delete
List all notebooks:
nblm notebooks list
Output:
ID: abc Title: AI Trend Report State: ACTIVE
ID: def Title: Test Notebook State: DELETED
Delete a specific notebook:
nblm notebooks delete --notebook-id abc
Note: The API currently supports serial deletion, and cannot delete in bulk concurrently, so if you have hundreds of test notebooks, you might need to grab a cup of tea while waiting.
Advanced Usage: Transform nblm-rs into Your “AI Knowledge Hub”
Just knowing the basic operations isn’t enough; we need to play a bit more advanced.
Scenario 1: Automatically Fetching Tech Blogs Daily to Generate Weekly Reports
Write a Python script, combining <span>requests</span> + <span>BeautifulSoup</span> + <span>nblm</span>:
import requests
from bs4 import BeautifulSoup
from nblm import NblmClient, WebSource
def get_recent_tech_articles():
r = requests.get("https://techcrunch.com/category/artificial-intelligence/")
soup = BeautifulSoup(r.text, 'html.parser')
links = soup.select('h2 a')[:5]
return [(a.get_text(), a['href']) for a in links]
client = NblmClient(project_number="123456789")
nb = client.create_notebook(f"AI Weekly Report {datetime.now().strftime('%Y-%m-%d')}")
for title, url in get_recent_tech_articles():
client.add_sources(nb.notebook_id, [WebSource(url=url, name=title)])
Combine with Airflow or GitHub Actions to automatically execute every Monday morning and email the summary.
Scenario 2: Intelligent Archiving System for Customer Documents
You are a technical support person at a SaaS company, receiving a large number of customer-uploaded documents (contracts, requirement documents, feedback forms) every day.
You can do the following:
- User uploads PDF → Store in GCS
- Trigger Cloud Function
- Call nblm-rs to automatically generate summaries + keywords
- Store in a database for later retrieval
def on_file_upload(event):
file = event['data']
if not file['name'].endswith('.pdf'):
return
notebook = client.create_notebook(f"Customer Document_{file['name']}")
client.add_sources(notebook.notebook_id, [FileSource(path=f"gs://{file['bucket']}/{file['name']}")])
time.sleep(60) # Wait for processing
summary = client.get_summary(notebook.notebook_id)
db.insert({
'doc_name': file['name'],
'summary': summary.text,
'keywords': extract_keywords(summary.text)
})
From now on, customer service no longer needs to open each PDF to check the content.
Scenario 3: Build Your Own “AI Professor”
You want to learn a specific field (like blockchain), but there’s too much material to understand.
Solution:
- Collect 20 authoritative articles, 5 videos, and 3 white papers
- Import all into a NotebookLM notebook
- Let AI automatically generate a structured knowledge graph
- Then based on this “knowledge base,” ask: “Please explain the PoS mechanism in a way a high school student can understand.”
This is the core value of NotebookLM:It is not a Q&A robot, but a “comprehending AI assistant.”.
And nblm-rs is the best pipeline to feed your “knowledge fragments” to it.
Source Code Exploration: How Is This Project Organized?
Curious students might ask: What does the code of such a professional tool look like?
Let’s take a look at its directory structure:
nblm-rs/
├── crates/ # Rust core modules
│ ├── nblm-core/ # Core logic
│ ├── nblm-cli/ # CLI tool
│ └── nblm-py/ # Python binding layer
├── python/ # Python package release related
├── docs/ # Documentation
├── scripts/ # Build scripts
└── Cargo.toml # Rust project configuration
A typical Monorepo + Multilanguage Integration architecture.
The most critical part is <span>nblm-core</span><span>, which defines all API request models:</span>
#[derive(Serialize, Deserialize)]
pub struct Notebook {
pub name: String,
pub title: String,
pub create_time: Option,
pub state: NotebookState,
}
And the client trait:
pub trait NotebookService {
async fn create_notebook(&self, req: CreateNotebookRequest) -> Result;
async fn list_notebooks(&self, req: ListNotebooksRequest) -> Result;
// ...
}
Both the CLI and Python SDK depend on this core library to ensure consistent behavior.
Moreover, the project has CI/CD, codecov for code coverage detection, and static checks with Ruff and mypy, indicating that the author is genuinely maintaining it as a production-level project.
Current Limitations & Known Issues
Of course, no tool is without its shortcomings.
According to the README, the current NotebookLM API is still in the Alpha stage, with some limitations:
| Issue | Description |
|---|---|
| 🔴 Pagination not implemented | <span>list_notebooks</span><span> only returns the most recent few, cannot paginate</span> |
| 🟡 Deletion efficiency low | Must delete one by one, cannot batch delete |
| 🟡 Audio configuration missing | Cannot customize voice style, speed, etc. |
| 🟡 Sharing incomplete | CLI does not yet support sharing features |
But this does not prevent it from being the best NotebookLM automation tool available.
After all—having something is better than having nothing, and being able to run is better than not being able to run.
Moreover, the community is already submitting PRs, so batch deletion might be supported next month.
Comparison with Similar Tools: Why nblm-rs Stands Out?
There are other ways to call AI APIs on the market, such as:
| Tool | Advantages | Disadvantages |
|---|---|---|
Directly using <span>curl</span> |
Simple | Difficult to maintain, no retries, no type checking |
| Postman | Graphical | Not suitable for automation |
| Writing custom Python scripts | Flexible | High development cost, prone to errors |
| nblm-rs | Fast, stable, cross-language, production-ready | New project, ecosystem to be improved |
Especially when you need to switch between different languages and platforms, the unified core advantage of nblm-rs becomes apparent.
Conclusion: The Future of Knowledge Work Will Be “Human-Machine Collaborative Pipelines”
Friends, we are at a turning point.
In the past, AI tools were “you ask, I answer” dialogue boxes;
In the future, AI tools will be “automated knowledge engines.”
Projects like nblm-rs are the bridges connecting human intent with machine execution.
It tells us:
True productivity liberation is not about learning to use AI, but about making AI a part of your workflow.
You don’t have to manually open NotebookLM every day;
instead, let it automatically organize the information you care about every morning, generate summaries, and send them to your DingTalk group.
You don’t have to read through 100 pages of PDF;
instead, let the system automatically extract key points and create a PPT outline.
You don’t have to stay up late writing weekly reports;
instead, let AI automatically generate a professional report based on the code, meeting notes, and emails submitted this week.
All of this is not science fiction.
As long as you can write scripts, understand a bit of automation, and have tools like nblm-rs, you can achieve it.
So, stop treating AI as just a chat toy.
It’s time to turn it into your “digital employee.”
Appendix: Quick Start Command List
Common CLI Commands
# Check version
nblm --version
# Create a notebook
nblm notebooks create --title "New Project"
# List notebooks
nblm notebooks list
# Add web source
nblm sources add --notebook-id xxx --web-url https://example.com --web-name "Example Page"
# Add local file
nblm sources add --notebook-id xxx --file-path ./doc.pdf
# Generate audio
nblm audio create --notebook-id xxx
# Delete notebook
nblm notebooks delete --notebook-id xxx
Python SDK Example
from nblm import NblmClient, WebSource
client = NblmClient(project_number="123456789")
# Create
nb = client.create_notebook("Test")
# Add source
client.add_sources(nb.notebook_id, [WebSource("https://example.com", "Test Page")])
# Get summary (wait for processing to complete)
summary = client.get_summary(nb.notebook_id)
print(summary.text)
Project Address: https://github.com/K-dash/nblm-rs[1]
References
[1]
https://github.com/K-dash/nblm-rs: https://github.com/K-dash/nblm-rs