Templating
Create templates that define the structure of your AI agent's output.
Creating a structured template lets the model knows exactly where and how to inject content. By pairing a template with your data, you get consistent, predictable results every time.
What Is a Template?
A template is a block of text (in Markdown, HTML, or JSON) containing placeholders for your variables. When your workflow runs, MindStudio replaces those placeholders with the actual values you’ve collected (via user inputs, scraped data, files, etc.) and sends the combined prompt to the model.
Placeholders can use either XML-style tags
<company>…</company>
or square-bracket notation[company]
.Inside a Generate Text or Generate Asset block, you supply:
Your data (e.g., user inputs saved to variables)
The template itself
The model fills each placeholder according to your template’s structure.
Why Use Templates?
Consistency: Ensure every output follows the same format.
Clarity: Guide the model step-by-step—no guessing about headings, sections, or order.
Scalability: One template handles countless inputs.
Flexibility: Swap templates for different formats (HTML vs. Markdown vs. JSON) without rewriting your workflow.
Creating a Template
Using Square Bracket Notation
Square brackets are ideal for quick and easy placeholders in Markdown templates or ad-hoc prompts. They are simple to identify in plain text and work best when you have single-word placeholders like [title]
or [body]
.
Use them when writing short, straightforward templates, such as bullet lists or paragraphs, where the format resembles a "fill-in-the-blanks" approach.
Example prompt that uses Square brackets:
Using XML Tags
XML-style tags clearly show where each placeholder starts and ends to help avoid confusion with nearby text or symbols. This is particularly helpful for making sure variables are clearly displayed to the AI model.
Prompt Example (Generate Blog Post):
You can also use them when you have longer placeholders, or for creating HTML templates with the Generate Asset block.
HTML Example (Marketing Email):
Best Practices
Name your placeholders clearly (e.g.
[project_summary]
, not[x]
).Wrap variables in tags to avoid ambiguity
<budget>{{budgetVariable}}<budget>
.Test incrementally: start with one section, preview, then expand.
Use Markdown for quick proofs; HTML when you need precise styling.
Last updated