How to create a prompt
Last updated
Last updated
Creating a prompt in ZBrain is an easy process that allows you to guide your AI application’s responses with precision. Follow the steps below to create and configure a prompt effectively:
Navigate to the right side of the prompt manager interface.
Click the ‘Create’ button to initiate the process of creating a new prompt.
Once clicked, a new panel will open for you to begin configuring the prompt.
In the prompt panel:
Provide a clear title
Enter a title: Provide a clear and descriptive name for your prompt. Click the ✏️ (pencil) icon to edit the title.
Select the model and provider
Choose the appropriate AI provider (e.g., OpenAI, Claude AI) from the dropdown menu.
Select the specific model you want to use (e.g., GPT-4, Claude 2).
Click the settings (⚙️) icon next to the model selection to configure parameters like temperature, max tokens, and top-p values etc.
Static prompt type: System (predefined)
System is the default and static prompt type.
The system message defines instructions that guide the model's behavior or tone throughout the session.
This setting is predefined and cannot be manually selected, but automatically applies to the conversation.
Add roles
Click ‘+ Message’ to define different roles in your prompt structure. Select the prompt type based on your use case:
User: Represents the user’s query or interaction input.
Assistant: The model’s response to the user’s input.
You have two options for entering the prompt instructions that will guide the model:
Option 1: Manual entry
Type the prompt instructions directly into the text field.
These instructions can include detailed tasks, specific formatting rules, tone guidelines, etc.
Option 2: Auto-generate using LLM
Click the ‘Generate’ button to automatically create instructions using a large language model.
A dialogue box will appear titled ‘What would you want to update?’
Within this box, you can:
Create a new prompt: Describe the function or output you want the AI solution to perform (e.g., “Summarize long documents in bullet points”).
Optimize an existing prompt: Paste an existing prompt you'd like to refine or improve using AI suggestions.
After entering your input or requirements, click ‘Create’ to generate the prompt.
Review and update the generated instructions as needed.
Variables allow you to dynamically insert values into prompts at runtime. This approach supports reusability and flexibility in prompt behavior.
Option 1: Add variables using the interface
Click ‘+ Add’ to define variables.
Select from the following predefined variable types:
App:
ID
, Name
, Description
Flow:
ID
, Name
User:
ID
, Name
, Email
Time and date:
Current date and time
, Day
, Timezone
Session:
ID
, query
, context
, feedback
, input files
Option 2: Add dynamic placeholders in text
Use curly brackets {{}} to add dynamic placeholders directly into your prompt.
These placeholders are populated with actual values at runtime.
Example:
"Summarize the following content:
{{content}
}"
The {{content}}
variable will be replaced by the actual input content when the prompt is executed.
This enables the same prompt to be reused across different scenarios.
After configuring all necessary settings:
Review your prompt instructions, variables, and roles.
Click the ‘Publish’ button to save and activate your prompt.
The prompt is now ready for use in your apps.
Testing is crucial to ensure the prompt works as intended and yields the desired outputs.
Enter a test query
Input sample data or a query that the AI should respond to. This query should represent real-world input that your AI will handle.
Click ‘Run Prompt’ to execute the configured prompt and generate output based on the provided input.
Review the response
Analyze the output.
If needed, refine:
Instructions
Model settings
Roles or variables
Iterate and improve
Test multiple scenarios or input variations to ensure the prompt works consistently.
Based on testing, return to the configuration panel to make further adjustments.
After making changes, republish the prompt and retest until the desired performance is achieved.
By following these steps, you can easily create high-quality, structured prompts that align with your application’s goals and ensure consistency across AI interactions.