Kizuki
    Preparing search index...

    Adding material

    You add course files with /add <files>, or by dropping them onto the Kizuki window, which pastes their paths. 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. Add. /add or a dropped path reads the file and calls addMaterial. 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. splitPaths reads the forms a terminal pastes: quoted paths, spaces escaped with a backslash, and ~ for your home folder.
    2. Processing starts in the background while you keep typing. Files go one at a time, and the line under the input says which file Kizuki is reading. processMaterial runs the steps below in order. Each step 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.
    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. Processing stops here, and Kizuki says how many concepts it proposed. The file waits with status review in the log until you type /review. See Nothing is saved without your OK.
    7. Links. After you confirm or drop the concepts, finishMaterialReview records the review and proposeLinksForMaterial asks the model which confirmed concepts need which others first.

    Each file's status comes from MaterialStatus: waiting, reading, indexing, proposing, review, linking, done, or failed. A failure records the model's or the reader's message (failMaterial), and Kizuki prints it with the file's name. Add the file again to try again.

    If you quit while a file is being read, nothing is lost. When Kizuki starts, resumeUnfinished finds files left in waiting, reading, indexing, proposing, or linking and finishes them, skipping the steps the logs show are done.