dmoshehun-prog/learn-from-materials

Turn PDFs, books and papers into interactive learning webpages|将复杂材料转化为可追溯、可测验、可做笔记的学习网页

learn‑from‑materials

What it is – An Agent Skill that lets AI‑powered agents (e.g., WorkBuddy, Claude Code, GitHub Copilot CLI) turn any collection of documents—PDFs, slides, Word files, web pages, EPUBs, etc.—into a traceable knowledge base and an interactive learning page. The skill extracts the material, records where each fact came from, builds a structured “methodology” of the source’s arguments, and produces Markdown and a self‑contained HTML viewer. It works offline and only requires the agent to be able to read files and run local Python scripts.

Why it matters – Modern AI assistants often hallucinate or lose track of sources. This project enforces a strict separation between material‑backed facts and model‑added content, keeps source hashes, and lets the user audit every citation. It therefore supports systematic study, quick overviews, and reproducible learning workflows without needing an internet connection.

Key features

  • Two learning depths – Quick overview (scan core arguments) and Systematic study (read every block, audit coverage).
  • Whole‑material methodology – extracts the central question, goal, arguments, frameworks, and action rules into methodology.json/.md while keeping the original text separate.
  • Method library – reusable methods are saved in methods.json and rendered as readable cards (patterns.md). New methods get stable IDs and parent references; nothing is overwritten silently.
  • Fine‑grained source mapping – PDF page numbers, PPT slide numbers, EPUB chapters, etc., are attached to each knowledge unit.
  • Interactive HTML output – hover‑ or focus‑based source hints, collapsible mind‑maps, theme options (Sea Salt, Ink Wash, Bamboo Moon), and optional motion effects.
  • Offline‑first & least‑privilege – no automatic dependency installation; all data stays on the local machine or in the browser.
  • Multi‑language support – English and Chinese UI, content, and prompts; language is never guessed.
  • Agent‑agnostic – works with any agent that can read files, execute Python, and recognise a SKILL.md directory.

Typical workflow

  1. Install the skill folder into the agent’s skill search path (e.g., ~/.workbuddy/skills/).
  2. Run the extraction script (scripts/extract.py) on a material folder or file.
  3. Bind methods (scripts/methods.py) and bind methodology (scripts/methodology.py).
  4. Audit the generated quick-audit.json (quick) or the full systematic ledgers (summary‑ledger.json, action‑rule‑ledger.json, …).
  5. Finalize with scripts/finalize.py to produce an HTML learning page, Markdown, and the .learnkb knowledge base.

Use cases

  • Students who want a verifiable study guide from textbooks or research papers.
  • Professionals turning lengthy reports (e.g., market outlooks) into concise, source‑backed briefing pages.
  • Teams building internal knowledge bases where every claim must be traceable to a document.
  • AI‑agent developers who need a reusable “skill” for document‑driven reasoning.

Installation & requirements

  • Python 3.10+ (standard library handles most formats).
  • Optional external tools for better parsing: pdftotext, pdfminer.six, Docling, OCRmyPDF, ebooklib, python‑docx, striprtf, Calibre’s ebook-convert.
  • Node.js + Playwright only for optional JavaScript regression checks; not required for core functionality.
  • The agent must be able to read the skill directory and execute the provided Python scripts.

Limitations

  • The skill does not run an LLM itself; it only prepares prompts for the surrounding agent to invoke a model.
  • Scanned PDFs or image‑heavy slides need OCR; without it the affected sections are flagged as unverified.
  • Very large multi‑book projects may exceed the context window of the downstream LLM and will need a long‑context model.
  • No automatic dependency installation – users must manually install any optional parsers they need.

Getting started

# Clone into the agent’s skill folder
git clone https://github.com/dmoshehun-prog/learn-from-materials.git \
    ~/.workbuddy/skills/learn-from-materials

# Extract a PDF (quick overview)
python3 scripts/extract.py mypaper.pdf --mode text --ocr auto --output-dir mypaper.learnkb

# Bind methods and finalize
python3 scripts/methods.py bind --library mypaper.learnkb/methods.json \
    --page page.json --knowledge-base mypaper.learnkb --output page-with-methods.json
python3 scripts/finalize.py page-with-methods.json --knowledge-base mypaper.learnkb \
    --output-dir ./delivery --name learning-quick

Open delivery/learning-quick.html in a browser to explore the interactive learning page.


All information above is taken directly from the repository’s README; no additional features have been inferred.

Related

  • Project
  • Project
  • Project
  • Project