Skip to main content

Building Agents with SRE

The SmythOS Runtime Environment (SRE) supports multiple ways to build and run agents. You can work visually in Studio, write agents with the SDK, or manage projects using the CLI. All three connect to the same runtime, so you can move between them without changing platforms.

Why this matters

Choose the workflow that fits your role and project. Designers can prototype visually, developers can extend with code, and teams can monitor and deploy agents in a consistent way.

Choosing a Workflow

MethodBest forWhat it offers
StudioNon-developers, rapid iteration, collaborative teamsDrag and drop components, test in browser, share with teammates
SDKDevelopers, automation, CI/CD pipelinesType-safe workflows in TypeScript, custom logic, programmatic testing
CLIScripting, project setup, running Studio exportsScaffold new projects, run .smyth files locally, integrate with build pipelines
Reference projects

Browse the SRE GitHub examples for end-to-end sample agents, including RAG search, API integrations, and custom skills.

Building with Studio

Studio is the fastest way to get an agent running.

  • Build workflows visually with components
  • Test agents directly using chat, form preview, or API modes
  • Collaborate by inviting others into a space

For a hands-on walkthrough, see the Studio Quickstart.

Building with the SDK

The SDK gives you full programmatic control in TypeScript.

Minimal example

{`import { Agent, Component } from '@smythos/sdk';

const agent = new Agent({ name: 'ClassifierAgent', model: 'gpt-4o' });

const llm = Component.GenAILLM({ model: 'gpt-4o' }, agent);
const classifier = Component.Classifier({ classes: ['positive', 'negative'] }, agent);

// Connect outputs
classifier.in({ Input: llm.out.Reply });
`}
  • Define workflows as code and keep them version-controlled
  • Add custom components or expose new skills
  • Run tests locally or in CI/CD

Explore more in the SDK Guide and examples in the repo.

Building with the CLI

The CLI helps automate and bridge Studio and SDK workflows.

  • Create new projects with sre create
  • Run Studio-exported .smyth files locally with sre run
  • Add commands into package.json or pipeline scripts

See the CLI Guide and Getting Started for installation and setup.

Extending with Custom Components and Skills

Custom Components

Write reusable blocks by extending the Component base class.

{`import { Component } from '@smythos/sdk';

export class Uppercase extends Component {
async process(input) {
return { result: input.toUpperCase() };
}
}
`}

Details are in the Component Reference.

Agent Skills

Expose functions that your agent can call directly.

{`agent.addSkill({
name: 'getWeather',
description: 'Return a simple weather forecast',
ai_exposed: true,
process: async (city) => ({ forecast: 'Sunny in ' + city })
});
`}

See more patterns in the SDK Guide.

Monitoring and Debugging

SRE provides built-in observability:

  • Execution traces for every component
  • Real-time logs via SSE streams
  • Debug mode for step-through inspection
  • Performance metrics such as tokens, memory, and latency

Monitoring is available both in Studio and in SDK projects. For internals, see the Runtime Overview.

Hybrid Workflows

You can combine approaches:

  • Export a Studio workflow to extend it in the SDK
  • Import an SDK-built agent into Studio for visualization and debugging
  • Use Studio for orchestration and SDK for specialized custom logic

See the Hybrid Workflow Guide for concrete patterns.

Next Steps