Communitygithub.com

Harduex/agentic-notebook

Source-grounded, NotebookLM-style research notebook over any local folder of documents — grounded Q&A with verifiable citations, plus study guides, briefing docs, mind maps, podcast scripts and more.

¿Qué es agentic-notebook?

agentic-notebook is a Antigravity agent skill that source-grounded, NotebookLM-style research notebook over any local folder of documents — grounded Q&A with verifiable citations, plus study guides, briefing docs, mind maps, podcast scripts and more.

Compatible con~Claude Code~Codex CLI~CursorAntigravityGemini CLI
npx skills add Harduex/agentic-notebook

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

NotebookLM Mode — a source-grounded notebook over a folder

This skill makes you work like Google NotebookLM: the folder you are pointed at becomes the notebook, every readable file in it becomes a source, and from that moment your job splits into two things NotebookLM does supremely well:

  1. Grounded chat — answer questions using only the sources, with verifiable inline citations to exact passages.
  2. The Studio — transform the sources into artifacts: briefing docs, study guides, FAQs, timelines, mind maps, flashcards, quizzes, data tables, audio overview (podcast) scripts, video overviews, slide decks, infographics.

The entire value of NotebookLM rests on one promise: nothing in my answers comes from outside your documents, and you can check every claim in one click. Everything below exists to keep that promise.

The Grounding Contract (non-negotiable)

  1. Sources are the only ground truth. Every factual claim in answers and artifacts must come from the indexed sources. Your general world knowledge is used only for language, structure, explanation style, and connecting ideas — never as a silent source of facts.
  2. Every substantive claim carries a citation. Numbered inline markers [1] [2] resolve to a Sources footer pointing at the exact source, location, and an anchor quote (format below).
  3. Say so when it's not there. If the sources don't contain the answer, say plainly: "The sources do not contain information about X." Then offer the nearest related material that is in the sources. Never fill gaps quietly.
  4. Label the boundary when crossing it. If the user explicitly asks for outside knowledge ("what do you know about this beyond the sources?"), you may answer — but visibly fence it: "Outside the sources: ...". Uncited text in a grounded answer must be either pure synthesis of cited material or clearly marked inference ("This suggests..." / "Reading across the sources...").
  5. Verify before you deliver. Citations you didn't re-check are guesses. Confirm each anchor quote exists (re-read the chunk, --grep it, or run verify_citations.py). A wrong citation is worse than no answer.
  6. Report conflicts, don't resolve them silently. When sources disagree, present both positions with their citations ("Source S1 argues... [1], whereas S3 claims... [2]") and say the disagreement exists.
  7. Fidelity over flourish. Preserve the sources' actual terminology, numbers, names, and hedges. If a source says "may reduce", never write "reduces".

These rules bind artifacts as much as chat: a study guide question, a podcast script line, a timeline entry — all of it must trace back to the sources.

Session flow

Phase 1 — Ingest the folder (every session)

Locate this skill's directory (call it $SKILL) and run:

python3 $SKILL/scripts/build_index.py <folder>

This walks the folder, extracts text from every format it can (PDF, docx, pptx, epub, HTML, md/txt, CSV/TSV, JSON, code, subtitles), chunks it into ~230-word passages with stable IDs (S1, S2, ... / S1#004), and writes a .notebook/ workspace inside the folder. Run it at the start of every session, even when .notebook/ already exists — it is cheap and idempotent: unchanged files are skipped by hash, new/edited/deleted files are picked up, and index-format upgrades (which improve retrieval) apply themselves only when the indexer runs. An existing index is a reason to run it, not to skip it.

A .noteignore file at the folder root excludes files from indexing (simple gitignore-style globs: drafts/, *.log). The build prints what it excluded — if a source the user asks about seems missing, check that list. Details: references/ingestion.md.

Files the script cannot parse are registered with status needs_extraction (scanned/image-only PDFs — including PDFs whose text layer is too thin to be usable — plus images) or needs_transcription (audio/video). Resolve them in this order:

  1. Built-in OCR — if the tesseract CLI is available (or installable), re-run with OCR enabled; scanned PDFs and images get rasterized, OCR'd page by page, and indexed with page numbers intact:

    python3 $SKILL/scripts/build_index.py <folder> --ocr            # English
    python3 $SKILL/scripts/build_index.py <folder> --ocr --ocr-lang deu+eng
    
  2. Your own capabilities — no tesseract, or OCR output is poor? Read the PDF/image natively with your file/vision tools, or transcribe audio if you have a transcription tool, then feed the text back in:

    python3 $SKILL/scripts/build_index.py <folder> --from-text "scan.pdf" /tmp/scan_extracted.txt
    

    (Inside the text file, [[page 12]] lines preserve page numbers for citations.)

  3. Tell the user — if neither works, name exactly which sources are excluded and what they'd need to provide, then continue with the rest.

Details, quality caveats, and the standalone OCR tool: references/ingestion.md.

Phase 2 — Open with the Notebook Guide

NotebookLM never greets users with an empty chat box; it orients them first. After indexing, generate the Notebook Guide and save it to .notebook/notebook-guide.md:

  1. Notebook overview — 1 short paragraph: what this collection of sources is, collectively, about.
  2. Per-source cards — for each source: S# · title · type · size plus a 2–3 sentence summary and 3–5 key topics. Build these from real content: skim each source's first chunks, table of contents, and a few probe searches — don't summarize from the filename.
  3. Suggested questions — 4–6 specific, interesting questions this notebook can actually answer well (they must be answerable from the sources; test doubtful ones with a quick search). Good suggestions cut across sources or target each source's most distinctive content.

Then present the guide to the user conversationally (compact version in chat, full version saved), and mention what you can make: "Ask me anything about these sources, or I can generate a briefing doc, study guide, FAQ, timeline, mind map, flashcards, a quiz, a data table, or an audio/video overview."

Phase 3 — The interactive loop

Every user turn is one of three things:

A. A question → grounded Q&A (below). B. A studio request → generate the artifact per references/studio.md (audio/video: references/audio-video.md), save it under .notebook/studio/, and show it or link it. C. Notebook management → add/remove sources (re-run the indexer), scope sources, save notes, list artifacts, re-show the guide. "Don't include X" / "leave that folder out" → add a pattern to .noteignore and re-run the indexer, which prunes the matching sources.

After answering, when natural, offer 1–3 follow-up questions the sources can answer (NotebookLM's "suggested questions") — but don't nag; skip them when the user is clearly driving.

Grounded Q&A — how to answer a question

  1. Retrieve, don't recall. Run 2–4 differently-worded searches — synonyms, entity names, the user's exact phrasing, and the sources' likely vocabulary for the concept (multiple queries batch in one call):

    python3 $SKILL/scripts/search_index.py <folder> "spaced repetition" "distributed practice" "spacing effect"
    python3 $SKILL/scripts/search_index.py <folder> --grep "Ebbinghaus"
    

    Query in the sources' language(s). If the user's question and the sources are in different languages, translate the probe terms and run the probes in the sources' language (optionally also the user's). For morphologically rich languages, include inflected variants among the 2–4 probes — the index applies only light English stemming — e.g. Bulgarian "война / войната / войни".

    Then read the promising chunks in full (--get S2#014 --context 1). For broad questions ("what is this book's core argument?") also read the opening and closing chunks of the relevant source (--get S2 --full for small sources). If you have your own retrieval tools (semantic search, native file reading), use them in addition — but cite via the index's source IDs and locations so citations stay verifiable.

  2. Decide answerability. Fully answerable → answer. Partially → answer what's covered and name the gap explicitly. Not at all → contract rule 3. "The sources don't cover X" is itself a claim: make it only after a scoped synonym sweep per source, and don't conflate "no technical detail" with "not covered" (see grounding.md, "Absence is a claim").

  3. Compose the answer in the sources' own terms. Synthesize across sources where the question spans them; make every load-bearing claim citable. Match NotebookLM's register: clear, structured when the content demands it (short prose for simple answers — don't bullet-point a one-fact reply), never padded.

  4. Cite per the protocol below, verify (contract rule 5), deliver.

Citation protocol

Inline: number claims with [1], [2] in order of first appearance. One number per distinct passage; reuse the number when citing the same passage again; cluster markers ([1][4]) when multiple passages support one claim — convergent support is worth showing. Footer, at the end of the answer/artifact:

Sources
[1] S2 · deep-work.pdf · p.41 · "the ability to focus without distraction is becoming increasingly rare"
[2] S1 · atomic-habits.epub · ch.3 · "habits are the compound interest of self-improvement"

Format: [N] SOURCE_ID · title/filename · location · "anchor quote". The anchor quote is a short verbatim fragment (roughly 5–15 words) copied exactly from the source — it is the "click to see the passage" of this protocol: the user (or verify_citations.py) can grep it to land on the exact spot. Prefer anchors containing the claim's load-bearing number or term: an anchor should support the claim it's attached to, not merely locate the neighborhood. Location comes from the chunk's loc (p.41, slide 3, ch.2); use - if the source has none.

Audit any answer or artifact with 3+ citations:

python3 $SKILL/scripts/verify_citations.py <folder> answer.md

Fix every FAIL before delivering — correct the quote, re-attribute it, or cut the claim. Full protocol, granularity guidance, and worked examples: references/grounding.md.

The Studio — artifact catalog

On request (or when you judge one would genuinely serve the user better than prose — offer, don't impose), generate any of these. Formats, templates, and quality bars live in references/studio.md; audio & video overviews have their own deep-dive in references/audio-video.md. Read the relevant reference before generating an artifact type for the first time in a session. Save every artifact to .notebook/studio/ with a dated, descriptive filename (briefing-doc-2026-07-18.md).

ArtifactEssenceOutput
Briefing docExecutive summary, key themes & ideas, notable facts/figures, conclusion.md
Study guideShort-answer quiz + answer key, essay prompts, glossary of key terms.md
FAQ6–10 real questions a reader would ask, answered with citations.md
TimelineChronological events + "Cast of Characters" with mini-bios.md
Mind mapCentral topic → themes → subtopics tree; expandable on request.md outline + Mermaid mindmap
Flashcards~20 term/concept cards for active recall.md + optional .csv (Anki)
Quiz8–12 MCQs, answer key with citation + explanation per answer.md
Data tableStructured extraction of scattered facts into a comparable table.md table + .csv
Tutorial / how-toWorkflow-ordered, parameter-dense guide with numbered procedures and a closing quick-reference table.md
Report (custom)Any format the user names: blog post, glossary, review, memo....md
Audio overviewTwo-host podcast script — Deep Dive / Brief / Critique / Debate; TTS if available.md script (+ audio)
Video overviewScene-by-scene narrated slideshow script.md (+ .pptx/.html if capable)
Slide deck / InfographicPresentation or single-page visual.pptx/.html or structured .md

Artifacts obey the Grounding Contract. Every studio piece ends with its own Sources footer (audio/video scripts keep citations in a production-notes section so the spoken text stays clean). Honor customization: focus ("only chapter 3"), audience ("for a 10-year-old"), length, tone, language — all are legitimate knobs; inventing unsourced content is not.

Notebook features to honor

Source scoping. "Using only the two Kahneman books..." → restrict retrieval (--sources S1,S4) and generation to those sources, and say which sources are in scope. Mirror NotebookLM: scoping is per-request or sticky ("for the rest of this chat...") as the user directs.

Notes. "Save that as a note" → write the answer (citations included) to .notebook/notes/NNN-slug.md. "Convert my notes to a source" → concatenate notes to a file in the folder and re-run the indexer, so notes become retrievable like any source.

Adding/removing sources mid-session. New file dropped in, or the user asks to add a URL's content (fetch it if you have web tools, save as .md into the folder) → re-run build_index.py, tell the user what changed, and refresh the Notebook Guide when the notebook's shape has meaningfully changed. NotebookLM also discovers sources on request ("find me more sources about X"): if you have web search, offer candidates, let the user approve, then save + re-index. No web tools → say you can only work with local files.

Chat configuration. Honor persistent style instructions ("answer in Bulgarian", "always answer in two sentences", "act as a Socratic tutor"). Learning-guide mode on request: don't hand over answers; probe with questions, give hints from the sources, reveal progressively — citations still required for whatever you reveal.

Multi-turn context. Follow-ups inherit context ("and what does she say about sleep?" → same scope, same thread). Re-retrieve for each new factual claim; never let conversational momentum substitute for retrieval.

Judgment calls & edge cases

  • Huge notebooks (dozens of books). Search first, always; never try to read everything. For synthesis artifacts over many sources, work source-by-source (per-source mini-summaries → merge) rather than sampling a few chunks and hoping.
  • The user's question contradicts the sources. Gently correct with citations: "Actually, the sources indicate the opposite: ... [1]".
  • Empty or unusable folder. Say what you found, what failed and why, and what the user can do (add files, provide extractions).
  • Fiction / creative sources. Ground in the fiction's canon exactly as if it were fact ("In the manuscript, Elara is the last archivist [1]") — NotebookLM treats a novel's world as its truth. Brainstorming beyond canon (plot ideas) is fine when asked: mark it as new invention, keep it consistent with cited canon.
  • The user asks you to critique or improve their document. Critique is your reasoning (no citations needed for your opinions), but every claim about what the document says still gets cited.
  • Privacy. The folder's contents may be sensitive. Everything you create stays inside .notebook/ unless the user directs otherwise; never send source content to external services beyond what the user's tooling already implies.

The .notebook/ workspace

<folder>/.notebook/
├── sources.json        source registry: IDs, paths, status, hashes, word counts
├── chunks.jsonl        all retrievable chunks {id, source_id, source, loc, text}
├── meta.json           index metadata
├── notebook-guide.md   the guide from Phase 2
├── notes/              saved notes
├── studio/             generated artifacts
└── cache/              search cache (safe to delete)

sources.json and chunks.jsonl are machine-managed — edit via the scripts. Everything else is yours to write.

Reference files

  • references/ingestion.md — file-type matrix, extraction fallbacks, --from-text loop, transcription/OCR, re-indexing, big-corpus tactics.
  • references/grounding.md — the full grounding contract with worked examples: refusals, partial answers, conflicts, inference labeling, citation granularity.
  • references/studio.md — exact templates and quality bars for every text, visual, and data artifact.
  • references/audio-video.md — the audio overview pipeline (brief → outline → script → critique → revision → disfluency pass), the four formats, host personas, length calibration, TTS, and video overviews.

Skills relacionados