Recursive summarisation
Documents larger than the context window are chunked, summarised, then re-summarised. Lossless of intent.
The Summarizer engine handles documents of any size,
including those larger than the model's context window. Recursive
summarisation breaks long inputs into chunks, summarises each, then
summarises the summaries. Works on PDFs, DOCX, images, scanned docs
via OCR, and plain text. Configurable length, intent, and auto-title.
Documents larger than the context window are chunked, summarised, then re-summarised. Lossless of intent.
Executive, bullet, narrative. Pick the shape your reader expects.
Summarise scans, screenshots, and image-only pages via VLM-backed OCR.
Recursive overflow strategy splits long documents into chunks, summarises each, then summarises the summaries. No 200-page limit.
SummaryStyle: Executive (one paragraph), BulletList (key points), Narrative (flowing prose).
SummaryLength: Short, Medium, Long. Or set an explicit token target.
Generate a concise title alongside the summary. Useful for indexing libraries of unnamed scans and reports.
Token-by-token streaming via SummarizeAsync. Render in real time as the model writes.
Pass a vision-language model and the engine pulls text from images, screenshots, or scans automatically.
Summarize one document with an executive style, a short length, and recursive overflow handling.
using LMKit.Model; using LMKit.TextGeneration; var model = LM.LoadFromModelID("qwen3.5:4b"); var summ = new Summarizer(model) { Style = SummarizerStyle.Executive, Length = SummaryLength.Short, OverflowStrategy = SummarizerOverflowStrategy.RecursiveSummarize, }; // Works on PDFs, DOCX, plain text, images. Hands-off. var result = await summ.SummarizeAsync(@"C:\reports\Q3-annual.pdf"); Console.WriteLine(result.Title); Console.WriteLine(result.Summary);
Summarize each weekly report into bullets, then summarize the summaries into an annual narrative.
// Summarise a year of weekly reports into one digest. var reports = Directory.EnumerateFiles(@"C:\weekly-reports", "*.pdf"); var bullets = new List<string>(); foreach (var r in reports) { var s = await summ.SummarizeAsync(r, intent: "One bullet per major decision or risk surfaced this week."); bullets.Add(s.Summary); } // Now summarise the summaries. var annual = await summ.SummarizeAsync(string.Join("\n\n", bullets), style: SummarizerStyle.Narrative, length: SummaryLength.Long);
The same engine for plain-text inputs without document parsing.
For interactive Q&A over the same documents you summarise. Different surface, same corpus.
Scans and image-only PDFs run through OCR transparently before summarisation.
Watch a folder, summarise on arrival, route to the right channel. End-to-end automation.
Working console demos on GitHub, step-by-step how-to guides on the docs site, and the API reference for the classes used on this page.
Console demo: section-aware summaries of long documents.
Open on GitHub → How-to guideEnd-to-end: ingest, chunk, summarize, assemble.
Read the guide → How-to guidePick the right summarization intent and overflow policy.
Read the guide →