LLMs have gotten so good at building user interfaces inside an IDE, it starts to beg the question – what would happen if we let the LLM just write the interface code on the fly, as the user is interacting with the application?
To test this idea I built a small app that generates custom review forms based on the product you are reviewing. Type in "DeLorean Sports Car" and it creates a form asking about acceleration and handling. Type in "wool sweater" and it asks about fit and itchiness. The form builds itself based on the product description.
Under the hood, it's pretty simple:
- You enter a product name/description
- An LLM analyzes what kind of product it is
- It generates a custom form with relevant questions
- The form renders in real-time with product-specific fields
The coffee maker form asks about brew quality and ease of cleaning. The sofa form asks about comfort and style. Each form starts with some general questions (overall rating, pros/cons) then adds category-specific stuff.
Back in December 2023, Google posted this demo video showing an AI that generated custom UI components on the fly. The user asks for birthday party ideas and the application responds with an interactive widget. What caught my attention was that the widget wasn't pre-built—the system was basically running through a mini software development cycle in real-time.
I wanted to see if I could build something similar but simpler. Review forms seemed like a good test case because they need different fields for different products, but the basic structure stays consistent.
What Worked:
- The LLM is surprisingly good at figuring out relevant questions for different product categories
- Form generation is almost fast enough to feel real-time (the latest Gemini Flash would probably ace this)
- The basic concept actually works!
What Didn't Work:
- Sometimes generates redundant questions, or puts the questions in an odd order
- Occasionally misunderstands ambiguous product categories (eg "Apple")
- No memory between sessions, so the same product may have a different set of form fields each time
I built this to see if it would work at all. It does! I may try applying some of these ideas to Flavorful, or another project that could benefit from a malleable user interface.
The source code for the review form builder project is available on Github.