{"id":19607183,"url":"https://github.com/robocorp/example-llm-emails","last_synced_at":"2025-06-30T21:08:23.603Z","repository":{"id":179429882,"uuid":"663416078","full_name":"robocorp/example-llm-emails","owner":"robocorp","description":"Summarise and extract structured data from emails using OpenAI gpt-4","archived":false,"fork":false,"pushed_at":"2023-07-07T13:17:56.000Z","size":313,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T16:28:21.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robocorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-07T08:38:37.000Z","updated_at":"2025-03-25T14:37:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"d35c9f91-6f17-45b1-83a1-74bbd1028027","html_url":"https://github.com/robocorp/example-llm-emails","commit_stats":null,"previous_names":["robocorp/example-llm-emails"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robocorp/example-llm-emails","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-llm-emails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-llm-emails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-llm-emails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-llm-emails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robocorp","download_url":"https://codeload.github.com/robocorp/example-llm-emails/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-llm-emails/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262850261,"owners_count":23374355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:09:11.284Z","updated_at":"2025-06-30T21:08:23.580Z","avatar_url":"https://github.com/robocorp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI LLM Email Assistant\n\nLearn how to use OpenAI's large language models to summarise, extract information and suggest replies with emails! We've made this for a specific use case described below, but with very little changes to the LLM prompts you can fit this to pretty much any email based context.\n\n## USE CASE - Helping Accounts Receivables Payment Collectors\n\n\u003e Imagine working at a large enterprise company selling industrial goods accross the globe. Invoices your customers are supposed to pay are typically large, so the cash flow impact of a payment date is significant. The team sends out massive quantities of messages about approaching due dates and unpaid invoices, and need to read replies manually and update the information back to accounts receivables solution. \n\nOur automation helps the payment collectors by generating a summary and reply suggestions as well as a list of invoices that are being discussed, with a status based on customer's replies. The bot works in email threads: getting it's inputs as automatically forwarded emails to [Robocorp Control Room](https://cloud.robocorp.com/) (that trigger the bot execution automatically) and then replying back to the same thread. So essentially nothing needs to be installed on the end user machine to use the assistant.\n\nThis is how it looks in practise:\n\n![Example reply email from the bot](/img/email-example.png)\n\n## 👉 This is what the bot does\n\n- Get an incoming email to trigger a bot (in Robocorp Control Room)\n- Read email contents\n- Call [OpenAI](https://openai.com/) `gpt-4` for summary, suggested reply and list of invoices along with their data\n- Take OpenAI response and create an email body (HTML) out of it\n- Use [SendGrid](https://sendgrid.com/) to send the email back to the user's email inbox\n\n## Prerequisites\n\nIn order to run the bot as-is, you'll need the following in place.\n\n- [Robocorp Control Room](https://cloud.robocorp.com/) and Vault connected to your VS Code.\n- [Sendgrid](https://app.sendgrid.com/) account for sending emails. Free accounts were available at the time of writing this for limited usage.\n- [OpenAI](https://platform.openai.com/) account with access to `gpt-4` model.\n- Following Vault entries either exactly spelled as below, or edit the names in code to match your own:\n    - Vault `OpenAI` containing entry `key` that has your OpenAI API key.\n    - Vault `Sendgrid` containing two entries, `SENDGRID_API_KEY` that has your API key and `FROM_EMAIL` that has the \"from\" email address.\n\n## Setting the Process up in Control Room\n\nWhen configuring the process in to Control Room, remember to create an email trigger under `Schedule` step. Also remember to keep the Trigger Process and Parse email checkboxes checked.\n\n![Process Email Trigger screenshot](/img/email-trigger.png)\n\n## Running in VS Code\n\nThe example provides [one email as an example](/devdata/work-items-in/test-email/work-items.json). Use that as a template to create more of your own test work items! When you run the bot in VS Code, remember to choose the given input work item when prompted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-llm-emails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobocorp%2Fexample-llm-emails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-llm-emails/lists"}