Crates.io | maildir_ai |
lib.rs | maildir_ai |
version | 0.4.0 |
source | src |
created_at | 2024-10-18 01:56:03.83314 |
updated_at | 2024-10-20 12:33:20.263253 |
description | maildir_ai connects a maildir to your LLMs |
homepage | |
repository | |
max_upload_size | |
id | 1413783 |
size | 63,577 |
A way to live in the past of the future.
Visit the non-interactive demo of maildir-ai in action.
maildir.ai connects to large language models via an email interface. Specifically, maildir_ai watches a maildir directory for new messages, and then sends them to a language model for processing. The language model then generates a response, which maildir_ai "sends" back to the sender.
I've been using it to help me brainstorm ideas for my research. Specifically, I've been using it to help myself solidify my thoughts on Blue, a new system I've been working on in my spare time.
The interface to maildir-ai is not complex. If you have ollama running, set the OLLAMA_HOST variable to point to it. Then:
$ cargo install maildir_ai
Initialize a new knowledge base by running:
$ maildir-ai init ~/knowledge-base "Your Name Here"
This will do two things: It will initialize a standard maildir at ~/knowledge-base (you can change this to anything you like), and it will configure a .muttrc within knowledge-base that is a starting point for interacting with the maildir-ai as "Your Name Here". Obviously, if that's not your name you should change it.
In a separate background terminal, so that you can run and monitor a background daemon, run:
$ maildir-ai maintain ~/knowledge-base
This will watch the maildir for new messages in Sent and process them. It will send the email as the prompt verbatim to the language model, and then save the response in INBOX. This sounds backwards, but the next step will explain why.
In your main terminal, run:
$ maildir-ai mail ~/knowledge-base
This will open mutt, my favorite email client, with the maildir-ai knowledge base. It opens to INBOX, which is where the responses are saved. You can then compose new messages or reply to existing messages and they will be saved to Sent as if you really composed them in an email. No actual email is sent, it just gets saved to ~/knowledge-base/Sent/cur/. The maintain process watches this directory for new messages and processes them, moving the saved message back to the INBOX when it begins processing the message. This way, you can see the response to your prompt in the same thread as the prompt itself.
That's it. That's the basics of maildir-ai.