examples · everything below ships in the repo · most are CI-tested

Don't start from zero.
Start from working.

Each card names its repo path and how to run it. The agent examples use a deterministic mock LLM provider where possible, so they run in CI with no keys — the parts that need a real key say so.

[ai]

The full-stack AI app

A React chat UI, a Bun API running a real server-side agent loop (model → tool_calls → execute → final answer) through the gateway, and the whole app exposed as an MCP tool — one binary, one origin.

  • riz new ai-chat && cd ai-chat && riz --dev
  • Boots offline first try — the mock provider drives the full tool loop
  • Anthropic / OpenAI / Ollama = a riz.toml edit; the handler never changes
  • Same loop, no code: an [agent] block makes the binary a delegable A2A agent
CI: ai_chat_agent_loop_works_end_to_end
examples/ai-chat →
[app]

Full-stack todo starter

The other scaffoldable starter beside ai-chat: a Bun API and a React/Vite client colocated on one binary, one origin — no second host, no CORS. riz new typescript-todo.

  • Static client + API served by the same process
  • Scaffolds, builds, and boots in CI
CI: api_and_client_are_served_on_one_origin
examples/typescript-todo →
[mcp]

Agent tools, zero glue

Three plain functions — lookup_order, list_inventory, create_ticket — that auto-become typed MCP tools, including a typed JSON-Schema body.

  • riz --config examples/riz.agent.toml run
  • Order 1042 is seeded delayed — the canonical demo path
CI: agent_tools_are_mcp_tools_and_callable_over_riz_mcp
examples/lambdas/agent-tools →
[sdk]

Claude Agent SDK, single task

A Python Agent SDK script that discovers riz tools over MCP and completes a conditional task — look up an order, open a ticket if it's delayed.

  • Needs ANTHROPIC_API_KEY + a running riz
  • The riz side is just the config above — no SDK code
substrate proven in CI; the live run needs a key
examples/agent-sdk →
[loop]

Multi-step loop + token cost

An agent loops over a batch of orders, chaining tool calls — the case where "what did this request cost in tokens?" stops being trivial.

  • Token usage rolls up the OTel span tree per request
  • Same totals live in the --dev Tokens panel
CI: multi_hop_agent_chain_rolls_up_token_usage_across_the_tree
examples/agent-loop →
[wasi]

Real compute in the sandbox

A wasm32-wasip1 handler that validates and prices an order entirely under WASI — deny-by-default, sub-ms cold start, not an echo toy.

  • Integer-cents pricing, deterministic across hosts
  • Persists the priced order through a host-brokered db (Postgres) grant — best-effort, no DSN in guest memory
  • 422 with a structured error on invalid orders
CI: wasm_orders_prices_a_valid_order
examples/lambdas/orders-wasm →
[ws]

WebSocket, the AWS way

A Bun chat handler on the API Gateway v2 WebSocket contract — $connect, $default, $disconnect — with server→client push over @connections. Also callable as an MCP session tool.

  • Real per-connection lifecycle, not long-polling
  • Python + Rust WS mirrors live in the parity suite
CI: ws_functions_are_tools_with_session_semantics
examples/lambdas/chat →
[rest]

Plain REST, all five verbs

The canonical "how do I build an HTTP API" example — GET/POST/PUT/PATCH/DELETE over /accounts/{id} with method dispatch, an in-memory store, and response-cache read receipts. No framework, just the AWS handler shape.

  • Path params typed from the route template
  • Cache TTL + servedAt receipt shows cached vs fresh
boots via examples/smoke-all.sh
examples/lambdas/crud-accounts →
[authz]

REQUEST authorizer, allow + deny

The API Gateway simple-response authorizer contract as two tiny handlers: auth-allow-bun authorizes and hands context to the handler; auth-deny-bun is the 401 path — distinct from the JWT/JWKS config recipes below.

  • Authorizer context reaches the handler on allow
  • Deny short-circuits before the handler runs
CI: request_authorizer_allows_valid_token
examples/lambdas/auth-* →
[par]

The parity matrix

The same echo handler in Bun, Node, Python, Rust, Go, and WASM — six runtimes asserted byte-equivalent by CI. Want the "how do I write a handler in X" reference? riz new scaffolds one per runtime.

  • echo-bun · echo-node · echo-python · echo-rust · echo-go · echo-wasm
  • Plus WebSocket mirrors (chat-python · chat-rust)
CI: the runtime_parity_* test family
tests/fixtures/parity →
[cfg]

Config cookbook

Working riz.toml files for every posture — every one parsed and validated by the test suite, so the cookbook can't rot.

  • riz.agent.toml — the MCP/agent demo fleet
  • riz.prod.toml — telemetry, auth, deploy gating
  • riz.workos.toml · riz.clerk.toml · riz.jwt.toml — JWT/JWKS auth recipes
CI: every_example_config_parses_and_validates
examples/*.toml →
the rule If an example stops working, CI fails — the cookbook is part of the suite, not documentation that rots. And because these handlers are AWS-Lambda-shaped, CI also boots AWS's own official Lambda sample (awslabs' http-basic) on riz unmodified (CI: aws_official_samples_run_on_riz_unmodified). Browse all examples ↗