Skip to main content

AI Assistant

The AI Assistant is an intelligent chat interface integrated into the workflow editor that can create workflow entities on your behalf. It uses natural language understanding combined with documentation search (RAG) to understand your intent and generate entities automatically.

Overview

The Assistant provides a conversational way to build workflows:

  • Natural Language Entity Creation — Describe what you want, and the assistant creates it
  • Context-Aware — Uses documentation search to understand available functions and patterns
  • Tool Calling — Actually creates entities in the database, not just explanations

Accessing the Assistant

The Assistant tab is available in the workflow editor sidebar:

  1. Open a workflow from the Workflows page
  2. Click the Assistant tab in the left sidebar
  3. Type your request in the chat input

Example Prompts

The Assistant understands various ways to request entity creation:

RequestWhat Gets Created
"Create an action that posts to Mastodon"Action entity with Mastodon posting script
"Create an event for NFL touchdowns"Event entity with touchdown condition
"Create a prompt for generating tweets"Prompt entity with tweet generation template
"Create an action to store data in S3"Action entity with STM script

How It Works

1. Documentation Search (RAG)

When you send a message, the Assistant:

  1. Generates an embedding of your query using OpenAI
  2. Searches the documentation database for relevant content
  3. Retrieves the most similar documentation chunks
  4. Uses this context to inform its response

2. Tool Calling

The Assistant can execute actions using OpenAI function calling:

Available Tools:

ToolPurpose
create_workflow_entityCreates a new entity in the database
list_entity_typesLists available entity types and their configurations

3. Entity Creation

When creating an entity, the Assistant:

  1. Determines the appropriate entity type (event, action, prompt)
  2. Generates relevant configuration (script, prompt text, conditions)
  3. Creates the entity in your current organization and environment
  4. Returns confirmation with the created entity details

Created Entities

After the Assistant creates an entity:

  • A success chip appears showing the entity name
  • Click the chip to open the entity editor
  • The entity is automatically added to the entities list
  • You can immediately drag it onto the canvas

Context Sources

The Assistant shows which documentation informed its response:

  • Click "X sources" below a response to expand
  • Each source shows the document title and similarity score
  • Higher similarity scores indicate more relevant context

Capabilities

The Assistant can create entities with:

For Action entities:

  • Custom JavaScript scripts using available functions
  • print(), postToMastodon(), stmStore(), pubsubPublish()
  • Access to message, environment variables, and output globals

For Prompt entities:

  • Prompt templates for LLM calls
  • Model selection guidance
  • Argument configuration

For Event entities:

  • Condition expressions
  • Branching logic (Single Path, True/False, Multi)
  • Logic field configuration

Best Practices

Be Specific

Good: "Create an action that posts the latest AI response to Mastodon using the MASTODON_URL variable"
Bad: "Create a posting action"

Reference Available Functions

"Create an action that uses postLatestPromptToMastodon() to share AI responses"

Mention Required Variables

"Create an action that calls the API using OPENAI_API_KEY"

Configuration

The Assistant requires OpenAI API credentials:

OPENAI_API_KEY=sk-proj-xxxxxxxxxxxx

API Reference

OperationMethodEndpoint
ChatPOST/api/assistant/chat
Search DocsPOST/api/documentation/search

Chat Request

{
"message": "Create an action that posts to Mastodon",
"history": [],
"organizationId": "org-id",
"environmentId": "env-id"
}

Chat Response

{
"message": "I have created a Post to Mastodon action...",
"context": [
{ "title": "Mastodon Scripts", "similarity": 0.89 }
],
"createdEntities": [
{ "id": "entity-id", "name": "Post to Mastodon", "type": "action" }
]
}