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#
- Create a New Workflow:
- Navigate to LLM Studio > Workflows
- Click "Create New Workflow"
-
Provide a name and description
-
Design the Workflow:
- Drag components from the sidebar onto the canvas
- Connect components by dragging from output ports to input ports
-
Configure each component by clicking on it and setting parameters
-
Test the Workflow:
- Click "Test" to run the workflow with sample data
- Observe the data flow through each component
-
Debug any issues by inspecting the state at each step
-
Save and Deploy:
- Click "Save" to store your workflow
- Use "Deploy" to make it available for production use
Example: Customer Support Workflow#
Here's an example of a simple customer support workflow:
- Input: User query from chat interface
- Classifier: Categorize the query (Technical, Billing, General)
- Branch: Route to specialized LLM prompts based on category
- Database Query: Retrieve relevant information if needed
- LLM Response Generator: Create tailored response
- 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:
- Configure a component with your preferred settings
- Right-click and select "Save as Template"
- Name your template
- 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