Variables
Variable System
Section titled “Variable System”SlideMind supports four types of variables in prompts.
Variable types
Section titled “Variable types”| Type | Syntax | Resolved | Source |
|---|---|---|---|
| E-learning | {{name}} | Client-side | Passed by the e-learning module in the API request (variables: {}) |
| Memory | {{memory.key}} or {{memory.scope.key}} | Server-side | Learner memory database (cascade or forced scope) |
| Profile | {{profile.field}} or {{profile.alias}} | Server-side | WordPress user data + detected plugins |
| System | {{course_theme}}, {{module_objectives}}, etc. | Server-side | Inherited from parent course/module |
System variables (inherited)
Section titled “System variables (inherited)”These are filled from the parent course and module:
| Variable | Source |
|---|---|
{{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 |
Resolution priority
Section titled “Resolution priority”When the same variable name exists in multiple sources, this priority order applies:
- E-learning variables (from the client) — highest priority
- Memory variables (server-side)
- 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.
Unresolved variables
Section titled “Unresolved variables”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”).
@mention autocompletion
Section titled “@mention autocompletion”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:
| Source | Color | Example |
|---|---|---|
| System | Blue | {{course_theme}} |
| Memory | Green | {{memory.first_name}} |
| Profile | Pink | {{profile.display_name}} |
| Template | Orange | {{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 (Structured Responses)
Section titled “Return Variables (Structured Responses)”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).
Supported types
Section titled “Supported types”| Type | JSON type | Description | Example |
|---|---|---|---|
| Text | string | A text value | Feedback comment |
| Number | number | A numeric value | Score out of 10 |
| Boolean | boolean | True or false | Pass/fail |
| Enum | string | One value from a predefined list | beginner, intermediate, advanced |
Configuring return variables
Section titled “Configuring return variables”In the Wizard (step 3, Q&A mode) or in the slide edit page, add return variables:
| Field | Description | Example |
|---|---|---|
| Name | Variable name (used in JSON and editor) | score |
| Type | Data type | number |
| Description | What this variable represents (used in the prompt instruction) | “Score out of 10” |
| Values (enum only) | Comma-separated list of allowed values | beginner, intermediate, advanced |
How it works
Section titled “How it works”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" }}Using in your e-learning editor
Section titled “Using in your e-learning editor”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
Section titled “Profile Variables”Profile variables inject learner data from WordPress and popular plugins into your prompts — without manual input from the learner.
How it works
Section titled “How it works”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.
Syntax
Section titled “Syntax”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}}.Supported sources
Section titled “Supported sources”| Source | Detection | Example fields |
|---|---|---|
| WordPress (always) | Built-in | display_name, email, first_name, last_name, role |
| BuddyBoss | bp_xprofile_get_groups() | Dynamic xProfile fields |
| LearnDash | LEARNDASH_VERSION | ld_user_groups, ld_enrolled_courses, ld_completed_courses, ld_course_progress |
| WooCommerce | WooCommerce class | billing_company, billing_country, billing_city, billing_phone |
| ACF | acf_get_field_groups() | Dynamic user fields |
| Ultimate Member | UM class | Dynamic built-in fields |
| Tutor LMS | tutor() | tutor_enrolled_courses, tutor_completed_courses, tutor_profile_bio, tutor_profile_job_title |
| LifterLMS | LifterLMS class | llms_memberships, llms_enrolled_courses, llms_completed_courses |
| MemberPress | MEPR_VERSION | mepr_memberships, mepr_membership_status |
| User meta (always) | Generic | Any public meta_key (excludes internal WP keys, max 100) |
Setting up profile variables
Section titled “Setting up profile variables”- Go to SlideMind > Settings > Profile.
- Each detected source appears as a collapsible section (WordPress open by default, others collapsed).
- Check the fields you want to allow in prompts. Each section shows a counter badge (
checked/total) and a “Select all / Deselect all” link. - Save.
Only whitelisted fields are resolved — this prevents accidental exposure of sensitive data.
Aliases
Section titled “Aliases”Simplify long or technical field names with aliases:
| Original field | Alias | Usage in prompt |
|---|---|---|
display_name | name | {{profile.name}} |
first_name | firstname | {{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.
Response Example
Section titled “Response Example”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.
Inheritance
Section titled “Inheritance”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.
Best practices
Section titled “Best practices”- 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.
Next steps
Section titled “Next steps”- Learner Memory — Persist data across slides, modules, and courses
- Core Features — Learner Integration, Sandbox, Templates, Code Generator, Wizard
- Authoring Tool Guides — Integration code for each e-learning authoring tool
- Administration — Dashboard, analytics, settings, CORS