Skip to content
Wow your usersProduct intelligence

Built-in AI

Add AI features without babysitting messy model output.

You get one simple way to call AI from your server. Answers come back checked and typed, never as a messy string that crashes a feature. Swapping models is one config line, not a repo-wide hunt.

3AI providers ready to use1config file to swap models0API keys in the browser

Interactive example

See it working

This walkthrough demonstrates the implemented backend contract without using an account, credentials, or provider calls.

Interactive example

Explore the implemented decisions

Choose a sample state
Low-latency model route

Deterministic sample data only. No account, provider, or network connection is used by the interaction.

Highlights

Why it matters

Answers come back checked

Every AI response is tested against your schema before your code ever sees it.

Keys stay on the server

Provider API keys live in server settings and never reach the browser.

Swap models in one line

One config file picks the provider and model, so upgrades never touch your features.

The problem this solves

Without a shared foundation, every team rebuilds these edge cases — differently.

One bad response takes down a feature

The model returns broken JSON at the worst moment. Your code trusted it. Now a customer-facing feature is crashing. Here, bad output fails loudly at the boundary, not in your UI.

A key drifts into the browser

AI calls get sprinkled wherever it's convenient. One lands client-side, and your API key ships to every visitor. Here, every call runs on the server. Full stop.

A model upgrade touches every file

Your provider retires a model. Suddenly you're doing a find-and-replace across the whole codebase. Here, it's one line in one config file.

How it works

The mechanism end to end, as implemented in the repository.

  1. 1

    You call it with a feature key

    Your server code asks for text or a structured object, tagged with a feature key. One config file decides which provider and model handle it.

  2. 2

    The call runs on the server

    The matching OpenAI, Gemini, or Anthropic adapter runs with server credentials. Nothing AI-related ships to the browser.

  3. 3

    The answer is checked at the door

    The response is parsed against your schema before your code sees it. Broken output fails loudly instead of leaking through.

  4. 4

    You get a typed result

    Your code receives a clean object plus token usage, provider, and model. Never a raw string to re-parse.

Engineering guarantees

What this does and does not promise

Safety boundary

Three providers come wired in, but the kit won't auto-switch if one goes down. Live generation still needs your own provider key.

Implementation evidence

The boundary above is code, not a claim. These files carry the contract:

  • src/features/ai/runtime.ts
  • src/features/ai/contracts.ts
  • config/ai.ts
Questions

Frequently asked questions

Related capabilities

These capabilities share contracts and boundaries with this one.

Build on the built-in ai foundation

The docs describe the same contracts this page demonstrates.