Skip to content

DaviAlcanfor/nb2ob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Automatically syncs NotebookLM notebooks into structured Obsidian notes via a multi-agent LLM pipeline.

Python LangGraph Obsidian NotebookLM


What nb2ob does

Fetches all your NotebookLM notebooks and their sources, runs them through an agent pipeline that cleans, summarizes, clusters, and formats the content, then writes the result as structured markdown notes directly into your Obsidian vault.

No copying. No pasting. No manual formatting.


How it works

flowchart TD
    A["notebooklm-py\npulls notebooks + sources"] --> B["Cleaner\nremoves noise from raw content"]
    B --> C["Summarizer\ngenerates a lightweight summary per source"]
    C --> D["Clusterizer\ngroups sources by topic"]
    D --> E["Orchestrator\ndecides which clusters become files"]
    E --> F["Formatter\nwrites structured markdown per file"]
    F --> G["Obsidian Local REST API\nsaves notes to vault"]
    G --> H["NotebookLM/{notebook}/{topic}.md ✓"]
Loading

Each notebook becomes a folder in your vault. Each topic cluster becomes a .md file inside it.


Generated note structure

## 📋 Resumo

## 📚 Conteúdo
### 🔹 [Topic]
...

Project structure

nb2ob/
├── main.py                     # CLI entry point (typer)
│
├── agent/
│   ├── graph.py                # builds and compiles the LangGraph pipeline
│   ├── state.py                # PipelineState and TypedDicts
│   ├── nodes/                  # one file per agent (cleaner, summarizer, etc.)
│   └── prompts/                # one file per agent + base.py
│
├── api/
│   ├── __init__.py
│   ├── notebooklm.py           # NotebookLM unofficial API wrapper
│   └── obsidian.py             # Obsidian Local REST API wrapper
│
├── config/
│   ├── settings.py             # Config dataclass with env var validation
│   └── models.py               # Model enum
│
├── infrastructure/
│   ├── config.py               # logger setup
│   └── decorators.py           # log_call decorator
│
└── docs/                       # images used in this README

Prerequisites

  • Python 3.11+
  • uv
  • Obsidian with the Local REST API plugin installed and active
  • A Google account with access to NotebookLM
  • API key from at least one supported provider (Groq, Gemini, or Anthropic)

Setup

1. Clone the repository

git clone https://github.com/DaviAlcanfor/nb2ob.git
cd nb2ob

2. Install dependencies

uv sync
playwright install chromium

3. Install and configure the Obsidian plugin

Open Obsidian and go to Settings → Community Plugins.

Click Browse and search for Local REST API with MCP.

Install and enable it. Then go to Settings → Local REST API & MCP Server to find your bearer token.

Copy the token — you'll need it in the next step.

4. Authenticate with NotebookLM

notebooklm login

This opens a browser for you to sign in with your Google account. Credentials are stored locally and reused on subsequent runs. If the session expires, run it again.

5. Configure environment variables

cp .env.example .env
# Obsidian Local REST API
OBSIDIAN_TOKEN=<your_bearer_token>      # from Settings > Local REST API & MCP Server
OBSIDIAN_HOST=https://127.0.0.1        # change only if you modified the plugin settings
OBSIDIAN_PORT=27124                    # change only if you modified the plugin settings
OBSIDIAN_FOLDER=NotebookLM             # root folder in your vault where notes will be saved

# LLM Provider (at least one required)
GROQ_API_KEY=<your_groq_api_key>       # https://console.groq.com/keys
GEMINI_API_KEY=<your_gemini_api_key>   # https://aistudio.google.com/apikey
ANTHROPIC_API_KEY=<your_anthropic_key> # https://console.anthropic.com/keys

6. Run

uv run main.py

Supported models

At least one API key is required. The pipeline currently uses Groq by default.

Provider Model Get key
Groq llama-3.3-70b-versatile console.groq.com
Gemini gemini-2.0-flash aistudio.google.com
Anthropic claude-sonnet-4-20250514 console.anthropic.com

Main dependencies


⚠️ Disclaimer

notebooklm-py is an unofficial library that uses undocumented Google APIs. It is not affiliated with Google and may break without notice. Use at your own risk.


License

MIT

About

Sync your NotebookLM notebooks to Obsidian automatically via a multi-agent LLM pipeline.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages