microsoft/markitdown
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.
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.
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.
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.
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.