This project demonstrates how to build an AI-powered dinner menu generator using Inngest and Weaviate. The application uses RAG (Retrieval-Augmented Generation) to create personalized dinner menus based on cuisine preferences and dietary requirements.
- Cuisine-based recipe suggestions
- Dietary restrictions and allergies handling
- Wine pairing recommendations
- Detailed shopping list generation
- Automatic ingredient substitutions based on preferences
To run this project, you'll need:
- Node.js installed
- A Weaviate Cloud instance
- OpenAI API key
- Inngest account (optional for local development)
- Clone the repository
- Create a
.env
file with the following variables:
OPENAI_API_KEY=your_openai_key
WCD_URL=your_weaviate_cloud_url
WCD_API_KEY=your_weaviate_api_key
src/inngest/events.ts
This file defines the events used to trigger our workflow.
The project comes with the event later used in our example to trigger the Christmas dinner generation workflow.
Events are composed of:
- a mandatory
name
- an optional object as
data
The events are created with zod
and passed to the Inngest client, enabling an E2E-typed experience.
src/inngest/functions.ts
This is where our workflow is defined, using inngest.createFunction()
.
Inngest Functions are composed of multiple steps, enabling you to write workflows relying on independently retriable steps.
Our first workflow is a simple example of multiple “hello worlds”.
src/server.ts
Inngest Functions are exposed to the Inngest Dev Server via a simple express server.
Load the recipe and wine pairing data into Weaviate:
npm run load
- Start the Express server:
npm run start
- Start the Inngest server:
npm run inngest
- Open the Inngest DevServer UI at http://127.0.0.1:8288 and trigger a new runs from the Functions tab using the following event data:
{
"data": {
"participantsCount": 4,
"preferences": ["no nuts", "vegan"],
"cuisine_type": "Italian"
}
}
Once the workflow is triggered, you can see the run in the Inngest DevServer UI.
- Receives meal generation request with preferences and participant count
- Queries relevant recipes from Weaviate based on cuisine type
- Analyzes dietary restrictions and allergies
- Suggests ingredient alternatives if needed
- Generates a complete dinner menu with wine pairings
- Creates a detailed shopping list