Skip to content

Variables

SlideMind supports four types of variables in prompts.

TypeSyntaxResolvedSource
E-learning{{name}}Client-sidePassed by the e-learning module in the API request (variables: {})
Memory{{memory.key}} or {{memory.scope.key}}Server-sideLearner memory database (cascade or forced scope)
Profile{{profile.field}} or {{profile.alias}}Server-sideWordPress user data + detected plugins
System{{course_theme}}, {{module_objectives}}, etc.Server-sideInherited from parent course/module

These are filled from the parent course and module:

VariableSource
{{course_theme}}Course theme field
{{course_objectives}}Course objectives field
{{course_content}}Course reference content
{{course_response_example}}Course response example
{{module_theme}}Module theme field
{{module_objectives}}Module objectives field
{{module_content}}Module reference content
{{module_response_example}}Module response example

When the same variable name exists in multiple sources, this priority order applies:

  1. E-learning variables (from the client) — highest priority
  2. Memory variables (server-side)
  3. Profile variables (server-side)

E-learning variables override memory/profile if they share the same name. This is by design — the real-time value from the editor always takes precedence.

When a variable cannot be resolved (e.g., {{profile.first_name}} for an anonymous learner, or {{memory.genre}} before it has been saved), SlideMind replaces it with an explicit marker:

{{profile.first_name}} → [first name : not available]
{{memory.genre}} → [genre : not available]

An instruction is also appended to the system prompt telling the AI to adapt naturally — it should not mention, guess at, or draw attention to missing information. This prevents the AI from treating raw {{...}} placeholders as literal text (e.g., calling the learner “profile.first_name”).

In any prompt editor (Wizard, slide edit, template edit, Sandbox), type @ to trigger variable suggestions. The autocomplete is powered by Tribute.js and pulls from all four sources:

SourceColorExample
SystemBlue{{course_theme}}
MemoryGreen{{memory.first_name}}
ProfilePink{{profile.display_name}}
TemplateOrange{{learner_name}}

Select a suggestion to insert the full {{variable}} syntax. The system respects configured aliases (e.g., selecting @name inserts {{profile.display_name}} if name is an alias for display_name).


Return variables let you get structured data from the AI instead of plain text. The AI responds in JSON, and each value is written to a corresponding variable in your e-learning editor — so you can use them for scoring, branching, and adaptive logic.

Note: Return variables are available in Q&A mode only (single-turn interactions).

TypeJSON typeDescriptionExample
TextstringA text valueFeedback comment
NumbernumberA numeric valueScore out of 10
BooleanbooleanTrue or falsePass/fail
EnumstringOne value from a predefined listbeginner, intermediate, advanced

In the Wizard (step 3, Q&A mode) or in the slide edit page, add return variables:

FieldDescriptionExample
NameVariable name (used in JSON and editor)score
TypeData typenumber
DescriptionWhat this variable represents (used in the prompt instruction)“Score out of 10”
Values (enum only)Comma-separated list of allowed valuesbeginner, intermediate, advanced

When return variables are configured, the PromptEngine appends an instruction to the system prompt:

IMPORTANT: You MUST respond ONLY in valid JSON with this exact structure:
{
"score": "(number) Score out of 10",
"feedback": "(string) Personalized comment",
"level": "(enum: beginner|intermediate|advanced)"
}

The API response includes the parsed JSON:

{
"success": true,
"structured": true,
"data": {
"score": 7,
"feedback": "Good answer, but you could elaborate on...",
"level": "intermediate"
}
}

The SlideMind runtime (sm-slide.js) handles structured responses automatically. When the API returns a structured response, the runtime detects it and writes each value to the corresponding editor variable (e.g., player.SetVar("score", 7) in Storyline). No additional code is needed in the snippet.

You can then create Storyline triggers that react to the score (show/hide layers, adjust branching, display results).


Profile variables inject learner data from WordPress and popular plugins into your prompts — without manual input from the learner.

SlideMind detects which plugins are active on your site and exposes their user fields as variables. You control which fields are available via a whitelist in the settings.

Use {{profile.field_name}} or {{profile.alias}} in your prompts:

Hello {{profile.display_name}}, you are enrolled in {{profile.ld_enrolled_courses}}.
Your role is {{profile.role}}.
SourceDetectionExample fields
WordPress (always)Built-indisplay_name, email, first_name, last_name, role
BuddyBossbp_xprofile_get_groups()Dynamic xProfile fields
LearnDashLEARNDASH_VERSIONld_user_groups, ld_enrolled_courses, ld_completed_courses, ld_course_progress
WooCommerceWooCommerce classbilling_company, billing_country, billing_city, billing_phone
ACFacf_get_field_groups()Dynamic user fields
Ultimate MemberUM classDynamic built-in fields
Tutor LMStutor()tutor_enrolled_courses, tutor_completed_courses, tutor_profile_bio, tutor_profile_job_title
LifterLMSLifterLMS classllms_memberships, llms_enrolled_courses, llms_completed_courses
MemberPressMEPR_VERSIONmepr_memberships, mepr_membership_status
User meta (always)GenericAny public meta_key (excludes internal WP keys, max 100)
  1. Go to SlideMind > Settings > Profile.
  2. Each detected source appears as a collapsible section (WordPress open by default, others collapsed).
  3. Check the fields you want to allow in prompts. Each section shows a counter badge (checked/total) and a “Select all / Deselect all” link.
  4. Save.

Only whitelisted fields are resolved — this prevents accidental exposure of sensitive data.

Simplify long or technical field names with aliases:

Original fieldAliasUsage in prompt
display_namename{{profile.name}}
first_namefirstname{{profile.firstname}}

Configure aliases in SlideMind > Settings > Profile (alias column next to each field).

Profile field detection is cached for 1 hour (transient sm_profile_fields_cache). The cache is invalidated when you save settings or when a plugin is activated/deactivated.


The response example field shows the AI what a good answer looks like — its format, tone, length, and level of detail. It’s available on every slide (and in the Wizard step 3).

The system prompt gives instructions; the response example provides a concrete model for the AI to follow. This distinction matters because examples tend to shape output formatting and tone more reliably than instructions alone.

Response examples cascade from course and module levels:

  • {{course_response_example}} — Defines the default format and tone for the entire course.
  • {{module_response_example}} — Overrides or supplements the course-level example for a specific module.
  • Slide-level — The response example on the slide itself, for slide-specific formatting.

You can set a response example at the course level and let all slides inherit it, or override it per module or per slide.

  • Do: Write a complete example response, follow the exact formatting you expect, indicate the desired tone, include the level of detail you want.
  • Avoid: Don’t put instructions here (use the system prompt for that), don’t repeat the system prompt, keep it under 300 words, don’t include learner-specific data, use one format per field.