Skip to main content

SRE Components Reference

The SmythOS Runtime Environment (SRE) provides a library of production-ready components.
Components are the building blocks of AI agents. Each encapsulates a reusable function, such as prompting an LLM, filtering JSON, or exposing an API endpoint.

How to use components
  • Studio: drag and connect visually in Studio
  • SDK: configure and connect programmatically in the SDK Guide
    Most real-world agents combine multiple components into workflows.

AI & LLM Components

Work with large language models and multimodal features.

  • GenAILLM — Unified interface for LLMs (OpenAI, Anthropic, Google, etc.)
  • LLMAssistant — Multi-turn conversation
  • VisionLLM — Image analysis
  • MultimodalLLM — Text, image, and audio
  • HuggingFace — Use Hugging Face-hosted models
  • ImageGenerator — Text-to-image

Example: prompt and stream responses

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

const agent = new Agent({ name: 'LLM Demo', model: 'gpt-4o' });
const llm = agent.llm.OpenAI('gpt-4o');

// One-shot prompt
const answer = await llm.prompt('Who wrote The Great Gatsby?');
console.log(answer);

// Stream tokens
const stream = await llm.prompt('Stream this response.').stream();
stream.on(TLLMEvent.Content, (chunk) => process.stdout.write(chunk));
`}

External Integrations

Connect to web data and APIs.

  • APICall — HTTP requests with headers and OAuth
  • WebSearch — Real-time search
  • WebScrape — Extract site content
  • ZapierAction — Trigger automations
  • MCPClient — Model Context Protocol client
When to use

Choose External components whenever your agent needs real-time data or to trigger outside systems.

Data Processing

Filter, clean, and prepare data.

  • Classifier — Categorize into classes
  • JSONFilter — Extract or reshape JSON
  • DataSourceIndexer — Index documents
  • DataSourceLookup — Retrieve from an index
  • DataSourceCleaner — Normalize inputs

Example: parse documents

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

// Auto-detect parser by file type
const parsed = await Doc.auto.parse('./files/report.pdf');

// Or specify explicitly
const pdf = await Doc.pdf.parse('./files/report.pdf');
const md = await Doc.md.parse('./files/notes.md');
`}

Logic & Control Flow

Shape how workflows run.

  • LogicAND, LogicOR, LogicXOR — Boolean logic
  • LogicAtLeast, LogicAtMost — Threshold branching
  • ForEach — Iterate over lists
  • Async, Await — Run steps in parallel and then join
Design tip

Logic components give agents conditionals and loops like control flow in code.

Storage & File Operations

Work with files and code execution.

  • FileStore — Read/write files (local or S3)
  • Code — Execute inline code
  • ServerlessCode — Run serverless functions

Example: local and S3 storage

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

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

// Local storage
const local = agent.storage.LocalStorage();
await local.write('hello.txt', 'Hello world');
const data = await local.read('hello.txt');

// S3 storage
const s3 = agent.storage.S3({
bucket: 'my-bucket',
region: 'us-east-1'
});
`}

Vector Databases

Embed, index, and search data.

  • Pinecone
  • Milvus
  • RAMVec (in-memory)

Example: Pinecone search

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

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

const pinecone = agent.vectorDB.Pinecone('my-namespace', {
indexName: 'my-index',
apiKey: process.env.PINECONE_API_KEY,
embeddings: Model.OpenAI('text-embedding-3-large'),
});

await pinecone.insertDoc('doc-1', 'Some text to index');
const results = await pinecone.search('Find similar content');
console.log(results);
`}

System Integration

Expose agents across protocols and services.

  • APIEndpoint — Create custom HTTP endpoints
  • ComputerUse — Automate system tasks
  • GPTPlugin — OpenAI plugin format
  • MCP transport — Run agent as an MCP server

Example: run as MCP

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

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

// STDIO
await agent.mcp(MCPTransport.STDIO);

// Or SSE
const url = await agent.mcp(MCPTransport.SSE, 3388);
console.log('MCP listening at', url);
`}

Quick Reference

A condensed table for fast scanning.

CategoryComponentsWhat they do
AI & LLMGenAILLM, LLMAssistant, VisionLLM, MultimodalLLM, HuggingFace, ImageGeneratorPrompting and multimodal
ExternalAPICall, WebSearch, WebScrape, ZapierAction, MCPClientAPIs and integrations
DataClassifier, JSONFilter, DataSourceIndexer, DataSourceLookup, DataSourceCleanerClean, transform, search
LogicLogicAND, LogicOR, LogicXOR, LogicAtLeast, LogicAtMost, ForEach, Async, AwaitControl flow
StorageFileStore, Code, ServerlessCodeFiles and compute
VectorDBPinecone, Milvus, RAMVecEmbedding storage/search
SystemAPIEndpoint, ComputerUse, GPTPlugin, MCPIntegrations and protocols

What’s Next?