Designing an iOS App That Doesn't Generate Every Suggestion: A Supabase Catalog Approach
When an app uses generative AI, it is easy to imagine calling a model for every request. But if reusable suggestions already exist for a condition—and those suggestions can be reviewed before delivery—there may be no need to generate each response on demand.
Kibarashi Recipe's suggestion API checks cached responses and a Supabase suggestion catalog first. It tries on-demand generation only when it cannot obtain a catalog suggestion. This article explains that design and what can and cannot be inferred from the supplied materials.
Which version does this describe?
The distribution record identifies the iPhone app as version 1.0.1 (build 8). The suggestion API behavior described here comes from a separately referenced server-side code version. That server-side code is not bundled with the iOS app; the API can be updated independently. This description therefore does not establish current production behavior.
The order in which suggestions are selected
The request follows this general sequence:
- Reuse a cached response for the same conditions when available. A request for “more suggestions,” which excludes recent results, bypasses the cache.
- If the cache cannot answer, query Supabase for suggestions approved for delivery. The selection uses factors such as situation, duration, age group, and context, and weights candidates by a quality score to choose up to three. If at least one candidate is available, it is returned. The API does not use AI to fill a set that contains fewer than three results.
- Try on-demand generation only when no matching candidate is returned. This applies when the catalog query returns no matching candidate, including when the query fails to produce one, and the AI Gateway is available.
- If generation still produces no suggestion, return a predefined static fallback.
The key decision is not “AI or no AI?” at the start of every request. The API first asks whether it can reuse a response or deliver an existing suggestion.
Generating a suggestion and publishing it in the catalog are different steps
Caching a response generated during a request is separate from registering a suggestion in the catalog approved for delivery. The catalog workflow looks for gaps across conditions, generates candidates in batches, and registers only candidates that have been reviewed.
So a catalog-first design does not mean that AI is never used. It moves generation into a preparation workflow where possible, then reuses reviewed candidates at request time.
Catalogs and on-demand generation: trade-offs
| Dimension | What the design and operations materials indicate | What has not been measured or established |
|---|---|---|
| API cost | A request served from cache or the catalog does not call the online generation API. | Actual billing, cost per request, and a savings percentage are not established. A migration estimate is not realized spend. Preparing, reviewing, and maintaining a catalog may also carry operating costs. |
| Response time | A request answered from cache or the catalog can avoid an on-demand generation API call. | The supplied materials do not establish a same-condition response-time comparison or current end-user latency. |
| Quality | The documented catalog workflow calls for reviewing candidates before registering them for delivery. | The supplied materials do not establish a comparative quality result between catalog and generation approaches or a user-satisfaction outcome. |
A qualitative design comparison: catalog-first vs. on-demand generation
The table below compares design implications, not measured results for this app. The API described here combines a cache, a catalog, and conditional generation.
| Dimension | Catalog-first | On-demand-generation design |
|---|---|---|
| Request-time generation call | A cache or catalog response avoids an online generation API call. Generation is tried only when no matching candidate is returned and the gateway is available. | A request handled by generation calls the online model during the response. |
| Review timing | Candidates are generated in batches and registered in the catalog after review. | The generated response is created while handling the request. The supplied materials do not establish a pre-delivery catalog-review step for that response. |
| Coverage and maintenance burden | Requires checking for gaps, staleness, and bias, then replenishing candidates. | Can reduce the work of pre-populating a catalog, while requiring responses to handle generation availability and output at request time. |
This is a qualitative comparison of design implications, not a measured comparison of cost, latency, or quality between the approaches.
Where this pattern may apply to other generative AI apps
For applications with recurring conditions or answers that can be reviewed in advance, a catalog can hold reusable candidates while generation handles only gaps. This can reduce the number of requests that wait for on-demand generation, but it also requires checking for stale, biased, or missing catalog entries.
The pattern is not automatically suitable when every answer depends on fresh, user-specific information or cannot be reviewed ahead of time. A design should first define which answers are reusable and which genuinely require generation.
Takeaway
Kibarashi Recipe's suggestion API reuses a cached response or a catalog entry when one is available, and tries AI generation only when it cannot obtain a suggestion from the catalog. The described API flow avoids an online generation call for requests served from cache or the catalog; the supplied materials do not establish actual spend or a comparable current latency result. Choosing between these approaches means weighing not only API usage and response time, but also the work of maintaining a catalog and the value of reviewing suggestions before delivery.
References
The App Store link is included only as a distribution reference; it does not establish current server-side behavior.
AI disclosure: Generative AI was used to generate and edit this article draft. Statements about the implementation, audits, and distribution are based on the editorial materials provided.


