Kizuki
    Preparing search index...

    Adding material

    You add course files on a course page. Kizuki keeps a copy, reads the text out of it, splits the text into passages that remember where they came from, adds them to search, and proposes concepts for you to review.

    formatOf picks the reader from the file name's ending. FORMATS lists the formats.

    Ending Reader Sections come from Each passage remembers
    .pdf extractPdf The PDF's bookmarks (two levels deep) when it has them, otherwise one section per page, titled by the page's first line The page number
    .pptx extractPptx One section per slide, titled by the slide title, or "Slide N" The slide number, and whether it is from the speaker notes
    .docx extractDocx Paragraphs styled as headings (Title, Heading 1 to 6, or an outline level) The heading above it and the paragraph number
    .xlsx extractXlsx One section per sheet The sheet name and the cell range, such as A1:D15
    .csv extractCsv One section named after the file The cell range
    .md, .markdown extractMarkdown # headings The heading above it
    .txt extractText One section named after the file The paragraph number

    Details that change what a quote looks like:

    • PDF. Kizuki reads the text layer only. A scanned PDF has none, so extract stops with "no readable text found". A PDF with more than MAX_PDF_PAGES pages is refused, so a file made to hang Kizuki cannot.
    • Slides. Slide numbers, dates, footers, headers, and picture placeholders are skipped. Table rows become lines with | between cells. Speaker notes become their own passages, marked as notes.
    • Word. Tabs and line breaks inside a paragraph are kept. Text before the first heading goes in a section named after the file.
    • Excel. Rows are grouped into passages of up to 15 rows and about 900 characters (rowsToPassages), cells joined with |. formatNumber shows numbers the way the sheet shows them: dates as 2024-10-01, percentages with %, and fixed decimals, so a quote reads like the sheet.
    • CSV. parseCsv follows the usual quoting rules, including "" for a quote mark inside a field.
    • Markdown. stripInlineMarkdown removes formatting marks (links, bold, code marks, list bullets, >), so quotes match the words alone. Code blocks are kept as text.

    Slides, Word files, and workbooks are zip files of XML. openZip unpacks only the XML parts and refuses a file whose text parts unpack past the ZIP_LIMITS, so a small file that unpacks to gigabytes cannot use up your computer's memory.

    Jupyter notebooks (.ipynb), images, scanned PDFs, audio, video, .doc, .ppt, .xls, and other formats are refused when you add them, with "Kizuki can't read .ipynb files yet" and the list of formats it does read (addMaterial). To study a notebook today, export it to markdown or PDF first. Text recognition for images and scans is planned for a later version.

    1. Upload. The course page's form runs uploadAction, which calls addMaterial for each file. It refuses an unknown format and a file whose SHA-256 fingerprint matches a file already in the course (unless that one failed). It copies the bytes to files/<materialId><ending> in the data folder and records material.added in materials.jsonl.
    2. Processing starts as a background job, the processMaterial workflow. Each step lives in workflows/material/steps.ts and is safe to run twice: it checks the logs before it writes.
    3. Read. readMaterial runs the reader, then toRecords gives every section and passage an id made from the file's id and its position (stableId), so reading the same file again gives the same ids. The passages are written once to passages.jsonl. A file with no readable text fails at once, without retries.
    4. Search. indexMaterial adds the passages to the search file with their meaning numbers (see Passages and sentences).
    5. Concepts. proposeForMaterial proposes concepts: one for every real heading, made in plain code by headingConcepts, then smaller ideas from the model, checked by validateConceptReply. The model may also point at sentences it cannot read; each becomes a "what does this mean?" question for you. See The model never writes facts.
    6. Your review. The workflow pauses until you press "Done reviewing: suggest links" on the course page. See Nothing is saved without your OK.
    7. Links. proposeLinksForMaterial asks the model which confirmed concepts need which others first.

    The course page shows each file's status from MaterialStatus: waiting, reading the text, building search, finding concepts, ready for your review, suggesting links, done, or failed. A failure records its message (failMaterial) and the page offers "Try again". A file that has shown the same working status for more than 10 minutes gets "Stuck? Start again". Both start a new run, which skips the steps the logs show are done.