AI-Powered App Features
Add AI-powered behavior to a Buzzy app with Buzzy Functions, Constants, code widgets, Builder MCP, tests, and security review.
This example is about adding AI behavior inside a Buzzy app.
It is different from using AI to build the app. Builder MCP and Buzzy AI help create and edit the app definition. AI-powered app features are runtime capabilities that users interact with, such as summarising a record, drafting a response, classifying a submission, extracting fields from text, or chatting with domain-specific context.
Pattern Overview
Use Buzzy Functions for AI service calls. Keep API keys in Constants. Use standard Buzzy screens and actions for simple workflows. Add code widgets only when the interaction needs a richer UI than standard Buzzy components provide.
Store API keys and model config
Constants
Call OpenAI, Anthropic, Gemini, or another provider
Buzzy Function
Capture user input and selected row context
Buzzy screen action
Display simple output
Standard fields, modals, or result records
Display streaming, chat, advanced review, or side-by-side comparison
Code widget
Change the app definition safely
Builder MCP
Verify the workflow
Release Tests
Review sensitive data and access
Security Review
Example Use Cases
Summarise a support ticket or case record.
Draft a reply for a reviewer to approve.
Classify an inbound request by type, urgency, or risk.
Extract structured fields from pasted text.
Generate a first-pass checklist or action plan.
Compare two records and highlight differences.
Provide a domain-specific assistant over approved app data.
Recommended Build Flow
Update the brief to describe the AI feature, who uses it, and what the output is allowed to do.
Confirm the data model has fields for input, output, status, review, and audit notes where needed.
Create Constants for provider keys, model names, base URLs, and safe configuration.
Create a Buzzy Function with a clear input and output contract.
Wire the function to a screen action.
Add a code widget only if the UI needs chat, streaming, rich comparison, or custom controls.
Add Release Tests for happy path, error path, and permission-sensitive path.
Run Security Review if the feature can access personal, operational, financial, health, education, customer, or internal data.
Function Contract
Keep the function contract explicit. A good AI function declares:
required inputs from the screen or row
constants it depends on
the model/provider it calls
maximum input and output size
what data must never be sent to the provider
structured JSON output
user-facing error messages
sample payloads for tests
Example output shape:
Prompt and Data Safety
Do not send more data to an AI provider than the feature needs.
For sensitive apps:
filter row data before calling the function
exclude Private Data unless there is a clear approved reason
keep prompts server-side
avoid placing secrets or private policy text in code widgets
store generated output where the same field-level access rules apply
require human approval for actions that affect users, money, compliance, or records of authority
Builder MCP Instructions
Builder MCP can help generate the function, constants, widget, and screen wiring.
Example instruction:
When to Use a Code Widget
Use a code widget when standard Buzzy UI is not enough:
conversational chat
streaming response display
side-by-side diff or compare UI
token/cost meters
rich prompt controls
interactive review workflows
Do not use a code widget just to call the AI provider directly from the browser. The provider call should stay in a Buzzy Function so keys and sensitive logic stay server-side.
Testing Checklist
Function succeeds with realistic input.
Function fails safely when the provider is unavailable.
Function rejects missing or malformed input.
Unauthorized users cannot trigger the action.
Sensitive fields are not sent unexpectedly.
Generated output is stored in fields with correct access rules.
Release Tests cover the main workflow.
Security Review findings are addressed before release.
Related Pages
Last updated