explainx.ainewsletter3.5k
TrendingNewsPathwaysSkills
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

learn

pathways — start freeworkshopsbootcampscoursescertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcptoolsagentsllmsdesignsdictionaryagi trackerranks

company

aboutvisionmissionteaminstructorscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

On this page

  • What it looks like
  • The ninth visual type: "live"
  • How model-authored code gets to run safely
  • What the model actually gets to work with
  • Related on explainx.ai
← Back to blog

explainx / blog

Melo Can Now Build a Live Simulation for Anything You Ask

explainx.ai's Melo can now generate a bespoke, interactive simulation for any topic via /interact — model-authored code running in a sandboxed iframe with an opaque origin, so it can never touch your account.

Aug 21, 2026·5 min read·Yash Thakker
explainx.aiMeloGenerative UIProduct UpdateAI LearningSandboxing
go deep
Melo Can Now Build a Live Simulation for Anything You Ask

Melo, explainx.ai's AI learning copilot, already teaches with a library of eight pre-built interactive visual types — agent loops, RAG pipelines, token context, and more — each one a hand-tested React component the model fills in with topic-specific content. That approach is fast and reliable, but it only covers what's already been built.

/interact removes that ceiling. Type /interact followed by any topic, and Melo writes and runs a bespoke, live simulation for it on the spot — no pre-built component required.

Melo's /interact pendulum simulator: a draggable interactive visual generated live for a physics question, with an angle slider

Weekly digest3.5k readers

Catch up on AI

Curated AI updates on agents, skills, and MCP — delivered to your inbox. Unsubscribe anytime.

What it looks like

Type /interact pendulum, and Melo builds a live, draggable pendulum simulator — a bob on a string, a slider controlling the initial release angle, and an animation that plays out the actual physics: gravitational potential energy converting to kinetic energy and back as it swings, with the period depending on string length rather than the bob's mass. It's not a canned demo; it's generated for that specific request.

The same command works for anything, not just AI/ML topics or physics. Melo also surfaces /interact as a one-click suggestion — "Create interactive explanation" — right after it answers a question, so you don't need to remember the exact slash-command syntax to get one.

The ninth visual type: "live"

Melo's existing library works by having the model fill in a strict, typed JSON spec — which of the eight components to use, the mode (watch, explore, or recall), difficulty, and the topic-specific content that component needs. A validator checks the spec against the component's actual shape before anything renders, so a malformed spec degrades to a plain-text explanation instead of a broken widget.

/interact adds a ninth type to that same spec system: live. Instead of filling in a schema, the model writes the actual rendering code itself — a function Visual(props) returning JSX — for topics with no matching pre-built shape. That's a deliberate trade: the fixed eight types are guaranteed-safe because the component is hand-tested code the model can't touch, while live gives up some of that guarantee in exchange for being able to illustrate genuinely anything.

How model-authored code gets to run safely

Running code an AI model wrote, live, in a learning product used by real accounts, is the part that has to be engineered carefully rather than trusted. explainx.ai's approach is two layers, and only one of them is the actual security boundary.

Layer 1: a static guard (cheap, not the real defense)

Before generated code ever reaches a sandbox, it's scanned against a banned-pattern list: import statements, require(), fetch(), XMLHttpRequest, window.parent or window.top access, document.cookie, localStorage, sessionStorage, raw <script> tags, eval(), new Function(), and dangerouslySetInnerHTML. Code that trips any of those never renders — the learner gets a clear fallback message instead of a silently broken widget. This is a fast first filter that catches obviously non-compliant code early, but it's explicitly not what makes the system safe on its own — a regex-based pattern list can always be evaded by output the model didn't intend maliciously but that still happens to slip through.

Layer 2: an opaque-origin iframe (the real defense)

The actual security boundary is how the code executes. Generated code is Babel-transformed in the browser and rendered inside an iframe set to sandbox="allow-scripts" — deliberately without allow-same-origin. That single omission is what matters: it forces the iframe's origin to be opaque and null, which means even a full script-execution compromise inside that sandbox cannot read explainx.ai's cookies or localStorage, call its APIs, or reach window.parent directly.

The only channel out of the sandbox at all is postMessage, and the parent page interprets messages from it narrowly — as ready, resize, error, or evidence events only, never as arbitrary commands. So even in the worst case — a generated visual that's fully compromised or simply buggy — the blast radius is contained to "this one widget renders wrong or reports an error," not "this widget can act on the learner's account."

What the model actually gets to work with

The generated code isn't dropped into a bare browser environment. A small set of ambient helpers is passed in specifically so the model doesn't have to reinvent common interaction patterns (or badly reinvent anatomy):

table · 2 cols
HelperWhat it's for
Slider, Button, Toggle, Select, NumberInputPre-styled UI primitives matching the rest of the product
DragPointLets a learner grab and move a point directly inside an SVG — a ball, a molecule, a handle — reported in the diagram's own coordinate space
VecPolar-to-cartesian conversion, angle math, clamping, and arrow-drawing helpers — the kind of math a pendulum, orbit, or force diagram needs
Curated Lucide iconsCorrectly-drawn base shapes (an eye, a DNA strand, a flask, a heart) for anatomy/biology/chemistry topics the model tends to draw badly from scratch — animate on top of these instead of hand-drawing the structure

That last one is a small but telling design choice: rather than trusting a language model to freehand an anatomically correct eye in SVG, the system gives it a correct base illustration and lets it focus on what it's actually good at — annotating, animating, and connecting that shape to the concept being taught.

Related on explainx.ai

  • OpenAI Cuts GPT-5.6 Sol API Pricing Over 20% for 3 Months — a pricing promo lowers the cost of building interactive AI yourself; /interact ships that as a product default instead
  • How Melo Teaches With Generative UI — the fixed eight-component library this expands on
  • Introducing Melo: The AI Learning Copilot Built Into explainx.ai
  • Introducing Interactive AI Learning Pathways
  • Google's Generative UI: Gemini 3 Explained
  • Try it: explainx.ai/dashboard/learn — ask Melo a question, then type /interact and a topic

Describes Melo's /interact live-visual system as of August 21, 2026. This is explainx.ai's own production feature and may continue to evolve.

Spotted something out of date? Let us know.
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

Related posts

Aug 17, 2026

How Melo Teaches With Generative UI: Real-Time Illustrations, Not Just Text

When Melo teaches you a concept, it doesn't just describe it — it builds a specific, interactive illustration live, in the middle of its answer, matched to exactly what you're learning. Here's how that actually works under the hood, and how the design compares to Google's own generative UI research.

Aug 11, 2026

Introducing Melo: The AI Learning Copilot Built Into explainx.ai

Most AI chatbots answer your question and let you leave feeling smarter than you are. Melo is built to do the opposite — quiz you, make you explain concepts back, and grade your answers against a rubric. It runs across pathways, articles, skills, and workshops, grounded in explainx.ai's library.

Aug 21, 2026

Social Learning for AI: Why Solo Chatbots Fail and What Actually Works

Albert Bandura's social learning theory explains why watching, talking, and practicing with others beats reading alone. Solo AI chat skips most of that. explainx.ai builds social learning into Melo's dialogic modes, live workshop cohorts, team pathway assignments, and interactive pathway chapters.