Introduction
Give an AI agent the data and methods of an existing Flutter screen, with approval for the calls that need it.
Your screen's state class lists the data an agent can read and the methods it can call. Those methods use the same validation as your buttons. Calls marked for approval wait for the user. With GenUI, the agent also draws views as A2UI components, built from your widgets. The rest of the app keeps its existing UI and state management.
How it works
A remote agent communicates with the app over AG-UI. It receives the screen's data and the current list of methods on each run. Your backend keeps the model, its API keys and its tools. Tandem works with backends that follow the backend contract, with reference implementations on Google ADK, LangGraph and Pydantic AI. Without a backend, the app connects to Gemini through Firebase AI Logic.
Your state class declares the agent's capabilities:
List<AgentCapability> get agentCapabilities => [
.sees(draft),
.calls(setQuantity),
if (draft.lines.isNotEmpty) .callsWithApproval(placeOrder),
];.sends the current draft to the agent.sees(draft) .exposes the method your buttons call, with the same validation.calls(setQuantity) .runs the method after the user approves the request.callsWithApproval(placeOrder)
In a debug build, your coding agent can call the same methods through TandemBridge.
Tandem is 0.x. Its core API gets no breaking changes before 1.0, and the rest can change in a minor release.
Where to start
- Your coding agent adds Tandem to a screen and fills a form in the running app.
- Quick start walks through the integration by hand.
- An in-app agent connects a backend and builds the chat.
- Try it without a key runs the scripted order desk.