Refining Architectures with AI Recontextualization
Systems engineering is an iterative process. Requirements change, new components are added, and architectures must evolve. The AI SysML v2 Editor goes beyond simple code generation by offering “Recontextualization”?the ability for the AI to understand your existing model and propose intelligent updates. This tutorial will teach you how to refine your SysML v2 software models using this advanced AI SysML tool capability.
Objective
By the end of this tutorial, you will have taken an existing “Spacecraft” model and used the AI Assistant to add a complex communication subsystem and power attributes, ensuring your stable SysML v2 tool project stays up to date with changing design needs.
Step 1: Prepare Your Base Model
- Open your web-based SysML v2 editor.
- Open the
Basics.sysmlfile (or any file with an existingpart def). For this tutorial, ensure you have the following code:
package 'Spacecraft Project' {
part def Spacecraft {
part engine : Engine;
}
part def Engine;
}
Step 2: Trigger the AI Assistant
The AI SysML tool is context-aware. When you open the assistant while a file is active, it can “read” your current SysML editor content to understand your architecture.
- Click the AI Assistant icon in the right-hand panel.
- Ensure you are on the Diagram tab.
Step 3: Prompt for a Model Expansion
Instead of asking for a new model, we will ask the AI to modify the one currently on your screen. This demonstrates the power of the AI SysML v2 software in a real-world iterative workflow.
- In the prompt box, type the following:
“In my Spacecraft model, add a communication subsystem part named ‘CommSystem’. Also, add a ‘powerConsumption’ attribute of type Real to both the Engine and the CommSystem.” - Click Generate.
Step 4: Review the Side-by-Side Comparison
Because you are refining an existing model, the AI SysML tool provides a specialized preview window.
- The assistant will display the new, updated code.
- Carefully review how the AI has integrated the
CommSysteminto theSpacecraftdefinition and updated the internal attributes. - This stable SysML v2 tool approach prevents “model drift” by ensuring the AI’s suggestions are consistently applied to your current namespace.
Step 5: Apply the Recontextualized Code
- Click Apply to update your main editor with the AI’s suggestions.
- Observe your code: You will see the new parts and attributes highlighted by the precise syntax highlighting of the SysML v2 editor.
- The LSP worker will immediately validate the new structure, ensuring the
powerConsumptionattributes are correctly typed.
Step 6: Visualizing the Refined Architecture
As always, the web-based SysML software keeps your diagrams in perfect sync.
- Check the Diagram Viewer. You will see the
Spacecraftblock now contains two sub-parts (engineandcommSystem). - If you have “Show Memberships in Compartment” enabled in the diagram settings, you will also see the
powerConsumptionattributes listed inside the blocks.
Why Recontextualization is Essential
Using the AI SysML tool for refinement provides three major benefits:
- Consistency: The AI maintains the naming conventions and structure of your existing SysML v2 software.
- Speed: Quickly adding standard attributes or boilerplate subsystems takes seconds instead of minutes.
- Safety: By reviewing changes in the preview before applying, you maintain the integrity of your stable SysML v2 tool project.
Summary and Next Steps
You have mastered the art of AI-driven model refinement! You’ve learned how to use the AI SysML v2 editor to evolve your designs incrementally. This is the mark of a truly professional SysML tool user.
In the next tutorial, “Modular Modeling with Imports and Libraries,” we will learn how to handle large projects by splitting them into multiple files and using standard SysML v2 libraries.