Laravel + LLM = Automated Email Reports (and more)

Alfred Nutile
2 min readMay 25, 2024


Business use case:

I would like to have a report sent to all the managers at the end of the week about emails that came and a summary of recommended next steps.

But lets break it down into a more reusable concept.

The Building Blocks


Data comes in from Email, Webhook, Document upload by the user, by the API and more.


Convert the Source data into Contacts, Sales Emails, Support Emails, Documents to Text, and make it searchable in our Vector Database. Also pass to the LLM this text to pull out the “Summary”, “Gist”, or “Compare to our collection of “Best Practices”

This example will check an email box, find emails related to the “Collection” so you can auto reply to the email eg Support, or a GitHub PR will feedback.


This is one of many areas you can store your data to build these automations around. You can share this with a team as well so you can all use the data or build it up.


Send it as an emails, connect to it as an API, Chat with it via the api etc or use it’s API. Get to the data in many ways.

So this foundation becomes building blocks, like Lego bricks that can be used in so many ways. This leaves you building the core of this once, just like we use WordPress for a CMS now we can use Laravel for a RAG system

RAG system (Retrieval augmented generation system (RAG — an architectural approach that can improve the efficacy of large language model (LLM) applications

Read the docs here to learn more

Or go use the code for you own



Alfred Nutile Open-Source Product Created Day to day developer using Laravel, PHP, Vue.js, Inertia