Skip to main content

Import Studio Agents into SRE

If you’ve created an agent in SmythOS Studio (Visual Canvas), you don’t need to rebuild it to run locally. Export the agent as a .smyth file, add a default_model, and run it inside the SmythOS Runtime Environment (SRE).

Why this matters

This workflow lets you design visually in Studio, then bring your agent into SRE with almost no changes. If you create your project with examples enabled, you’ll also get a ready-to-use terminalChat helper for testing.

This guide shows you the quickest path: export, add a default_model, import the .smyth into SRE, and test it with Terminal Chat.

Before you start

Before you import your Studio agent into SRE, make sure you have the right setup:

  • You’ll need to be able to open your workflow in the SmythOS Studio builder so you can export it.
  • On your machine, have Node.js installed and the SRE CLI set up.
  • If your agent uses LLM-based components, keep your API key for OpenAI, Anthropic, or another provider handy.

And if you’re new to building visually, you can take a quick look at the Studio Canvas guide before you go further.

Fastest path

When you create a new SRE project, choose examples. It comes with a ready-to-use terminalChat helper so you can test your agent instantly.

Step 1. Export your agent from Studio

Open your agent in Studio and export it as a .smyth file.

For example, you might have a simple agent skill named test that takes a name and echoes back Hello, <name>.

Shortcut

Use Ctrl + Shift + E on Windows/Linux or ⌘ + Shift + E on macOS to export quickly.

Step 2. Add the required default_model

SRE requires the .smyth file to include a default_model. This field is missing in Studio exports, so you’ll need to add it manually.

Required for import

Without default_model, SRE cannot import your agent.

Here’s what you need to add:

{
"default_model": "gpt-4.o"
}

Replace "gpt-4o" with the LLM you plan to use, such as "gpt-5" or "claude-3-sonnet".

Step 3. Import the .smyth file into SRE

Next, bring your exported agent into your SRE project.

  1. Copy your .smyth file into the SRE project folder.
  2. Create a new file (for example, myAgent.ts) and import the agent:
import { agentImport } from "sre/agent";

const agentPath = "./myAgent.smyth";
export const myAgent = agentImport(agentPath);

Step 4. Test the agent with Terminal Chat

Once imported, you can quickly test the agent with the built-in Terminal Chat helper.

In your index.ts file:

import { terminalChat } from "./terminalChat";
import { myAgent } from "./myAgent";

terminalChat(myAgent);

Then run the project:

$ npm start
? Enter session ID: demo-session
> Hello Raul
< Hello Raul`
Keep context between runs

Reuse the same session ID with persist: true if you want the agent to remember earlier messages.

Component compatibility in SRE

Not every Studio component works in SRE. Here’s a quick compatibility table:

ComponentSRE statusNotes
GenAI LLMSupportedWorks with your provider API key
LLM AssistantSupportedDefault choice for chat style workflows
ClassifierSupportedUses your LLM provider
Image GeneratorSupportedFeature set depends on provider
Web SearchNot supportedStudio credit based
Web ScrapeNot supportedStudio credit based
Node.js componentNot supportedUse local code or Node.js scripts alongside SRE
Adapting unsupported components

If your agent uses unsupported nodes, replace them with SRE-friendly alternatives. For example, use an LLM call with custom fetch logic instead of Web Search.

FAQs

Common Questions

Do I always need to add default_model?
Yes. Adding it directly to the .smyth file is the simplest way to make sure SRE imports correctly.

Which model should I use for testing?
Any general LLM works, such as gpt-4o or claude-3-sonnet. Use the one your team already relies on.

Why does my agent not remember earlier messages?
Session persistence depends on the session ID. Reuse the same ID and enable persistence in terminalChat.

My Studio agent includes Web Search or Scraping. What now?
Those features are not supported in SRE. Replace or mock them for local testing.

Can I update the agent after importing?
Yes. Update in Studio, re-export as .smyth, and re-import into your project.

What’s next

Need more help?
Have a question or need assistance? Join the SmythOS Discord or reach out via email at [email protected]. We're here to help.