Skip to content

Repository files navigation

LLM Workflow Platform

A powerful platform that combines conversational AI with visual workflow automation, enabling seamless integration between LLM chat interfaces and customizable tool execution flows.

Overview

This project provides a unified environment where users can:

  • Chat naturally with Large Language Models (LLMs)
  • Design complex workflows using a visual flow editor
  • Create and share custom MCP (Model Context Protocol) tools
  • Enable LLMs to intelligently trigger workflow actions based on conversation context

Key Features

🤖 LLM Chat Interface

  • Clean, intuitive chat interface for interacting with various LLMs
  • Real-time streaming responses
  • Conversation history management
  • Multi-model support
  • Context-aware interactions

🔄 Visual Flow Editor

  • Drag-and-drop workflow designer
  • Node-based architecture for building automation flows
  • Visual connections between workflow steps
  • Real-time flow execution preview
  • Conditional logic and branching support
  • Error handling and retry mechanisms

🛠️ MCP Tools System

  • Custom Tool Creation: Build your own tools with simple interfaces
  • Community Tools: Browse and integrate tools created by the community
  • Tool Marketplace: Share your tools with other users
  • Version Control: Track tool versions and updates
  • Tool Categories: Organize tools by function (data processing, API calls, notifications, etc.)

🔗 LLM-Workflow Integration

  • LLMs can automatically trigger workflow tools during conversations
  • Intelligent tool selection based on user intent
  • Seamless data flow between chat and workflows
  • Real-time execution feedback in chat interface
  • Parameter extraction from natural language

Architecture

┌─────────────────────────────────────────────────────────┐
│                    Frontend Layer                       │
│  ┌──────────────────┐      ┌──────────────────────┐     │
│  │   Chat Interface │      │   Flow Editor        │     │
│  │   - Message UI   │      │   - Canvas           │     │
│  │   - Input Box    │      │   - Node Library     │     │
│  │   - History      │      │   - Connection Lines │     │
│  └──────────────────┘      └──────────────────────┘     │
└─────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────┐
│                   API Gateway Layer                     │
│  - Request Routing                                      │
│  - Authentication & Authorization                       │
│  - Rate Limiting                                        │
└─────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────┐
│                   Core Services                         │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐   │
│  │LLM Connector │  │Flow Engine   │  │Tool Manager  │   │
│  │- Model APIs  │  │- Execution   │  │- Registry    │   │
│  │- Streaming   │  │- Scheduling  │  │- Validation  │   │
│  └──────────────┘  └──────────────┘  └──────────────┘   │
└─────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────┐
│                   Data Layer                            │
│  - User Data                                            │
│  - Conversation History                                 │
│  - Workflow Definitions                                 │
│  - Tool Catalog                                         │
│  - Execution Logs                                       │
└─────────────────────────────────────────────────────────┘

Use Cases

Data Processing Workflows

Create workflows that process data from various sources, with LLMs helping users define transformation logic through natural conversation.

API Integration Automation

Build chains of API calls triggered by user requests in chat, with the LLM understanding context and parameters.

Content Generation Pipelines

Design multi-step content creation workflows where LLMs generate, refine, and publish content across platforms.

Monitoring and Alerts

Set up intelligent monitoring systems where LLMs analyze data and trigger notification workflows when patterns are detected.

Custom Business Logic

Implement complex business processes with decision points handled by LLMs and execution managed by workflows.

MCP Tool Structure

Tools follow the Model Context Protocol specification:

{
  "name": "tool_name",
  "description": "What the tool does",
  "version": "1.0.0",
  "author": "creator_name",
  "parameters": {
    "param1": {
      "type": "string",
      "description": "Parameter description",
      "required": true
    }
  },
  "execution": {
    "type": "workflow" | "function" | "api",
    "config": {}
  }
}

Getting Started

Prerequisites

  • Node.js 18+
  • Docker (optional, for containerized deployment)
  • Database (PostgreSQL recommended)
  • LLM API keys (OpenAI, Anthropic, etc., BYOK model)

Installation

# Clone the repository
git clone https://github.com/phantomthor/clubetr.git

# Navigate to project directory
cd clubetr

# Install dependencies
npm install
# or
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# Initialize database
npm run db:migrate
# or
python manage.py migrate

# Start the development server
npm run dev
# or
python manage.py runserver

Configuration

Edit .env file:

# LLM Configuration
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/llm_workflow

# Server
PORT=3000
NODE_ENV=development

# Tool Registry
TOOL_REGISTRY_URL=https://tools.example.com

Creating Your First Tool

Step 1: Define Tool Metadata

// tools/my_custom_tool.js
export const toolDefinition = {
  name: "data_transformer",
  description: "Transforms data from one format to another",
  version: "1.0.0",
  category: "data_processing",
  parameters: {
    input_data: {
      type: "object",
      description: "Data to transform"
    },
    output_format: {
      type: "string",
      enum: ["json", "csv", "xml"],
      description: "Desired output format"
    }
  }
};

Step 2: Implement Tool Logic

export async function execute(params) {
  const { input_data, output_format } = params;
  
  // Your transformation logic here
  const result = transformData(input_data, output_format);
  
  return {
    success: true,
    data: result
  };
}

Step 3: Register Tool

import { ToolRegistry } from './core/tool_registry';

ToolRegistry.register(toolDefinition, execute);

Creating a Workflow

Visual Editor Method

  1. Open the Flow Editor
  2. Drag nodes from the tool library onto the canvas
  3. Connect nodes by drawing lines between output and input ports
  4. Configure each node's parameters
  5. Test the workflow
  6. Save and activate

Code Definition Method

# workflows/example_workflow.yaml
name: Data Processing Pipeline
description: Fetch, transform, and store data
trigger:
  type: llm_invoked
  intent: "process user data"

steps:
  - id: fetch_data
    tool: api_caller
    params:
      url: "${user.data_source}"
      method: GET
    
  - id: transform
    tool: data_transformer
    params:
      input_data: "${fetch_data.output}"
      output_format: json
    depends_on: [fetch_data]
    
  - id: store
    tool: database_writer
    params:
      data: "${transform.output}"
      table: user_data
    depends_on: [transform]

LLM Integration

The platform automatically makes workflow tools available to the LLM:

// Example conversation
User: "Can you fetch my sales data and convert it to CSV?"

LLM: "I'll help you with that. Let me process your sales data."
// LLM automatically triggers:
// 1. fetch_data tool with user's data source
// 2. data_transformer tool with CSV output format

LLM: "Done! I've converted your sales data to CSV format. 
      The file contains 150 records and is ready for download."

API Reference

Chat Endpoints

POST /api/chat/message
POST /api/chat/stream
GET  /api/chat/history
DELETE /api/chat/conversation/:id

Workflow Endpoints

POST /api/workflows
GET  /api/workflows
GET  /api/workflows/:id
PUT  /api/workflows/:id
DELETE /api/workflows/:id
POST /api/workflows/:id/execute
GET  /api/workflows/:id/logs

Tool Endpoints

GET  /api/tools
GET  /api/tools/:id
POST /api/tools
PUT  /api/tools/:id
DELETE /api/tools/:id
POST /api/tools/:id/test

Community & Contribution

Sharing Tools

  • Publish your tools to the community marketplace
  • Add detailed documentation and examples
  • Include test cases and validation rules
  • Semantic versioning for updates

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Follow the project's ESLint/Prettier configuration
  • Write unit tests for new features
  • Update documentation for API changes
  • Maintain backward compatibility when possible

Security

  • All API keys are encrypted at rest
  • Tool execution happens in sandboxed environments
  • Rate limiting on all endpoints
  • Input validation and sanitization
  • Regular security audits
  • OAuth 2.0 authentication support

Performance

  • Workflow execution parallelization
  • Caching layer for frequently used tools
  • Connection pooling for database operations
  • Lazy loading of workflow nodes
  • Optimized LLM token usage

Roadmap

  • Multi-language support for tool development
  • Visual debugging tools for workflows
  • Advanced analytics dashboard
  • Workflow templates marketplace
  • Mobile app for iOS and Android
  • Real-time collaboration features
  • Integration with popular services (Slack, Discord, etc.)
  • AI-powered workflow optimization suggestions
  • Custom LLM model fine-tuning support

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments

Special thanks to all contributors and the open-source community for making this project possible.


Built with ❤️ by the community

About

A powerful platform that combines conversational AI with visual workflow automation, enabling seamless integration between LLM chat interfaces and customizable tool execution flows.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages