Stella makes use of the open source sd-ai Gateway project to power an AI Assistant that allows you to query commercial AI engines for assistance in Creating CLDs as well as models that can be simulated. It also has the ability to analyze models. All of this can be managed from the AI Assistant.
The ability of AI to generate and analyze working models is evolving quickly as improvements are made to large language models and, potentially, other forms of generalized AI. The configuration of the sd-ai Gateway means that any advances in AI specific to dynamic modeling and feedback thinking can be accessed from within Stella.
Starting with Version 4.0 of Stella the use of AI in model generation and analysis is also tracked and reported in the AI Usage Report. This is intended to make it easier for educators to understand student work and for model authors to distinguish which parts of their models came from where.
The reliability of AI information is determined by gathering information about AI usage recorded in the model file and creating a signature that can be verified when the model is reopened. The details of this are contained in a draft extension to the XMILE standard.
AI support for model building and analysis is developing very quickly. Some of the developments are done on the sd-ai Gateway and will be available in any version of the software after 4.0. Some, however, require coordination between the software and the gateway.
The interactive agent was introduced in version 4.3, and we will continue to make improvements to its performance in future releases. There are not restrictions on the types of models that the interactive agent can deal with. The removal of restrictions actually started with version 4.2, prior to that only models with no modules or arrays could be created and analyzed using the AI Assistant.
When using the default sd-ai Gateway you will need to have credit available in order to make queries. For some Stella licenses an initial credit will automatically be given as part of support renewal. For other licenses you can purchase credit by logging into your account at iseesystems.com. If you do not download your software by logging into your account at iseesystems.com (for example with a lab pack), you will need to get in touch with your instructor about getting credits.
When using the Basic tab of the AI Assistant there is also an option to provide an API key for the assistant you are working with. This option is not available int the Agent tab because of the nature of the interactive agent, which may call multiple LLM providers.
You can determine the cost of your queries by clicking on the $ button on the AI Assistant to open then AI Assistant Credit dialog before and after the query. Costs can range from a few cents to several dollars depending on the complexity of the query and model you are working with. Costs on the Basic tab, which will only ever make a single query of the LLMs, are substantially lower than on the Agent tab where multiple calls to LLMs will be made in response to a query.
If you set up your own sd-ai Gateway you can provide it with your own API keys to access the different LLMs and do not need to make use of the Stella credits.
When using a specific AI tool you can provide your own API keys for Anthropic (Claude), Google (Gemini), OpenAI or other providers supported by the sd-ai Gateway in Stella. For the Interactive Agent, which can call multiple providers, you will need to set up a local sd-ai Gateway that is configured with your keys.
The default mode for working with the AI Assistant is a conversational agent, which you tell what to do or ask questions of. It then takes those and determines which AI tools to use to fulfill them, and which Stella tools it can call back to as it checks on things. This becomes, effectively, a three way conversation between you, Stella, and LLMs. You can also, while the agent is idle or even while it is doing things, interact directly with Stella.
The method by which the agent processes your input is governed by a recipe (also called an agentic loop) that controls what to do next after something has been done. Unlike a recipe, or perhaps exactly like a recipe depending on how you cook, what comes out the other end is a bit unpredictable. The core recipes - currently Socrates and Merlin, are maintain on the sd-ai Gateway gateway updated frequently to improve them and adapt them to new LLMs as they become available.
Some of the tools available to the agentic loop are described in AI Tools and Actions. Knowing about these can be helpful in formulating messages to send to the agent.
You can, if you want, adapt one of these recipes or write your own. The process for doing this is described in Customizing the AI Agent.
It is also possible to be more specific about which AI tools you interact with by using the Basic tab in the e AI Assistant. These basic tools do not call back to Stella, though Stella does pass information about the current model when it calls out to the LLMs. This can have some pedagogical advantages in that it is a more predictable process, so it is really up to you whether or how you use the basic tools. It is worth noting, however, that for bigger models the interactive agent can control how much of the model is actually sent to the LLMs and this can improve quality while decreasing costs.
The AI Assistant can help in all stages of model development and analysis, and will typically be used in an iterative manner. Model building can start from scratch, or be based on existing work. Variables and equations added by the assistant can be edited or deleted. Any errors introduced by the assistant can be corrected either using the assistant or by hand. Similarly, incomplete formulations or errors that result from editing can be presented to the assistant for completion or correction.
The AI Assistant is also quite good at describing the nature of errors and omissions and suggesting changes without actually making any changes. Thus it can be used in a way that best suited to specific project needs. It is important to remember, however, that no matter what manner you interact with the assistant your model content is being sent outside for processing. Any models containing sensitive information should be treated with care.
The AI Assistant is also very good at creating documentation on individual variables (and connections), and there is a tool specifically designed to generate documentation. The AI Assistant can also do analysis of runs by leveraging loop dominance computations (see Loops That Matter™).
There is full support for Working with Arrays using AI, but AI is unlikely to do anything with arrays for models that are not already arrayed unless you explicitly ask to create arrayed variables (or to make an entire model arrayed). The assistant is very good at adding elements to arrays and making sure that the equations are consistent.
Like arrays, there is full support for modules, but typically modules will only be created when there are already modules or you explicitly ask to create modules. One thing that can be done quite effectively is encapsulation of parts of model structure into modules. This is similar to the normal editing function for Encapsulating Structure but the results are often more elegant.