AI Features
AI Services
AI Services let you create reusable, structured AI workflows for your app. Instead of writing a new prompt every time, you define a service once — with specific inputs, outputs, a model, and instructions — and then run it whenever you need it.
Think of AI Services as templates for AI tasks. A sentiment analysis service, a content summarizer, a lead qualifier — define it once, run it on any data, and get consistent, structured results every time.
What Is an AI Service?
An AI Service is a custom AI workflow that you configure with:
- A name — Something descriptive like "Sentiment Analyzer" or "Email Drafter."
- Input fields — The data the service needs to do its work. For example, a sentiment analyzer might take a "feedback_text" input.
- Output fields — The structured results the service produces. For example, "sentiment" (positive/negative/neutral) and "confidence_score."
- A model — Which AI model to use (GPT-4o, Claude Sonnet, etc.).
- A prompt — The instructions that tell the AI exactly what to do with the inputs and how to format the outputs.
Creating an AI Service
Open Your App's AI Services
In the Application Editor, navigate to the AI Services section. Click New Service to start creating your workflow.
Define Your Service
Give your service a clear name. Then add input fields — these are the pieces of data your service will process. Add output fields — these are the structured results the AI will produce. Choose a model and write your prompt, referencing input fields by name so the AI knows what data to work with.
Save and Test
Save your service and run a test with sample data. Review the output fields to make sure the AI is producing the results you expect. Adjust your prompt or model if needed.
Running a Service Manually
You can run any AI Service manually by providing values for each input field. This is useful for testing or for one-off tasks. Navigate to the service, fill in the inputs, and click Run. The results appear immediately in the output fields.
Running a Service on a Data Record
The real power of AI Services comes from running them on your app's data. When you use run_for_record, the service automatically pulls input values from a data record's fields, runs the AI workflow, and can save the outputs back to that same record.
For example, if you have a "Customer Feedback" data model with a "comment" field, you can run a sentiment analysis service on each record. The service reads the comment, analyzes the sentiment, and writes the result back to a "sentiment" field on the record.
Saving Output Back to Data Models
When configuring your service, you can map output fields to fields on your data model. After the service runs, the AI's results are automatically saved to the corresponding fields on the record. This means you can enrich your data with AI-generated insights without any manual copying.
Tip: Make sure your data model has fields that match the output types of your service. For example, if your service outputs a "sentiment" string, create a "sentiment" field of type String on your data model.
Example: Sentiment Analysis on Customer Feedback
Let's walk through a practical example:
- Data model: "Customer Feedback" with fields:
customer_name(String),comment(Text),sentiment(String),summary(String). - AI Service: "Feedback Analyzer" with input field
comment, output fieldssentimentandsummary. - Prompt: "Analyze the following customer feedback. Determine if the sentiment is positive, negative, or neutral. Provide a one-sentence summary."
- Run: Use run_for_record on each feedback entry. The service reads the comment, determines sentiment, writes a summary, and saves both back to the record.
Now every piece of customer feedback in your app is automatically analyzed and categorized, ready for dashboards or filtering.
Next Steps
- AI in Your Apps — Learn about the AI completion endpoint and chat sessions.
- AI Configuration (BYOK) — Use your own API keys for AI services.
- Data Models Overview — Set up the data models your services will work with.