Text2Simulink is a multi-agent Simulink simulation generation system built on the Coral Protocol. It enables users to generate custom Simulink models by describing their requirements in natural language. The system leverages three collaborative agents—an InterfaceAgent, a ResearchSimulinkAgent, and a BuildSimulinkAgent—to search for relevant reference models and automatically construct new Simulink simulations that meet the user’s needs.
-
InterfaceAgent Interacts directly with the user. Receives natural language requests describing the desired Simulink simulation and communicates with the other agents to fulfill the task.
-
ResearchSimulinkAgent Searches a database of existing Simulink models to find similar or relevant reference examples based on the user's requirements.
-
BuildSimulinkAgent Builds the Simulink model by combining the user's instructions and reference cases identified by the ResearchSimulinkAgent. Uses MATLAB and Simulink automation to generate executable models.
All agent communication is coordinated via the Coral Protocol, allowing for distributed and modular agent collaboration.
-
Python 3.10+
-
MATLAB R2024b (with
matlab.enginefor Python) -
Python packages:
pip install langchain-mcp-adapters==0.0.10 langchain-openai worldnewsapi langchain langchain-core langchain_community
-
Clone and Start Coral Server
git clone https://github.com/Coral-Protocol/coral-server.git cd coral-server ./gradlew run -
Prepare Python Environment
- Install dependencies as listed above.
-
MATLAB Setup
- Ensure MATLAB R2024b is installed and
matlab.enginefor Python is configured. - See MathWorks documentation if you need help with setup.
- Ensure MATLAB R2024b is installed and
Open four terminal windows:
-
Terminal 1: Start the Coral Server
cd coral-server ./gradlew run -
Terminal 2: Start InterfaceAgent
python 0-langchain-interface.py
-
Terminal 3: Start ResearchSimulinkAgent
python 1-langchain-ResearchSimulinkAgent.py
-
Terminal 4: Start BuildSimulinkAgent
python 2-langchain-BuildSimulinkAgent.py
Make sure all terminals are in the correct environment and have access to required dependencies.
After all agents are running, interact with the InterfaceAgent. For example, you can request:
Please help me generate a simulink simulation with 2 bouncing balls, each should be placed with different height, and please record the height and speed of these two balls in a same scope.
The system will automatically:
- Interpret your request.
- Retrieve similar reference models.
- Build a new Simulink simulation combining your requirements and references.
- Output a ready-to-run Simulink model that meets your needs.