Order desk agents
Run the order desk backend with Google ADK, LangGraph or Pydantic AI. Use scripted responses, Ollama or Gemini.
The order desk has a reference backend for each of these frameworks.
| Folder | Framework | AG-UI |
|---|---|---|
| adk | Google ADK | ag-ui-adk |
| lang-graph | LangGraph | ag-ui-langgraph |
| pydantic-ai | Pydantic AI | built in |
Each agent fills a B2B order from an e-mail. Its backend tools look up the customer and order history. The screen's data arrives in each run's AG-UI context, and its listed methods arrive as tools. The agent changes the order by calling those methods in the app.
The backend guide explains the contract and adapter configuration. The three implementations share their customer data, backend tools, instructions, scripted responses and contract tests in order-desk.
Install uv. Run the commands below in a backend's folder, such as example/.
Run
For scripted responses without a model or API key, run this command.
TANDEM_FAKE_LLM=1 uv run order-agentFor a local model, start Ollama at http:/, download the model and start the backend.
ollama pull qwen3.5:4b
uv run order-agentThe reference agents disable thinking for Ollama.
For Gemini, set GOOGLE_API_KEY in the backend's environment, then run this command.
TANDEM_PROVIDER=gemini uv run order-agentThe server listens on 127. and accepts AG-UI requests at POST . Any server-side conversation state lives in memory and is lost on restart. Pydantic AI reads the conversation from the app's messages on every run.
Configuration
| Variable | Default | Meaning |
|---|---|---|
TANDEM_FAKE_LLM | Set to 1 for scripted responses. | |
TANDEM_PROVIDER | ollama | ollama or gemini. |
TANDEM_MODEL | qwen3., gemini-3. | The provider's model name. |
TANDEM_OLLAMA_URL | http:/ | Where Ollama listens. |
TANDEM_TODAY | 2026-10-16 | The date the demo treats as today. In the sample e-mail, "by Friday" means 2026-10-23. |
TANDEM_HOST | 127. | The bind address. Use 0. to connect a physical device over the local network. |
TANDEM_PORT | 8000 | The port to listen on. |
GOOGLE_API_KEY | The Gemini API key. |
The backends have no sign-in. With TANDEM_HOST=0., anyone on your network can use the agent. If it uses Gemini, their requests spend your model credits. Use the default bind address when connecting from a simulator or emulator. The connection instructions give the URL for each platform.
The script
This scenario uses the backend's scripted model and the order desk's sample e-mail.
| # | You | The agent | The screen |
|---|---|---|---|
| 1 | Tap the sample e-mail | find_customer, get_order_history | Nothing yet |
| 2 | set_customer, two times search_catalog | The customer card fills in | |
| 3 | "I assumed the ProView 27Q, as in your September order ORD-0987." set_quantity for both products, set_delivery | Lines, prices, address and date appear | |
| 4 | "40 HDMI cables and 12 ProView 27Q monitors, delivered on 23 Oct. Total 14 349.44 PLN. Shall I place it?" | ||
| 5 | Tap + on the monitors until 15, type Looks | "You changed the monitors to 15, which unlocks Acme's 15+ tier (17 % off monitors)." place_order | Prices update on each tap. An approval card opens. |
| 6 | Tap Approve | "Order ORD-1042 placed for 23 Oct." | The card shows Approved. The order is marked "Placed as ORD-1042" and becomes read-only for the user and agent. |
To test invalidation, change the delivery date instead of approving in step 6. The old request becomes invalid. A second after your last edit, the example wakes the agent. The scripted backend requests approval again with the new date. Tap Reject, and it answers "OK, I won't place it."
The example implements this wake-up with session.. Tandem does not start a new run automatically when an edit invalidates a pending request.
Checks
uv sync --locked
uv run ruff check . ../order-desk
uv run ruff format --check . ../order-desk
uv run pytestIn adk, both ruff commands also take ..
All three backends run the shared AG-UI contract tests. They use scripted responses over HTTP and a test client that maintains the thread as Tandem does. ADK and Pydantic AI also have adapter-specific tests in their tests folders.
CI runs these checks for each backend. Tests with Ollama or Gemini are manual.