Hybrid Workflows in SRE
SRE supports both visual and code-based agent development. You are not limited to a single approach; you can use Studio, the SDK, or combine them for maximum flexibility and productivity.
The Hybrid Advantage
Some tasks are easier visually, such as mapping out agent logic or collaborating with non-technical team members. Other requirements, like version control or custom integrations, benefit from a code-first workflow. Hybrid workflows let you take advantage of both methods without compromise.
This approach is ideal if you:
- Want to prototype quickly in Studio but scale or customize in code
- Work in cross-functional teams where both business and technical stakeholders contribute
- Need visual clarity for agent flows but code-level control for extensions or automation
- Use Studio for interactive testing and monitoring, but the SDK for CI/CD and integrations
Best Tool for the Job
Use Case | Best Tool | Example |
---|---|---|
Rapid Prototyping | Studio | Drag components, test flows, and iterate visually |
CI/CD & Version Control | SDK | Store agent logic in Git, integrate with pipelines |
Custom Logic & Integrations | SDK | Build custom skills or connect private APIs |
Non-Technical Collaboration | Studio | Enable business users to shape agent workflows |
Schema Enforcement & Testing | SDK | Add type checks and test coverage for agents |
Exporting from Studio to the SDK
You can take any agent built visually in Studio and bring it into a code-based workflow. To do this, open the agent in Studio and use the keyboard shortcut (Ctrl + Shift + E
or ⌘ + Shift + E
) to export its definition as a .smyth
file.
Once exported, you can load it into your SDK project to create a fully functional agent that mirrors your visual design.
import { SDK } from 'smyth-runtime';
import agentData from './my-agent.smyth';
// Load the agent definition from the exported file
const agent = new SDK.Agent(agentData);
// Interact with the agent just like any other SDK-based agent
const result = await agent.prompt('Give me a summary.');
console.log(result);
This lets you programmatically extend the agent with new skills, run automated tests, or integrate it into a larger backend process. You can find complete examples on the SRE Github Repo.
Importing from the SDK into Studio
You can also take any agent you define with the SDK and visualize, test, or debug it in Studio.
Step-by-step:
- Build your agent in the SDK.
- Export its data structure to a file:
import fs from 'fs';
import { SDK } from 'smyth-runtime';
const agent = new SDK.Agent({ name: 'HybridAgent', model: 'gpt-4' });
const agentData = agent.data;
fs.writeFileSync('agent-for-studio.json', JSON.stringify(agentData, null, 2));
- In Studio, go to Create Agent → Import from File.
- Drag the exported JSON file onto the canvas or use the upload prompt.
Studio will automatically load your logic, components, and configuration for visual inspection or extension.
Tips for Mixed Teams
- Let designers and product leads prototype in Studio.
- Allow engineers to pull those prototypes into the SDK for productionizing, versioning, and integration.
- Push major code updates back to Studio for continued visual review and collaboration.