Skip to content

LLM Workflow Canvas#

The LLM Workflow Canvas is a powerful visual tool in the LIT Platform that allows you to build complex, multi-step LLM applications using a simple drag-and-drop interface. No coding is required to create sophisticated workflows that can process data, interact with external systems, and generate intelligent outputs.

Key Features#

  • Visual Programming: Drag-and-drop interface for building LLM workflows
  • Component Library: Pre-built components for common LLM tasks
  • Data Flow: Visual representation of data flowing between components
  • Stateful Processing: Maintain state throughout workflow execution
  • Input/Output Mapping: Visually connect inputs and outputs between components
  • Error Handling: Built-in error handling and recovery mechanisms
  • Versioning: Track changes to workflows over time

Workflow Components#

The canvas comes with an extensive library of components:

Input/Output Components#

  • Input: Define the starting point for workflow data
  • Output: Designate the final output of the workflow
  • User Input: Create forms for collecting user inputs
  • Response Formatter: Format the final response for presentation

LLM Components#

  • LLM Prompt: Send text to a language model
  • Chain: Connect multiple LLM calls together
  • System Message: Define the behavior of the LLM
  • Few-Shot Examples: Provide examples to guide the model's responses
  • Embedding Generator: Create vector embeddings from text

Data Processing#

  • Text Splitter: Split text into manageable chunks
  • Text Transformer: Apply transformations to text
  • JSON Parser: Parse JSON data
  • CSV Processor: Work with CSV data
  • Data Merger: Combine multiple data sources

External Connections#

  • Web Search: Retrieve information from the internet
  • Database Query: Connect to databases
  • API Call: Make requests to external APIs
  • File Reader: Read from files
  • File Writer: Write to files

Control Flow#

  • Conditional Branch: Create decision points in your workflow
  • Loop: Repeat operations for items in a collection
  • Parallel Execution: Run operations concurrently
  • Aggregator: Combine results from multiple branches

Building a Workflow#

Basic Workflow Steps#

  1. Create a New Workflow:
  2. Navigate to LLM Studio > Workflows
  3. Click "Create New Workflow"
  4. Provide a name and description

  5. Design the Workflow:

  6. Drag components from the sidebar onto the canvas
  7. Connect components by dragging from output ports to input ports
  8. Configure each component by clicking on it and setting parameters

  9. Test the Workflow:

  10. Click "Test" to run the workflow with sample data
  11. Observe the data flow through each component
  12. Debug any issues by inspecting the state at each step

  13. Save and Deploy:

  14. Click "Save" to store your workflow
  15. Use "Deploy" to make it available for production use

Example: Customer Support Workflow#

Here's an example of a simple customer support workflow:

  1. Input: User query from chat interface
  2. Classifier: Categorize the query (Technical, Billing, General)
  3. Branch: Route to specialized LLM prompts based on category
  4. Database Query: Retrieve relevant information if needed
  5. LLM Response Generator: Create tailored response
  6. Output: Send response back to user

Advanced Features#

Memory Management#

Workflows can maintain memory across invocations:

  • Session Memory: Retain information for a single user session
  • Long-term Storage: Store important information in databases
  • Context Window Management: Automatically manage context size for LLMs

Debugging Tools#

  • Visual Debugger: Step through workflow execution
  • State Inspector: Examine data at any point in the workflow
  • Execution Logs: View detailed logs of workflow execution
  • Time Travel: Review previous executions of the workflow

Component Templates#

Save commonly used configurations as templates:

  1. Configure a component with your preferred settings
  2. Right-click and select "Save as Template"
  3. Name your template
  4. Access it from the templates section in the component library

Best Practices#

  • Start Simple: Begin with basic workflows and add complexity incrementally
  • Test Frequently: Test components individually before connecting them
  • Error Handling: Add error handling components at critical points
  • Documentation: Use notes and labels to document your workflow
  • Modularize: Create reusable sub-workflows for common patterns

Importing and Exporting#

Workflows can be shared between environments:

  • Export workflows as JSON files
  • Import workflows from files
  • Version control integration for tracking changes
  • Template library for organization-wide sharing