Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markjacksonfishing/juliemail
JulieMail is an AI-powered email assistant that helps you save time and improve your productivity by automating some email tasks and generating personalized email replies using state-of-the-art natural language processing models.
https://github.com/markjacksonfishing/juliemail
Last synced: 8 days ago
JSON representation
JulieMail is an AI-powered email assistant that helps you save time and improve your productivity by automating some email tasks and generating personalized email replies using state-of-the-art natural language processing models.
- Host: GitHub
- URL: https://github.com/markjacksonfishing/juliemail
- Owner: markjacksonfishing
- License: mit
- Created: 2023-03-19T17:18:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-19T18:24:15.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T00:03:24.385Z (about 2 months ago)
- Language: Go
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# juliemail
This morning, as a joke to show Julie the power of ChatGPT, I quickly wrote an email reply engine to answer her emails. The idea was simple: if the user was in her contacts, ChatGPT would tailor the message to be more specific based on a label Julie uses for the relationship. Adding more weighted labeling gave even more tailored responses.
## How It Works
The email reply engine is written in Golang and uses the `github.com/emersion/go-imap` and `net/smtp` packages to connect to an email server, fetch incoming messages, and send email replies. The `github.com/openai/openai-go/v2` package is used to generate the email reply text using ChatGPT4.
Here's a quick overview of how the code works:
1. The `main()` function connects to an email server, fetches new messages, and generates email replies using ChatGPT4.
2. The `senderInContacts()` function checks if the sender's email address is in the user's contacts.
3. The `getLabelForSender()` function gets the label or tag associated with the sender's email address.
4. The `generateReply()` function generates the email reply using ChatGPT4 based on the label or tag associated with the sender's email address.
5. The email reply is sent to the sender's email address using the `smtp.SendMail()` function.## Usage
To use the application, follow these steps:
1. Clone the repository to your local machine.
2. Replace the authentication details for the email server in the auth variable in the `main()` function.
3. Replace the server details for the email server in the `client.DialTLS()` and `smtp.SendMail()` functions in the `main()` function.
4. Replace `YOUR_API_KEY_HERE` with your actual OpenAI API key in the `generateReply()` function.
5. Implement a database or file to store the user's contacts and their labels and modify the `senderInContacts()` and `getLabelForSender()` functions to use this data.
6. Run the application using `go run main.go`.## Improvements
This code was written as a quick proof-of-concept and should not be used in production environments without additional security measures and extensive testing. Here are a few ways that the code could be improved:
1. Add error handling code to gracefully handle any errors that may occur during the email processing.
2. Implement more sophisticated methods for detecting the sender's label or tag, such as using machine learning algorithms to analyze the content of the email.
3. Use a more secure method for storing the user's contacts and their labels, such as a database with encryption and access controls.
4. Implement more advanced email handling features, such as support for attachments, HTML emails, and multiple recipients.
5. Add logging and monitoring features to track the performance and usage of the email reply engine.