LLM-enhanced email archive
I had an idea for a project and posted to Mastodon
I want an LLM trained on my 20+ years of email archives. Needs to be private to me. Is it straightforward and not too expensive for me to set something like that up just for myself for occasional use?
Main use would be a query for specific things, “what did I say to this friend 10 years ago about music?” But also just for general knowledge. I think it’d mostly work as free text but there’s a little email-specific structure it’d be nice to capture.
I got an interesting variety of replies, ideas collected here.
I gather there’s at least three different methods that could apply. Most folks suggested #2, RAG.
- LoRA training, which alters the core LLM weights
- Retrieval Augmented Generation which augments LLMs with a document store it can select from and use to tune replies. Sort of a formal version of...
- using a big context window and preloading the query with stuff
I think 2 and 3 are in common use now for consumers. But 1 is still more specialist and requires you have your own LLM inference engine.
One recommendation I got was to use SillyTavern, a consumer LLM wrapper for role playing game players. It does RAG for you: you give it a bunch of documents and it manages LLMs for you and lets you talk to it. I bet it has a lot of the plumbing I need. This suggestion also reminds me there’s a world of porn AI enthusiasts too, all DIY with local models to work around censorship. They may have some interesting tech.
Mark Fletcher (who runs an email service) gave me a great reply about how he mixes RAG with ElasticSearch. Useful notes but pretty involved, would be a lot of work. I should give his feature a try though and see how well it functions.
Update: Justin Mason reminded me of his personal GMail archive project: he indexed 20 years of email from Google in a local system using notmuch. No LLM in this work but could be a useful related component for the email retrieval part.
I’m not interested enough in this to build a whole product, I was more wondering if I could just hack something up by throwing a wall of text at an LLM. I think RAG is the tool to do that, paired with ollama or deepseek.
The other question is where to run it. My email is very private, I don’t want to ship the archive off to some untrusted provider. “A big Mac at home” is one common suggestion. I’ve been thinking about leasing a cloud machine to use on demand. I think a PC at home with an nVidia 3xxx may be sufficient to at least prototype.
Update August 2025: it’s been a few months and some things exist.
- Tutorial for hacking your own (uses LangChain and Chroma DB)
- OnPrem, a Python toolkit
- Some notes from a hacker
- Suggestions from ChatGPT 5