feat(docs): added docs

This commit is contained in:
Waleed Latif
2025-03-13 00:46:27 -07:00
parent 7ee1ab1d78
commit 0362bc32a9
31 changed files with 10297 additions and 116 deletions

View File

@@ -0,0 +1,158 @@
---
title: Agent
description: Create powerful AI agents using any LLM provider
---
import { Callout } from 'fumadocs-ui/components/callout'
import { Tabs, Tab } from 'fumadocs-ui/components/tabs'
import { Steps, Step } from 'fumadocs-ui/components/steps'
The Agent block is a fundamental component in Sim Studio that allows you to create powerful AI agents using various LLM providers. These agents can process inputs based on customizable system prompts and utilize integrated tools to enhance their capabilities.
<Callout type="info">
Agent blocks serve as interfaces to Large Language Models, enabling your workflow to leverage state-of-the-art AI capabilities.
</Callout>
## Overview
The Agent block serves as an interface to Large Language Models (LLMs), enabling you to create agents that can:
<Steps>
<Step>
<strong>Respond to user inputs</strong>: Generate natural language responses based on provided inputs
</Step>
<Step>
<strong>Follow instructions</strong>: Adhere to specific instructions defined in the system prompt
</Step>
<Step>
<strong>Use specialized tools</strong>: Interact with integrated tools to extend capabilities
</Step>
<Step>
<strong>Structure output</strong>: Generate responses in structured formats when needed
</Step>
</Steps>
## Configuration Options
### System Prompt
The system prompt defines the agent's behavior, capabilities, and limitations. It's the primary way to instruct the agent on how to respond to inputs.
```markdown
You are a helpful assistant that specializes in financial analysis.
Always provide clear explanations and cite sources when possible.
When responding to questions about investments, include risk disclaimers.
```
### User Prompt
The user prompt or context is the specific input or question that the agent should respond to. This can be:
- Directly provided in the block configuration
- Connected from another block's output
- Dynamically generated during workflow execution
### Model Selection
Choose from a variety of LLM providers:
- OpenAI (GPT-3.5, GPT-4)
- Anthropic (Claude)
- Google (Gemini)
- Mistral AI
- And more
### Temperature
Control the creativity and randomness of responses:
<Tabs items={['Low (0-0.3)', 'Medium (0.3-0.7)', 'High (0.7-2.0)']}>
<Tab>
<p>More deterministic, focused responses. Best for factual tasks, customer support, and situations where accuracy is critical.</p>
</Tab>
<Tab>
<p>Balanced creativity and focus. Suitable for general purpose applications that require both accuracy and some creativity.</p>
</Tab>
<Tab>
<p>More creative, varied responses. Ideal for creative writing, brainstorming, and generating diverse ideas.</p>
</Tab>
</Tabs>
<p className="mt-4 text-sm text-gray-600 dark:text-gray-400">The temperature range (0-1 or 0-2) varies depending on the selected model.</p>
### API Key
Your API key for the selected LLM provider. This is securely stored and used for authentication.
### Tools
Integrate specialized tools to enhance the agent's capabilities. Tools can be:
- Search engines for retrieving information
- Document processors for working with files
- Database connectors for data retrieval
- API clients for external service integration
- And many more
### Response Format
Define a structured format for the agent's response when needed, using JSON or other formats.
## Inputs and Outputs
<Tabs items={['Inputs', 'Outputs']}>
<Tab>
<ul className="list-disc pl-6 space-y-2">
<li><strong>User Prompt</strong>: The user's query or context for the agent</li>
<li><strong>System Prompt</strong>: Instructions for the agent (optional)</li>
<li><strong>Tools</strong>: Optional tool connections that the agent can use</li>
</ul>
</Tab>
<Tab>
<ul className="list-disc pl-6 space-y-2">
<li><strong>Content</strong>: The agent's response text</li>
<li><strong>Model</strong>: The model used for generation</li>
<li><strong>Tokens</strong>: Usage statistics (prompt, completion, total)</li>
<li><strong>Tool Calls</strong>: Details of any tools used during processing</li>
</ul>
</Tab>
</Tabs>
## Example Usage
Here's an example of how an Agent block might be configured for a customer support workflow:
```yaml
# Example Agent Configuration
systemPrompt: |
You are a customer support agent for TechCorp.
Always maintain a professional, friendly tone.
If you don't know an answer, direct the customer to email support@techcorp.com.
Never make up information about products or policies.
model: OpenAI/gpt-4
temperature: 0.2
tools:
- ProductDatabase
- OrderHistory
- SupportTicketCreator
```
## Best Practices
### Be specific in system prompts
Clearly define the agent's role, tone, and limitations. The more specific your instructions are, the better the agent will be able to fulfill its intended purpose.
### Choose the right temperature setting
- Use lower temperature settings (0-0.3) when accuracy is important
- Increase temperature (0.7-2.0) for more creative or varied responses
### Combine with Evaluator blocks
Use Evaluator blocks to assess agent responses and ensure quality. This allows you to create feedback loops and implement quality control measures.
### Leverage tools effectively
Integrate tools that complement the agent's purpose and enhance its capabilities. Be selective about which tools you provide to avoid overwhelming the agent.

View File

@@ -0,0 +1,117 @@
---
title: API
description: Connect to external services through HTTP requests
---
# API Block
The API block allows you to connect to any external API or web service through HTTP requests. It supports all standard HTTP methods and provides full customization of request parameters, making it a versatile tool for integrating external services into your workflows.
## Overview
The API block enables you to:
- Make HTTP requests to external services and APIs
- Process and transform data from external sources
- Send data to external systems
- Integrate with third-party platforms and services
- Create webhooks and callbacks
## Configuration Options
### URL
The endpoint URL for the API request. This can be:
- A static URL entered directly in the block
- A dynamic URL connected from another block's output
- A URL with path parameters
### Method
Select the HTTP method for your request:
- **GET**: Retrieve data from the server
- **POST**: Send data to the server to create a resource
- **PUT**: Update an existing resource on the server
- **DELETE**: Remove a resource from the server
- **PATCH**: Partially update an existing resource
### Query Parameters
Define key-value pairs that will be appended to the URL as query parameters. For example:
```
Key: apiKey
Value: your_api_key_here
Key: limit
Value: 10
```
These would be added to the URL as `?apiKey=your_api_key_here&limit=10`.
### Headers
Configure HTTP headers for your request. Common headers include:
```
Key: Content-Type
Value: application/json
Key: Authorization
Value: Bearer your_token_here
```
### Request Body
For methods that support a request body (POST, PUT, PATCH), you can define the data to send. The body can be:
- JSON data entered directly in the block
- Data connected from another block's output
- Dynamically generated during workflow execution
## Inputs and Outputs
### Inputs
- **URL**: The endpoint to send the request to
- **Method**: The HTTP method to use
- **Query Parameters**: Key-value pairs for URL parameters
- **Headers**: HTTP headers for the request
- **Body**: Data to send with the request (for applicable methods)
### Outputs
- **Status Code**: The HTTP status code returned by the server
- **Response Body**: The data returned by the server
- **Headers**: Response headers from the server
- **Error**: Any error information if the request fails
## Example Usage
Here's an example of how an API block might be configured to fetch weather data:
```yaml
# Example API Configuration
url: https://api.weatherapi.com/v1/current.json
method: GET
params:
- key: key
value: your_api_key_here
- key: q
value: London
- key: aqi
value: no
headers:
- key: Accept
value: application/json
```
## Best Practices
- **Use environment variables for sensitive data**: Don't hardcode API keys or credentials
- **Handle errors gracefully**: Connect error handling logic for failed requests
- **Validate responses**: Check status codes and response formats before processing data
- **Respect rate limits**: Be mindful of API rate limits and implement appropriate throttling
- **Cache responses when appropriate**: For frequently accessed data that doesn't change often

View File

@@ -0,0 +1,179 @@
---
title: Condition
description: Branch workflow execution based on boolean expressions
---
import { Callout } from 'fumadocs-ui/components/callout'
import { Tabs, Tab } from 'fumadocs-ui/components/tabs'
import { Steps, Step } from 'fumadocs-ui/components/steps'
import { Files, Folder, File } from 'fumadocs-ui/components/files'
The Condition block allows you to branch your workflow execution path based on boolean expressions. It evaluates conditions and routes the workflow accordingly, enabling you to create dynamic, responsive workflows with different execution paths.
<Callout>
Condition blocks enable deterministic decision-making without requiring an LLM, making them ideal for straightforward branching logic.
</Callout>
## Overview
The Condition block serves as a decision point in your workflow, enabling:
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 my-6">
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">Branching Logic</h3>
<p className="text-sm text-gray-600 dark:text-gray-400">
Create different execution paths based on specific conditions
</p>
</div>
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">Rule-Based Routing</h3>
<p className="text-sm text-gray-600 dark:text-gray-400">
Route workflows deterministically without needing an LLM
</p>
</div>
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">Data-Driven Decisions</h3>
<p className="text-sm text-gray-600 dark:text-gray-400">
Create workflow paths based on structured data values
</p>
</div>
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">If-Then-Else Logic</h3>
<p className="text-sm text-gray-600 dark:text-gray-400">
Implement conditional programming paradigms in your workflows
</p>
</div>
</div>
## How It Works
The Condition block:
<Steps>
<Step>
<strong>Evaluate Expression</strong>: Evaluates a boolean expression or condition
</Step>
<Step>
<strong>Determine Result</strong>: Determines whether the condition evaluates to true or false
</Step>
<Step>
<strong>Route Workflow</strong>: Routes the workflow to the appropriate path based on the result
</Step>
<Step>
<strong>Provide Context</strong>: Provides context about the decision made
</Step>
</Steps>
## Configuration Options
### Conditions
Define one or more conditions that will be evaluated. Each condition includes:
- **Expression**: A JavaScript/TypeScript expression that evaluates to true or false
- **Path**: The destination block to route to if the condition is true
- **Description**: Optional explanation of what the condition checks
You can create multiple conditions that are evaluated in order, with the first matching condition determining the execution path.
### Condition Expression Format
Conditions use JavaScript syntax and can reference input values from previous blocks.
<Tabs items={['Score Threshold', 'Text Analysis', 'Multiple Conditions']}>
<Tab>
```javascript
// Check if a score is above a threshold
input.score > 75
```
</Tab>
<Tab>
```javascript
// Check if a text contains specific keywords
input.text.includes('urgent') || input.text.includes('emergency')
```
</Tab>
<Tab>
```javascript
// Check multiple conditions
input.age >= 18 && input.country === 'US'
```
</Tab>
</Tabs>
## Inputs and Outputs
<Tabs items={['Inputs', 'Outputs']}>
<Tab>
<ul className="list-disc pl-6 space-y-2">
<li><strong>Variables</strong>: Values from previous blocks that can be referenced in conditions</li>
<li><strong>Conditions</strong>: Boolean expressions to evaluate</li>
</ul>
</Tab>
<Tab>
<ul className="list-disc pl-6 space-y-2">
<li><strong>Content</strong>: A description of the evaluation result</li>
<li><strong>Condition Result</strong>: The boolean result of the condition evaluation</li>
<li><strong>Selected Path</strong>: Details of the chosen routing destination</li>
<li><strong>Selected Condition ID</strong>: Identifier of the condition that was matched</li>
</ul>
</Tab>
</Tabs>
## Example Usage
Here's an example of how a Condition block might be used in a customer satisfaction workflow:
```yaml
# Example Condition Configuration
conditions:
- id: "high_satisfaction"
expression: "input.satisfactionScore >= 8"
description: "Customer is highly satisfied"
path: "positive_feedback_block"
- id: "medium_satisfaction"
expression: "input.satisfactionScore >= 5"
description: "Customer is moderately satisfied"
path: "neutral_feedback_block"
- id: "default"
expression: "true"
description: "Customer is not satisfied"
path: "improvement_feedback_block"
```
## Key Points from the Documentation
According to the [Fumadocs Files component documentation](https://fumadocs.vercel.app/docs/ui/components/files):
1. The `File` component requires a `name` prop (string)
2. The `File` component can optionally have an `icon` prop (ReactNode)
3. The components must be used in the correct hierarchy: `<Files>` wrapping `<Folder>` and/or `<File>` components
Make sure you're following this structure in your MDX files to avoid errors with the Files component.
## Best Practices
### Order conditions correctly
Conditions are evaluated in order, so place more specific conditions before general ones. This ensures that more specific logic takes precedence over general fallbacks.
### Include a default condition
Add a catch-all condition (e.g., `true`) as the last condition to handle cases when no other conditions match. This prevents workflow execution from getting stuck.
### Keep expressions simple
Use clear, straightforward boolean expressions for better readability. Complex expressions can be difficult to debug and maintain.
### Document your conditions
Add descriptions to explain the purpose of each condition. This helps other team members understand the logic and makes maintenance easier.
### Test edge cases
Ensure your conditions handle boundary values correctly. Test with values at the edges of your condition ranges to verify correct behavior.

View File

@@ -0,0 +1,116 @@
---
title: Evaluator
description: Assess content quality using customizable evaluation metrics
---
# Evaluator Block
The Evaluator block allows you to assess content quality using customizable evaluation metrics and scoring criteria. It enables you to create objective evaluation frameworks with numeric scoring to measure performance across multiple dimensions.
## Overview
The Evaluator block utilizes LLMs to objectively evaluate content based on custom metrics you define. This is especially useful for:
- Assessing the quality of AI-generated content
- Evaluating responses against specific criteria
- Creating scoring frameworks for different types of content
- Building objective feedback loops in your workflows
## Configuration Options
### Evaluation Metrics
Define custom metrics to evaluate content against. Each metric includes:
- **Name**: A short identifier for the metric
- **Description**: A detailed explanation of what the metric measures
- **Range**: The numeric range for scoring (e.g., 1-5, 0-10)
Example metrics:
```
Accuracy (1-5): How factually accurate is the content?
Clarity (1-5): How clear and understandable is the content?
Relevance (1-5): How relevant is the content to the original query?
```
### Content
The content to be evaluated. This can be:
- Directly provided in the block configuration
- Connected from another block's output (typically an Agent block)
- Dynamically generated during workflow execution
### Model Selection
Choose an LLM provider to perform the evaluation:
- OpenAI (GPT-3.5, GPT-4)
- Anthropic (Claude)
- Google (Gemini)
- Mistral AI
- And more
The chosen model should have strong reasoning capabilities to provide accurate evaluations.
### API Key
Your API key for the selected LLM provider. This is securely stored and used for authentication.
## How It Works
1. The Evaluator block takes the provided content and your custom metrics
2. It generates a specialized prompt that instructs the LLM to evaluate the content
3. The prompt includes clear guidelines on how to score each metric
4. The LLM evaluates the content and returns numeric scores for each metric
5. The Evaluator block formats these scores as structured output for use in your workflow
## Inputs and Outputs
### Inputs
- **Content**: The text or structured data to evaluate
- **Metrics**: Custom evaluation criteria with scoring ranges
- **Model Settings**: LLM provider and parameters
### Outputs
- **Content**: A summary of the evaluation
- **Model**: The model used for evaluation
- **Tokens**: Usage statistics
- **Metric Scores**: Numeric scores for each defined metric
## Example Usage
Here's an example of how an Evaluator block might be configured for assessing customer service responses:
```yaml
# Example Evaluator Configuration
metrics:
- name: Empathy
description: How well does the response acknowledge and address the customer's emotional state?
range:
min: 1
max: 5
- name: Solution
description: How effectively does the response solve the customer's problem?
range:
min: 1
max: 5
- name: Clarity
description: How clear and easy to understand is the response?
range:
min: 1
max: 5
model: Anthropic/claude-3-opus
```
## Best Practices
- **Use specific metric descriptions**: Clearly define what each metric measures to get more accurate evaluations
- **Choose appropriate ranges**: Select scoring ranges that provide enough granularity without being overly complex
- **Connect with Agent blocks**: Use Evaluator blocks to assess Agent block outputs and create feedback loops
- **Use consistent metrics**: For comparative analysis, maintain consistent metrics across similar evaluations
- **Combine multiple metrics**: Use several metrics to get a comprehensive evaluation

View File

@@ -0,0 +1,126 @@
---
title: Function
description: Execute custom JavaScript or TypeScript code within your workflow
---
# Function Block
The Function block allows you to execute custom JavaScript or TypeScript code within your workflow. This enables you to implement complex logic, transform data, or create custom functionality that extends beyond the capabilities of other blocks.
## Overview
The Function block brings the full power of JavaScript/TypeScript to your workflows, allowing for:
- Custom data transformation and manipulation
- Complex conditional logic
- Mathematical calculations and algorithms
- Integration with external libraries
- Creation of reusable utility functions
## How It Works
The Function block:
1. Takes your custom JavaScript/TypeScript code
2. Executes it in a secure, isolated environment
3. Processes any inputs provided from previous blocks
4. Returns the result for use in subsequent blocks
## Configuration Options
### Code Editor
A full-featured code editor where you can write your JavaScript/TypeScript code. The editor supports:
- Syntax highlighting
- Code completion
- Error checking
- Multiple lines of code
### Inputs
Your function can access inputs from previous blocks through an `input` object. For example:
```javascript
// Access data from a previous block
const customerName = input.customerData.name;
const orderTotal = input.orderData.total;
// Process the data
const discount = orderTotal > 100 ? 0.1 : 0;
const finalPrice = orderTotal * (1 - discount);
// Return the result
return {
customerName,
originalTotal: orderTotal,
discount: discount * 100 + '%',
finalPrice
};
```
## Safety and Limitations
For security and performance reasons, function execution has certain limitations:
- **Execution Time**: Functions have a maximum execution time to prevent infinite loops
- **Memory Usage**: Memory is limited to prevent excessive resource usage
- **Network Access**: Network calls are restricted to prevent unauthorized access
- **Available APIs**: Only a subset of browser APIs are available
## Inputs and Outputs
### Inputs
- **Code**: Your JavaScript/TypeScript code to execute
- **Input Data**: Values from previous blocks that can be accessed in your code
### Outputs
- **Result**: The value returned by your function
- **Standard Output**: Any console output from your function
- **Execution Time**: The time taken to execute your function (in milliseconds)
## Example Usage
Here's an example of a Function block that processes customer data and calculates a loyalty score:
```javascript
// Example Function Block Code
// Process customer data and calculate loyalty score
// Access input from previous blocks
const { purchaseHistory, accountAge, supportTickets } = input;
// Calculate metrics
const totalSpent = purchaseHistory.reduce((sum, purchase) => sum + purchase.amount, 0);
const purchaseFrequency = purchaseHistory.length / (accountAge / 365);
const ticketRatio = supportTickets.resolved / supportTickets.total;
// Calculate loyalty score (0-100)
const spendScore = Math.min(totalSpent / 1000 * 30, 30);
const frequencyScore = Math.min(purchaseFrequency * 20, 40);
const supportScore = ticketRatio * 30;
const loyaltyScore = Math.round(spendScore + frequencyScore + supportScore);
// Return results
return {
customer: input.name,
loyaltyScore,
loyaltyTier: loyaltyScore >= 80 ? "Platinum" : loyaltyScore >= 60 ? "Gold" : loyaltyScore >= 40 ? "Silver" : "Bronze",
metrics: {
spendScore,
frequencyScore,
supportScore
}
};
```
## Best Practices
- **Keep functions focused**: Write functions that do one thing well
- **Handle errors gracefully**: Use try/catch blocks to handle potential errors
- **Document your code**: Add comments to explain complex logic
- **Test edge cases**: Ensure your code handles unusual inputs correctly
- **Optimize for performance**: Be mindful of computational complexity for large datasets

View File

@@ -0,0 +1,131 @@
---
title: Blocks
description: Building blocks for your agentic workflows
---
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Tabs, Tab } from 'fumadocs-ui/components/tabs'
import { Steps, Step } from 'fumadocs-ui/components/steps'
Blocks are the fundamental building components of Sim Studio workflows. Each block has a specific purpose and can be connected to other blocks to create sophisticated workflows.
## What is a Block?
A block is a reusable, configurable component that performs a specific function within your workflow. Blocks have inputs and outputs that allow them to communicate with other blocks. They can process data, make decisions, interact with external systems, or perform computations.
## Primary Block Types
Sim Studio provides six powerful block types that form the foundation of any workflow. Each block is designed to handle specific aspects of your agentic applications, from AI-powered reasoning to conditional logic and external integrations.
<Tabs items={['Grid View', 'Card View']}>
<Tab>
<div className="grid grid-cols-2 md:grid-cols-3 gap-4 my-6">
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">Agent</h3>
<div className="text-sm text-gray-600 dark:text-gray-400">
Create powerful AI agents using any LLM provider
</div>
</div>
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">API</h3>
<div className="text-sm text-gray-600 dark:text-gray-400">
Connect to external services through HTTP requests
</div>
</div>
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">Condition</h3>
<div className="text-sm text-gray-600 dark:text-gray-400">
Branch workflow execution based on boolean expressions
</div>
</div>
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">Function</h3>
<div className="text-sm text-gray-600 dark:text-gray-400">
Execute custom JavaScript or TypeScript code
</div>
</div>
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">Evaluator</h3>
<div className="text-sm text-gray-600 dark:text-gray-400">
Assess content quality using customizable metrics
</div>
</div>
<div className="border border-gray-200 dark:border-gray-800 rounded-lg p-4">
<h3 className="font-medium text-lg mb-2">Router</h3>
<div className="text-sm text-gray-600 dark:text-gray-400">
Intelligently direct workflow execution
</div>
</div>
</div>
</Tab>
<Tab>
<Cards>
<Card
title="Agent"
href="/docs/blocks/agent"
description="Create powerful AI agents using any LLM provider with customizable system prompts and tool integrations."
icon="🤖"
/>
<Card
title="API"
href="/docs/blocks/api"
description="Connect to any external API with support for all standard HTTP methods and customizable request parameters."
icon="🔌"
/>
<Card
title="Condition"
href="/docs/blocks/condition"
description="Add a condition to the workflow to branch the execution path based on a boolean expression."
icon="🔀"
/>
<Card
title="Function"
href="/docs/blocks/function"
description="Execute custom JavaScript or TypeScript code within your workflow to transform data or implement complex logic."
icon="⚙️"
/>
<Card
title="Evaluator"
href="/docs/blocks/evaluator"
description="Assess content quality using customizable evaluation metrics and scoring criteria."
icon="📊"
/>
<Card
title="Router"
href="/docs/blocks/router"
description="Intelligently direct workflow execution to different paths based on input analysis."
icon="🔄"
/>
</Cards>
</Tab>
</Tabs>
## Block Connections
Blocks can be connected to form a directed graph representing your workflow. Each connection represents the flow of data from one block to another:
<Steps>
<Step>
<strong>Outputs to Inputs</strong>: A block's outputs can be connected to another block's inputs.
</Step>
<Step>
<strong>Multiple Connections</strong>: A block can have multiple incoming and outgoing connections.
</Step>
<Step>
<strong>Conditional Flows</strong>: Some blocks (like Router and Condition) can have multiple output paths based on conditions.
</Step>
</Steps>
## Block Configuration
Each block type has its own configuration options allowing you to customize its behavior.
### Common Configuration Options
- **Input/output definitions**: Define how data flows in and out of the block
- **Processing instructions**: Configure how the block processes its inputs
- **API keys or authentication details**: Provide necessary credentials for external services
- **Retry policies**: Configure how the block handles failures
- **Error handling behavior**: Define how errors are managed and reported
See the specific documentation for each block type to learn about its configuration options.

View File

@@ -0,0 +1,4 @@
{
"title": "Blocks",
"pages": ["agent", "api", "condition", "function", "evaluator", "router"]
}

View File

@@ -0,0 +1,107 @@
---
title: Router Block
description: Route workflow execution based on specific conditions or logic
---
# Router Block
The Router block is a powerful component in Sim Studio that intelligently routes workflow execution based on content analysis, user input, or predefined conditions. It acts as a decision-making junction in your workflow, directing the flow to different paths based on various criteria.
## Overview
The Router block uses LLMs to analyze input content and determine the most appropriate next step in your workflow. This allows for:
- Creating dynamic, adaptable workflows
- Implementing complex decision trees
- Routing user requests to specialized components
- Building conversational systems that can handle diverse inputs
## How It Works
The Router block:
1. Analyzes the input content using an LLM
2. Evaluates the content against the available target blocks in your workflow
3. Identifies the most appropriate destination based on the content's intent or requirements
4. Routes the workflow execution to the selected block
## Configuration Options
### Content/Prompt
The content or prompt that the Router will analyze to make routing decisions. This can be:
- A direct user query or input
- Output from a previous block
- A system-generated message
### Target Blocks
The possible destination blocks that the Router can select from. The Router will automatically detect connected blocks, but you can also:
- Customize the descriptions of target blocks to improve routing accuracy
- Specify routing criteria for each target block
- Exclude certain blocks from being considered as routing targets
### Model Selection
Choose an LLM provider to power the routing decision:
- OpenAI (GPT-3.5, GPT-4)
- Anthropic (Claude)
- Google (Gemini)
- Mistral AI
- And more
Select a model with strong reasoning capabilities for more accurate routing decisions.
### API Key
Your API key for the selected LLM provider. This is securely stored and used for authentication.
## Inputs and Outputs
### Inputs
- **Content/Prompt**: The text to analyze for routing decisions
- **Target Blocks**: Connected blocks that are potential routing destinations
- **Model Settings**: LLM provider and parameters
### Outputs
- **Content**: A summary of the routing decision
- **Model**: The model used for decision-making
- **Tokens**: Usage statistics
- **Selected Path**: Details of the chosen routing destination, including:
- Block ID
- Block Type
- Block Title
## Example Usage
Here's an example of how a Router block might be used in a customer support workflow:
```yaml
# Example Router Configuration
prompt: |
Analyze the user query and route to the most appropriate department.
Choose ONE destination based on the query content and intent.
model: OpenAI/gpt-4
```
In this example, the Router might be connected to:
- A product support block
- A billing inquiries block
- A technical support block
- A general inquiries block
Based on the user's query, the Router would analyze the content and direct it to the most appropriate specialized support block.
## Best Practices
- **Provide clear descriptions for target blocks**: Help the Router understand when to select each destination
- **Use specific routing criteria**: Define clear conditions for selecting each path
- **Consider fallback paths**: Connect a default destination for when no specific path is appropriate
- **Test with diverse inputs**: Ensure the Router handles various input types correctly
- **Review routing decisions**: Monitor the Router's performance and refine as needed

View File

@@ -0,0 +1,107 @@
---
title: Getting Started
description: Build, test, and optimize your agentic workflows
---
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Steps, Step } from 'fumadocs-ui/components/steps'
import { Callout } from 'fumadocs-ui/components/callout'
import { Tabs, Tab } from 'fumadocs-ui/components/tabs'
Sim Studio is a powerful, user-friendly platform for building, testing, and optimizing your agentic workflows. This documentation will help you understand how to use the various components of Sim Studio to create sophisticated agent-based applications.
<Callout type="info">
This guide will walk you through the essential concepts and help you get started building your first workflow.
</Callout>
## Core Concepts
Sim Studio is built around two fundamental concepts:
<Cards>
<Card
title="Blocks"
href="/docs/blocks"
description="The building blocks of your workflows - Agent, Router, Evaluator, Condition, Function, and API blocks that can be connected together."
icon="🧩"
/>
<Card
title="Tools"
href="/docs/tools"
description="Specialized functionality that can be used standalone or integrated within blocks to extend capabilities."
icon="🔧"
/>
</Cards>
## Getting Started
<Steps>
<Step title="Create a new workflow">
Start by creating a new workflow in the Sim Studio dashboard.
</Step>
<Step title="Add your first block">
Drag and drop a block from the sidebar onto the canvas.
</Step>
<Step title="Configure the block">
Set up the block's parameters and inputs according to your needs.
</Step>
<Step title="Connect blocks">
Create connections between blocks to define the flow of data and execution.
</Step>
<Step title="Test your workflow">
Run your workflow with test inputs to verify its behavior.
</Step>
</Steps>
## Explore Blocks
<Tabs items={['Agent Blocks', 'Logic Blocks', 'Integration Blocks']}>
<Tab>
<Cards>
<Card
title="Agent"
href="/docs/blocks/agent"
description="Create AI agents that can process inputs and generate outputs based on instructions."
icon="🤖"
/>
<Card
title="Evaluator Block"
href="/docs/blocks/evaluator"
description="Evaluate agent responses against specific criteria."
icon="📊"
/>
</Cards>
</Tab>
<Tab>
<Cards>
<Card
title="Router Block"
href="/docs/blocks/router"
description="Route workflow execution based on specific conditions."
icon="🔄"
/>
<Card
title="Condition Block"
href="/docs/blocks/condition"
description="Create conditional logic to control workflow execution paths."
icon="🔀"
/>
</Cards>
</Tab>
<Tab>
<Cards>
<Card
title="Function Block"
href="/docs/blocks/function"
description="Execute custom JavaScript/TypeScript functions."
icon="⚙️"
/>
<Card
title="API Block"
href="/docs/blocks/api"
description="Make API calls to external services."
icon="🔌"
/>
</Cards>
</Tab>
</Tabs>

View File

@@ -0,0 +1,87 @@
---
title: Introduction
description: A powerful platform for building, testing, and optimizing agentic workflows
---
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Files, Folder, File } from 'fumadocs-ui/components/files'
import { Callout } from 'fumadocs-ui/components/callout'
Sim Studio is a powerful platform for building, testing, and optimizing agentic workflows. It provides developers with intuitive tools to design sophisticated agent-based applications through a visual interface. Whether you're prototyping a simple AI assistant or building complex multi-agent systems, Sim Studio offers the flexibility and performance needed for modern AI applications.
## Why Sim Studio?
<Callout>
Building agentic applications has traditionally required extensive coding and integration work. Developers often find themselves spending more time on infrastructure and plumbing rather than focusing on the core AI logic. Sim Studio changes this by providing a comprehensive visual workflow editor that handles the complexity while keeping you in control of what matters.
</Callout>
## Features
Sim Studio provides a wide range of features designed to accelerate your development process:
<Cards>
<Card
title="Visual Workflow Editor"
description="Build complex workflows using a drag-and-drop interface with real-time previews"
icon="📊"
/>
<Card
title="Modular Building Blocks"
description="Compose workflows using pre-built blocks for agents, APIs, functions, and more"
icon="🧩"
/>
<Card
title="Multiple LLM Support"
description="Connect to various LLM providers and models with built-in optimization"
icon="🤖"
/>
<Card
title="Testing & Debugging"
description="Test workflows with simulated inputs and debug with detailed execution logs"
icon="🔍"
/>
<Card
title="Conditional Logic"
description="Create sophisticated decision trees using conditional branching and routing"
icon="🔀"
/>
<Card
title="API Integrations"
description="Connect to external services with customizable API blocks and tools"
icon="🔌"
/>
</Cards>
## Core Components
Sim Studio is built around two primary components:
### Blocks
Blocks are the fundamental building elements of your workflows. Each block serves a specific purpose:
<Files>
<Folder name="Blocks" defaultOpen>
<File name="Agent Block" annotation="Create AI agents using any LLM provider" />
<File name="API Block" annotation="Connect to external services and APIs" />
<File name="Condition Block" annotation="Add conditional branching to your workflows" />
<File name="Function Block" annotation="Execute custom JavaScript/TypeScript code" />
<File name="Evaluator Block" annotation="Assess responses against defined criteria" />
<File name="Router Block" annotation="Direct workflow execution based on input analysis" />
</Folder>
</Files>
### Tools
Tools extend the capabilities of blocks by providing specialized functionality:
<Files>
<Folder name="Tools" defaultOpen>
<File name="Data Transformation" annotation="Process and transform data between blocks" />
<File name="Configuration Management" annotation="Handle environment variables and secrets" />
<File name="Testing Suite" annotation="Validate workflow behavior with test scenarios" />
<File name="Logging & Monitoring" annotation="Track execution and performance metrics" />
</Folder>
</Files>
Ready to get started? Check out our [Getting Started](/docs/getting-started) guide or explore our [Blocks](/docs/blocks) and [Tools](/docs/tools) in more detail.

View File

@@ -0,0 +1,4 @@
{
"title": "Sim Studio Documentation",
"pages": ["introduction", "getting-started", "blocks", "tools"]
}

View File

@@ -0,0 +1,59 @@
---
title: Tools
description: Specialized functionality to extend your workflow capabilities
---
import { Callout } from 'fumadocs-ui/components/callout'
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
import { Files, Folder, File } from 'fumadocs-ui/components/files'
Tools in Sim Studio provide specialized functionality that can be used standalone or integrated within blocks to extend capabilities.
## Available Tools
Sim Studio offers a variety of tools to enhance your workflows:
<Files>
<Folder name="Tools" defaultOpen>
<File name="Data Transformation" annotation="Process and transform data between blocks" />
<File name="Configuration Management" annotation="Handle environment variables and secrets" />
<File name="Testing Suite" annotation="Validate workflow behavior with test scenarios" />
<File name="Logging & Monitoring" annotation="Track execution and performance metrics" />
</Folder>
</Files>
## Using Tools
Tools can be integrated with blocks to provide additional functionality. For example, you can use data transformation tools with Function blocks to process data, or logging tools to track the execution of your workflow.
<Callout type="info">
Tools are constantly being added and improved. Check back regularly for new capabilities.
</Callout>
## Tool Categories
<Accordions>
<Accordion title="Data Processing Tools">
Tools for transforming, validating, and manipulating data as it flows through your workflow.
- **Data Validators**: Ensure data meets specific criteria before processing
- **Formatters**: Convert data between different formats (JSON, XML, CSV)
- **Transformers**: Apply complex transformations to structured data
</Accordion>
<Accordion title="Integration Tools">
Tools for connecting to external services and systems.
- **API Connectors**: Pre-built connectors for popular services
- **Database Tools**: Tools for querying and manipulating databases
- **File System Tools**: Tools for reading and writing files
</Accordion>
<Accordion title="Utility Tools">
General-purpose tools for common tasks.
- **Text Processing**: Tools for working with text data
- **Math & Statistics**: Tools for numerical calculations
- **Date & Time**: Tools for working with temporal data
</Accordion>
</Accordions>