UNDERSTORY LABS
L2 Assess · github trending · Jul 27, 2026

microsoft/markitdown

proceedhigh confidence
01 · Fit to Stack
strong fit

markitdown is a pip-installable Python library with no infra dependencies, dropping straight into bud's existing FastAPI + Ollama pipeline. No new services, containers, or accounts required - it runs as a function call inside the existing attachment-handling code path.

02 · Fit to Vision
strong fit

Free, MIT-licensed, runs locally with no API costs or external calls, which matches the operator's self-hosted and budget-conscious preferences. It closes a real, named gap (attachments dropped during classification) rather than adding speculative capability.

Implementation Options
01Integrate into bud attachment pipeline
bud4-6 hourslow risk

Add markitdown as a bud dependency and a small conversion step in the email ingestion path: when an incoming email has a PDF or DOCX attachment, run markitdown on it and append the resulting markdown text to the context passed to the Ollama classifier. Log and skip on conversion failure rather than blocking the pipeline.

+Directly fixes a named, current gap (invoices/contracts/receipts ignored)
+Small, isolated change - one new function plus a call site
+No new infrastructure or ongoing cost
-Classifier prompt/context size grows for attachment-heavy emails, may need truncation logic
-OCR path for scanned/image PDFs adds latency and is lower-accuracy than native text PDFs
02Add as shared preprocessing step in field-notes enrichment
field-notes3-5 hourslow risk

Use markitdown to convert any PDF/document links referenced in trending items before they reach the enrichment agent, so the agent can reason over structured document content instead of skipping non-HTML sources.

+Extends enrichment coverage to document-based sources currently skipped
+Reuses the same library and pattern validated in bud
-Lower immediate value than bud - most trending sources are already HTML/README, not PDFs
-Adds a fetch-then-convert step that increases enrichment latency
01 · Value

bud currently drops PDF and Word attachment content during email classification, so invoices, contracts, and receipts are classified on subject/body text alone. markitdown lets bud extract the actual attachment content - including tables - and feed it to the Ollama classifier, directly improving classification accuracy for the attachment-heavy email categories bud already targets.

02 · Why It Matters

This is a general-purpose document-to-markdown capability, not a one-off fix - once integrated in bud, the same pattern (pip install, call, append to context) is directly reusable in field-notes and any future project that needs to turn binary documents into LLM-readable text, without adding a new dependency class or service to the homelab stack.

03 · What Implementation Looks Like

In bud's codebase, add markitdown to requirements, create a small helper (e.g. app/services/attachments.py) that takes an attachment file and returns extracted markdown text, and call it from the existing email ingestion/classification path when an attachment is a PDF or DOCX. Minimal v1 handles PDF and DOCX only, wraps extraction in a try/except that logs and continues on failure, and appends extracted text to the email body before it reaches the classifier. No UI changes - the visible effect is more accurate classification of attachment-bearing emails.