EmlDocument
Single email parser. Headers, plain / HTML body, attachments, embedded images.
Email archives are some of the largest document corpora any organisation owns: every contract reply, every customer thread, every invoice attachment. LM-Kit parses EML, MBOX, and ICS files natively, extracts headers, bodies, attachments and calendar events, and feeds them into the same RAG, summarisation, classification, and extraction pipelines as any other document.
EmlDocumentSingle email parser. Headers, plain / HTML body, attachments, embedded images.
MboxDocumentMailbox archive iterator. Stream through years of correspondence without loading it all.
IcsParserCalendar events. Extract attendees, recurrence, locations, attachments.
Index a customer's full thread history into a vector store. Support agents query with grounded answers and source attribution per email.
Convert MBOX archives to PDF for legal hold, eDiscovery, or regulatory submission. EmlToPdf renders each email as a page.
Classify incoming email by intent (refund, technical issue, sales lead). Route via SupervisorOrchestrator to the right specialist agent.
Pull every PDF, image, or DOCX out of an inbox. Send each through the rest of the document pipeline (OCR, classification, extraction).
Long conversation threads collapsed to bullet points. Surface decisions, blockers, deadlines.
Parse ICS attachments. Extract recurring meetings, attendees, agenda items. Useful for productivity and scheduling agents.
Walk an mbox archive, convert each message to Markdown, and ingest into a DocumentRag index with metadata.
using LMKit.Document.Eml; using LMKit.Retrieval; // Index every email in a mailbox archive into RAG. var mbox = new MboxDocument(@"C:\archives\support@example.com.mbox"); var rag = new DocumentRag(model, embedder); foreach (EmlDocument eml in mbox.Emails) { var markdown = new EmlToMarkdown().Convert(eml); await rag.ImportDocumentAsync(markdown, metadata: new() { Name = eml.Subject, CustomData = { ["from"] = eml.From, ["date"] = eml.Date.ToString("o") } }); } // Now query across the entire inbox. var answer = await rag.QueryPartitionsAsync( "What did this customer report about the December outage?");
Render every message as a discoverable PDF and persist attachments next to it for legal-hold workflows.
// Render an MBOX archive into one PDF per message for legal hold. var mbox = new MboxDocument(@"C:\archives\2026.mbox"); var emlToPdf = new EmlToPdf(); await Parallel.ForEachAsync(mbox.Emails, async (eml, ct) => { await emlToPdf.ConvertAsync(eml, $@"C:\hold\{eml.Date:yyyy-MM-dd}_{eml.MessageId}.pdf"); // Save every attachment alongside the parent email PDF. foreach (EmlAttachment a in eml.Attachments) { await a.SaveAsync($@"C:\hold\{eml.MessageId}_{a.FileName}"); } });
Classify a fresh email by intent and route the body to the right specialist agent in your registry.
// Classify incoming email and route to a specialist agent. var classifier = new Categorization(vlm); classifier.AddCategory("refund", "Refund or chargeback request"); classifier.AddCategory("technical", "Bug report or technical question"); classifier.AddCategory("sales", "Pricing, demo, or upgrade enquiry"); var emlPath = @"C:\inbox\new.eml"; var eml = new EmlDocument(emlPath); var body = new EmlToMarkdown().Convert(eml); var verdict = await classifier.ClassifyAsync(body); var handler = registry.Get(verdict.Category); // pick the right agent var reply = await handler.RunAsync(body);
The retrieval pipeline that powers RAG over inboxes. Source attribution per email.
Auto-triage incoming email by intent. Pluggable categories.
EML to PDF, EML to Markdown, MBOX to Markdown. Format catalogue for archive workflows.
End-to-end agent that classifies, drafts, and routes incoming email via SupervisorOrchestrator.
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.