Build AI-driven apps
Before you start: the basics and host actions.
Suppose someone asks your app to plan a weekend. A text response can suggest places to visit. An interactive response can also let them select a stay, change the number of nights, and save the plan. They can make those changes directly, without writing another prompt for each one.
In an AI-driven app, the agent chooses or composes an interface while the app is running. The interface depends on what the person asked for and the data available to answer them. It might be a comparison, a checklist, a form, or a small tool embedded in a conversation.
This is separate from using a coding agent to develop your app. Here, generating an interface is part of the product your users interact with.
Try the controls, then edit the XML to change the response. This example is prewritten and runs locally in the browser. The assistant tutorial shows how to generate and save responses in the native example app.
Why use Relo for the response?
The response can contain a new layout
Your app doesn't need a hard-coded screen for every possible answer. The model returns a Relo subtree and JSON data. It can arrange the components your app supports, bind them to the results it found, and add interactions.
A travel assistant could show two stays side by side for one request and a checklist for another. You decide which components and actions are available. The agent works within that vocabulary.
It renders with the app's native UI
Relo renders documents with UIKit on iOS and Android Views on Android, with a DOM renderer for the web. Generated UI uses the same rendering path as UI you write yourself. Native controls handle editing and interaction; shared styles and transitions keep the response consistent with the rest of the app.
The included live assistant is currently hosted on iOS. Its backend and XML are shared, but connecting generated responses to an Android or web app requires the corresponding host integration.
Components give the model a starting point
You can give the model your own cards, forms, and selectors instead of asking it to design every element from scratch. The assistant example includes ui:TaskList, ui:CartReview, and ui:PhotoOption for common responses. Their XML already handles layout and repeated interaction details.
The included authoring skills explain how to compose them, including mobile sizing, accessible labels, and state ownership. The model can customize a response while reusing code you have already tested.
Interactions don't need another model response
Expanding details or changing a selection can update local state immediately. Saving a task can call a registered service directly. The model is needed when the user asks for a new answer or layout; it doesn't need to be involved in every button press.
Your backend remains responsible for stored data and business rules. A generated button asks to perform an action through your app's registered service, which checks the request and returns the result.
You can verify it before showing it
The assistant backend assembles each candidate, checks it with the shared engine, and runs the model's interaction trace with mocked service results. It corrects recognized authoring mistakes locally and asks the model to repair unresolved errors. Only a verified candidate becomes a card in the conversation.
That catches problems such as an unsupported component, a wrong prop type, or a button that doesn't produce the asserted result. See verification and correction for what is checked and what still needs native testing.
Follow a response through the app
- The user asks for a task list.
- The agent calls a backend tool to create the list and receives its ID and items.
- It returns XML, data, and an interaction trace.
- The backend assembles and verifies the document, then stores the response.
- The app mounts the document in a native card.
- Checking an item calls the list service. The service saves the change and returns the updated list; no model call is needed.
A later prompt can ask for a different layout of the same list. The agent reads the saved data and generates a new view without starting the list over.
Build one
Follow Build a task-list assistant to run the example, inspect its generation contract, verify an interaction, and connect the result to persistent state. The guide also points to the code you can adapt for your own application.