Grub AI is a subscription based website that delivers curated poems right into your inbox, and yes with no login required. The poems are not hand crafted sadly. The website leverages ai-agents, thanks to langchain, to generate these poems based on a given set of themes.
Moreover, a set_frequency function, that gets automatically triggered once the emails are verified, lets you decide how often you want your poems.
For fun.
The is a single container, monorepo project. That is, the project is made on FastApi and runs on docker and is hosted at the same port but can be hosted on different services if required. For simplicity the static files were copied inside the backend directory right before deployment so, there is no need to deploy them differently (backend and frontend).
The poem generation is handled by a lightweight LangChain setup:
llm.pyinitializes a local or remote LLM (OpenRouter, SmolLM, etc.)poem_service.pydefines prompt templates and query logic- Themes are passed dynamically to generate fresh poems each time
All output is wrapped into an EmailMessageSchema which contains the poem’s subject and body.
Poems are delivered based on user-defined frequency:
-
A cron-compatible script (
cron_job.py) runs once per day -
Each user is evaluated based on their
frequency(daily,weekly) -
A random theme is selected
-
A poem is generated and emailed to the user
The cron job is triggered via:
- A secure FastAPI route:
/run-poem-cron?key=SECRET - GitHub Actions (daily schedule)


