Fonik
Projects | | Links:

Personal AI email assistant: a Python MCP server with local embeddings and ChromaDB retrieves my most similar past replies, and an LLM drafts new ones in my style. Nothing is sent without review.
Status: working, private by design. Fonik is a tool I built for my own inbox: it drafts replies to my university email in my own writing style, drawing on years of my past answers. The complete workflow runs end to end against the live mailbox, from retrieval to a finished draft waiting in a mail folder.
At a glance
| For | My own inbox: university email, almost entirely Greek |
| Stack | Python MCP server, local embeddings, ChromaDB, IMAP |
| Corpus | 3,655 of my past email exchanges (2018-2026), indexed locally |
| Privacy | Corpus and embeddings never leave the machine; the LLM sees only the email at hand plus a few similar exchanges |
| Guardrail | Nothing is sent automatically: every draft waits in a folder for my review |
The problem
A university instructor’s inbox is repetitive. Students ask the same questions semester after semester: grades, deadlines, course logistics, thesis coordination. I receive 5 to 10 emails a day, and my sent folder holds years of replies that already encode my tone, my phrasing and my typical answer to each kind of question. The tedious part is not reading; it is writing the same reply again with small variations.
Off-the-shelf tools do not fit this problem. The university mail runs on an on-premises Exchange server, so the only programmatic access is plain IMAP; there is no Gmail or Microsoft 365 API for the usual AI email products to plug into. The content is Greek, which generic assistants handle poorly. And the correspondence of a university inbox should not be handed wholesale to a cloud service. Those three constraints together, IMAP, Greek, privacy, ruled out everything I surveyed and defined what I built instead.
The approach
Fonik learns my style through retrieval, not training. Every reply I have sent is paired with the email it answered and indexed in a local vector store. For a new email, the system finds my most similar past exchanges and hands them to the LLM as examples; the draft comes back in my register, shaped by how I actually answered that kind of question before. Compared to fine-tuning a model, this needs no GPU, stays transparent (I can inspect exactly which examples informed a draft), and updates by simply indexing new mail.
The architecture is deliberately minimal. Fonik is a Python MCP (Model Context Protocol) server: a set of email tools, from fetching and searching to thread following and draft saving, exposed to an LLM agent. There is no bot, no background daemon, no web interface; a Claude Code session is the user interface, and the mailbox itself is the source of truth. An earlier design had a Telegram bot, an orchestrator and a scheduled pipeline; all of it fell away once it became clear that an agent session with the right tools already is the assistant.
Local by design
The privacy-sensitive work happens entirely on my machine. The multilingual embedding model, chosen after a comparative evaluation on Greek email (semantically related messages must cluster together regardless of wording), runs locally on CPU; the vector store is a local ChromaDB directory; the corpus never leaves the machine. Only at draft time does anything reach the LLM: the email being answered plus the five most similar past exchanges, a small and controlled slice. Retrieval matches on content, not sender, and student senders are bare registry mailboxes rather than names. Beyond the LLM call itself there is no cloud in the system, and the intended permanent host is a low-power mini PC (Intel N100 CPU), always on and reachable over SSH.
The build
The unglamorous half of the work was the mailbox itself. The Exchange server returns HTML-only messages in a mix of Greek encodings, caps searches at 250 results, and buries every reply under quoted thread history. The importer works month by month around the search cap, strips quoted text so only new content is indexed, and pairs each sent reply with the email it answered by following threading headers, with a 92.7 percent match rate on recent years. The result is a corpus of 3,655 clean question-and-answer pairs from eight years of mail, students and colleagues both.
In use
The flow is short: list what is unread, pick the emails worth answering, ask for drafts. Each draft is composed as a proper reply, with correct threading headers and the quoted original, and saved to a dedicated folder over IMAP. From there it appears in every mail client on every device; I read it, edit what needs editing, and send it myself. In the first end-to-end test on a real email, retrieval surfaced past exchanges about the exact same course at 0.92 similarity, and the draft came back correctly threaded, in my register, waiting in the folder.
More than anything, Fonik started from genuine curiosity: I wanted to see whether a system like this could be designed and built to be effective and efficient. It was a fun project, and it ended up being useful as well.