notebooklm-add-source
Add a single source to a library. Both the NotebookLM notebook AND the vault-side wiki node Sources table get updated.
Pre-flight checks
Wiki/Libraries/{library_slug}.mdexists.sourceis reachable (URL responds OR file exists). For URLs, do a HEAD request — don't pull the whole resource.- Source isn't already in the library's Sources table (de-dupe by URL or file hash). If duplicate: log + skip; don't add twice.
- NotebookLM session valid (Phase 2+). If unavailable: write the row to the wiki node anyway with
source_id: pending, log, and surface to Adam to retry once NLM is back.
Auto-detection (when source_type is omitted)
https://(www\.)?youtube\.com/...oryoutu.be/...→youtubehttps://...spotify.com/episode/...or known podcast hosts →podcast- Path ending
.pdf→pdf https://drive.google.com/...→drive- Path ending
.md|.txt→text - Other URL →
url - Else →
file
Procedure
1. Add to NotebookLM (Phase 2+)
- Use
notebooklm-py's add-source method with the right path/URL based onsource_type. - Capture returned
source_id.
2. Update the wiki node
Edit Wiki/Libraries/{library_slug}.md:
- Append a row to the Sources table:
| {title} | {source} | {source_type} | {today} | {notes} | - Increment
source_countin frontmatter by 1. - Set
last_synced: {today}.
3. Append Log entry
- input:
library={library_slug}, source={source}, type={source_type} - output:
source_id={source_id or pending} - artifacts:
<a class="wikilink wikilink-broken" href="#">Wiki/Libraries/{library_slug}</a>
Title resolution
- If
titleis provided, use it. - For YouTube: query the page (or NotebookLM's metadata if available) for the video title.
- For URLs: fetch the page
<title>tag. - For files: use the filename (without extension).
- Fallback: use the source URL as the title.
Hard rules
- Never push files from
Raw/Health/,Context/MI.md, or brand compliance documents to NotebookLM. The skill MUST refuse and surface to Adam if Asked to add a path under those locations. - For paid / gated content (paywalled articles, private podcasts), confirm with Adam before adding — uploading copyrighted gated content may breach NotebookLM TOS.
Failure modes
- Source unreachable — skip and log; don't write a partial row.
- Source already in library — no-op + log; respond "already in library, no action."
- NotebookLM error — write wiki row with
source_id: pending, log, surface to Adam. - Auto-detection ambiguous — prompt Adam to specify
source_type.