DEV Community

Cover image for My Android AI agent writes every file as Markdown first. Here's why that made DOCX, XLSX and PDF less painful
Grokkris
Grokkris

Posted on

My Android AI agent writes every file as Markdown first. Here's why that made DOCX, XLSX and PDF less painful

I'm building Kryzz AI, a free, open-source (MIT) Android app for chat, voice and agent tasks. One thing people actually use the agent for is getting a real file at the end: a report as a DOCX, a table as an XLSX, something you can send as a PDF.

Three formats get messy fast if each exporter has its own idea of what a heading or a table is. A table can look fine in one format and come out flat in another, and fixing one can break the next.

So in v1.1.2 all three share one Markdown model.

What that means in practice

The agent writes its output once, as structured Markdown. Then each exporter reads the same structure:

  • Headings and lists come out as real headings and lists in the DOCX, not bold text pretending to be a heading.
  • Tables keep their shape across DOCX and PDF.
  • Spreadsheets get typed cells. A number stays a number, so you can actually sum a column in the XLSX instead of fighting text that looks like numbers.
  • Multi-sheet workbooks work, so a research task can put sources on one sheet and the summary on another.
  • PDFs handle Unicode, which matters to me because I write in both English and French.

Why I like this setup

  • The model only has to be good at one thing: writing clean Markdown. Models are already decent at that.
  • When an export looks wrong, there's one place to look.
  • Adding a new output later should mostly mean writing one more exporter, not teaching the agent a new format.

The rest of the loop, briefly

The file is the last step. Before it, the agent keeps a live checklist plan, runs searches and page reads, and for substantial answers does one review pass against what the tools actually returned. Under each answer there's a work log ("3 searches · read 4 pages · 1 file") so you can see what it did. There's also a per-turn cost cap (default $0.25) because you bring your own OpenRouter key and pay for your own usage.

Honest notes

  • The models are not on-device. Requests go from your phone to OpenRouter (or the optional providers you turn on). No analytics, no telemetry, no bundled keys.
  • Generated files stay in private app storage until you share them.
  • The APK on the release page is a debug build, Android 9+.

Try it

If you've built document export on Android, I'd like to know what you used and what broke. And if you try the app, tell me which file type comes out worst. That's the one I'll fix next.

Top comments (0)