README.md

July 10, 2026 ยท View on GitHub

logo

Visual Programming Platform for Algorithm & AI Workflow Development

๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡ | ๐Ÿ‡ฌ๐Ÿ‡ง English | ๐Ÿ“˜ Documentation | ๐ŸŽฅ Demo Video

Python License Stars Downloads Last Commit Issues

A modern low-code visual programming platform built on NodeGraphQt and qfluentwidgets, supporting drag-and-drop component orchestration, asynchronous execution, file operations, control flow logic, and one-click export of workflows into standalone, executable projectsโ€”enabling seamless transition from development to deployment.







๐ŸŒŸ Why Choose CanvasMind?

Traditional Low-Code ToolsCanvasMind
Static component assemblyDynamic expressions + global variables drive parameters
Only serial executionFull conditional branching, iteration, and loops
No custom logicEmbedded code editor for writing Python components freely
Execution = endpointOne-click export to standalone projects (API, CLI, Docker)
AI disconnected from canvasDeep LLM integration: yellow jump / purple create buttons for canvas-aware intelligent completion
Fixed Runtime EnvironmentSupports remote execution via SSH: Features integrated Python environment management for SSH servers and supports dispatching nodes to the server-side for execution.
No Trigger Node or Hard-coded Trigger OptionsExtensible Plugin Trigger System: Decoupled architecture allowing dynamic loading of Cron, Webhook, and File-watchers; UI auto-syncs with backend logic

๐ŸŒŸ Key Features

๐Ÿ“‹ Complex Form & Tree Control Widget ๐ŸŒณ

  • Dynamic Property Grid โ€“ Render adaptive UI controls (text fields, numeric inputs, file selectors, toggles, sliders) based on parameter data types and validation rules
  • Hierarchical Property Tree โ€“ Organize nested configurations into expandable/collapsible tree structures with drag-and-drop reordering for complex workflows
  • Context-Aware Validation โ€“ Apply real-time validation logic based on parameter dependencies (e.g., enabling/disabling fields based on toggle states)
  • Interactive Tree Navigation โ€“ Context menus and visual indicators for managing parent-child relationships in hierarchical data structures


๐ŸชŸ Multi-View Splitting ๐Ÿ›ฐ๏ธ

  • Recursive Viewport Splitting โ€“ Split the canvas horizontally or vertically to monitor distant parts of a large-scale graph simultaneously.
  • Synchronized Scene State โ€“ All viewports share the same live scene. Editing a node in one view reflects instantly across all others, enabling high-efficiency cross-node referencing.
  • Distant Node Tracking โ€“ Ideal for complex pipelines where you need to watch the "Source Node" parameters in one view while observing the "Terminal Output" behavior in another.


โšก Distributed & Hybrid Execution Engine

  • Parallel DAG Execution โ€“ Independent branches are executed concurrently via a high-performance task scheduler, maximizing CPU/GPU utilization across the workflow.
  • Hybrid Runtime Orchestration โ€“ Supports seamless mixing of execution environments:
    • Interactive IPython Kernel: Leveraging local persistent sessions for rapid debugging and state retention.
    • Remote SSH Workers: Transparently dispatching heavy-compute nodes (e.g., Model Training/Inference) to high-performance servers with automated environment syncing.
  • Selective In-Memory Persistence (Caching) โ€“ Users can toggle "Pin to Memory" for specific nodes; results are cached in the active process RAM to eliminate redundant re-computation and I/O overhead during iterative tuning.
  • Intelligent Topological Dispatch โ€“ Automatically resolves dependencies and routes tasks to the optimal target (Local/Remote/IPython) based on node configuration.
  • Unified State Management โ€“ Real-time visualization of node status (Queued / Running / Success / Failed) across all distributed workers on a single canvas.
  • High-Speed Data Serialization โ€“ Utilizes pyarrow and pickle for low-latency data transfer between local and remote environments.

๐Ÿง  Intelligent Node Recommendation โœจ

  • Type-Aware Suggestions โ€“ Automatically match compatible downstream components based on output port types
  • Multi-Port Grouping โ€“ Recommendations grouped by source port for clarity
  • Visual Differentiation โ€“ Color-coded suggestions per port type
  • Cross-Canvas Learning โ€“ Tracks component connection frequency to improve recommendations over time

๐Ÿค– LLM-Chatter: Intelligent Coding Assistant

A powerful built-in coding assistant with OpenCode-style agent architecture and comprehensive tool system.

๐Ÿง  Agent System

  • Multi-Agent Support: Primary agents for main tasks, Subagents for parallel subtasks, Hidden agents for background operations
  • Permission System: Fine-grained tool permission control per agent (allow/deny/ask)
  • Flexible Configuration: Define agents via Markdown (YAML frontmatter) or YAML files
  • Agent Profiles: Support for custom temperature, top_p, max_steps, model selection per agent

๐Ÿ› ๏ธ Comprehensive Tool Suite (30+ Tools)

CategoryTools
File Operationsread, write, edit, multiedit, patch, grep, glob, list, diff_files
Terminalbash, run_verify
Webwebfetch, websearch
Code Analysisget_diagnostics (Python/JS/TS/Shell)
Task Managementtodowrite, todoread, ask_question
Skillsskill, list_skills, scan_repo, stage_files
Memorymemory_list, memory_search, memory_save, memory_consolidate
Canvas Integrationlist_webhooks, trigger_webhook
Sub-Agentstask (distribute work to build/plan/skillful/explore agents)

๐Ÿ’พ Long-Term Memory System

  • Persistent Context: Save key facts across sessions with confidence scores
  • Conflict Management: Group memories to auto-suppress outdated information
  • Category-based Organization: Task preferences, project constraints, user habits
  • Auto-Consolidation: Extract important facts from conversations automatically

๐ŸŽจ Canvas-Aware Integration

  • Canvas Tools: Run nodes, get logs, create nodes, connect ports, set properties, edit property strings
  • Context Injection: Automatic canvas image + node structure + global variables
  • Yellow Jump Buttons: Click to navigate to referenced nodes on canvas
  • Purple Create Buttons: One-click instantiation of recommended components
  • Execution State: Query running tasks, failed nodes, logs in real-time

โœจ Advanced Features

  • Conversation Preview: Rich message cards with code syntax highlighting
  • Context Usage Ring: Visual token budget monitoring
  • History Management: Search past conversations, auto-summarize topics
  • File Undo Preview: Review changes before applying via diff viewer
  • Tool Floating Panel: Real-time tool call status display
  • Sub-Agent Manager: Coordinate parallel task execution

๐Ÿ” Advanced Control Flow โœจ

  • Conditional Branching โ€“ Enable/disable branches based on $...$ expressions (if/else logic)
  • Iteration โ€“ Loop over lists or arrays, executing subgraphs per element
  • Loop Control โ€“ Fixed-count or condition-driven loops
  • Dynamic Subgraph Skipping โ€“ Entire downstream subgraphs of inactive branches are skipped for efficiency
  • Expression-Driven Logic โ€“ Branch conditions, loop counts, etc., support dynamic expressions

๐ŸŒ Global Variables & Expression System โœจ

  • Structured Scopes โ€“ Three variable scopes: env (environment), custom (user-defined), and node_vars (node outputs)
  • Dynamic Expressions โ€“ Use $env_user_id$ or $custom_threshold * 2$ in any parameter field
  • Runtime Evaluation โ€“ Expressions resolved before execution, with support for nested dicts/lists
  • Secure Sandbox โ€“ Powered by asteval; prevents unsafe operations and isolates environments via contextmanager
  • UI Integration โ€“ Select variables or type expressions directly in component property panels

โœ… Dynamic Code Components

  • Full Python Logic โ€“ Write complete run() methods and helper functions inside nodes
  • Dynamic Ports โ€“ Add/remove input/output ports via UI; bind global variables as defaults
  • Full Feature Integration โ€“ Leverages global variables, expressions, auto-dependency install, logging, and status visualization
  • Safe Execution โ€“ Runs in isolated subprocesses with timeout control, error capture, and retry support
  • Developer-Friendly Editor โ€“ Professional code editor with dark theme, syntax highlighting, intelligent autocomplete, folding, and error diagnostics

โšก Plugin-based Trigger System

  • Dynamic Plugin Loading โ€“ Decoupled architecture that automatically discovers and registers new trigger types (Cron, Webhook, File Watcher) from the plugin directory without restarting.
  • Auto-Adaptive UI โ€“ Node property panels dynamically reconstruct their input widgets based on the selected plugin, ensuring a clean, context-aware interface.
  • Event-Driven Execution โ€“ Transition from manual execution to automated workflows by reacting to external HTTP requests, schedule patterns, or file system changes.
  • Lifecycle Management โ€“ Built-in safety logic that automatically unregisters backend listeners when a canvas is closed or a node is deleted to prevent resource leaks.

๐Ÿ“Š Node Management

  • Dynamic Loading โ€“ Auto-scans components/ directory and loads new components
  • Pydantic Schemas โ€“ Define inputs, outputs, and properties using Pydantic models
  • Per-Node Logging โ€“ Each node maintains its own execution log
  • State Persistence โ€“ Save/load entire workflows
  • Auto Dependency Resolution โ€“ Components declare requirements; missing packages are auto-installed at runtime

๐Ÿ“ฆ Model Export & Standalone Deployment โœจ

  • Subgraph Export โ€“ Select any group of nodes and export as a self-contained project
  • Train/Inference Separation โ€“ Export only inference logic with trained models bundled
  • Zero-Dependency Runtime โ€“ Generated project runs independentlyโ€”no CanvasMind required
  • Multi-Environment Support โ€“ Auto-generated requirements.txt enables deployment to servers, Docker, or CLI environments

๐Ÿ› ๏ธ Exported Project Tool Integration

  • Direct Invocation โ€“ Canvas can call exported project scripts by name and retrieve results
  • Parameter Passing โ€“ Node properties define tool-call parameters, passed automatically at runtime
  • Full Logging โ€“ Detailed logs of tool execution are captured and returned for debugging
  • LLM Function Calling Ready โ€“ Standardized tool name, input/output schema, and examples for seamless LLM integration

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.8+
  • PyQt5 or PySide6

Installation

# Clone the repository
git clone https://github.com/martin98-afk/CanvasMind.git
cd CanvasMind

# Create virtual environment (recommended)
python -m venv .venv

# Activate virtual environment
# Linux/Mac:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Run

python main.py

Build (Optional)

python build.py

๐Ÿงช Component Development

Supported Port Types

TypeDescriptionExample
TEXTText inputString parameters
LONGTEXTLong text inputMulti-line strings
INTIntegerNumeric values
FLOATFloating pointDecimal numbers
BOOLBooleanToggle switches
CSVCSV list dataColumn selections
JSONJSON structureDynamic nested data
EXCELExcel dataCell ranges
FILEFile pathLocal file reference
UPLOADDocument uploadUser-uploaded files
SKLEARNMODELScikit-learn modelTrained .pkl models
TORCHMODELPyTorch model.pt or .pth models
IMAGEImage dataBase64 or file paths

Supported Property Types

TypeDescriptionExample
TEXTText inputShort strings
LONGTEXTLong text inputCode snippets, prompts
INT / FLOATNumeric inputThresholds, counts
BOOLToggleEnable/disable flags
CHOICEDropdownPredefined options
DYNAMICFORMDynamic formVariable-length lists
RANGENumeric rangeMin/max sliders
VARIABLEvariable selectorglobal_variable
FILE SELECTSelect filecanvas_files/model.pth

๐ŸŽฎ Canvas Usage Guide

Basic Operations

  1. Create Node โ€“ Drag from left panel to canvas
  2. Connect Nodes โ€“ Drag from output port to input port
  3. Run Node โ€“ Right-click โ†’ "Run This Node"
  4. View Logs โ€“ Right-click โ†’ "View Node Logs"

Advanced Features

  • Loops โ€“ Use Loop/Iterate nodes with Backdrop for structured iteration
  • File Handling โ€“ Click file picker in property panel
  • Workflow Management โ€“ Save/load via top-left buttons
  • Node Grouping โ€“ Select multiple nodes โ†’ right-click โ†’ "Create Backdrop"
  • Dependency Management โ€“ Failed components auto-install missing requirements

Keyboard Shortcuts

  • Ctrl+R โ€“ Run workflow
  • Ctrl+S โ€“ Save workflow
  • Ctrl+O โ€“ Load workflow
  • Ctrl+A โ€“ Select all nodes
  • Del โ€“ Delete selected nodes

๐Ÿ› ๏ธ Development Notes

Node Status Colors

  • Idle โ€“ Gray border
  • Running โ€“ Blue border
  • Success โ€“ Green border
  • Failed โ€“ Red border

Connection Line Colors

  • Idle โ€“ Yellow
  • Input Active โ€“ Blue
  • Output Active โ€“ Green

Logging System

  • Each node has independent logs with timestamps
  • Powered by Loguru โ€“ use self.logger in components
  • All print() output is automatically captured

Dataflow

  • Inputs auto-populated from upstream outputs
  • Outputs stored by port name
  • Full multi-input/multi-output support

๐Ÿ“ฅ Model Export (Standalone Deployment)

Core Value

Export any subgraph as a self-contained project that runs in any Python environmentโ€”no CanvasMind required.

Use Cases

  • Train/Inference Split โ€“ Export only inference logic with models bundled
  • Team Sharing โ€“ Share full workflows as runnable projects
  • Production Deployment โ€“ Run on servers or in Docker
  • Offline Execution โ€“ CLI-only environments

Export Features

โœ… Smart Dependency Analysis โ€“ Copies only necessary component code
โœ… Path Rewriting โ€“ Model/data files copied and converted to relative paths
โœ… Column Selection Preserved โ€“ CSV column config fully retained
โœ… Environment Isolation โ€“ Auto-generated requirements.txt
โœ… Ready-to-Run โ€“ Includes run.py and api_server.py

Export Steps

  1. Select Nodes โ€“ Choose any nodes on canvas (multi-select supported)
  2. Click Export โ€“ Top-left "Export Model" button (๐Ÿ“ค icon)
  3. Choose Directory โ€“ Project folder auto-generated
  4. Run Externally:
# Install dependencies
pip install -r requirements.txt

# Run model
python run.py

Exported Project Structure

model_xxxxxxxx/
โ”œโ”€โ”€ model.workflow.json    # Full workflow definition (nodes, connections, column selections)
โ”œโ”€โ”€ project_spec.json      # Input/output schema
โ”œโ”€โ”€ preview.png            # Canvas preview snapshot
โ”œโ”€โ”€ README.md              # Project overview
โ”œโ”€โ”€ requirements.txt       # Auto-analyzed dependencies
โ”œโ”€โ”€ run.py                 # CLI entrypoint
โ”œโ”€โ”€ api_server.py          # FastAPI microservice
โ”œโ”€โ”€ scan_components.py     # Component loader
โ”œโ”€โ”€ runner/
โ”‚   โ”œโ”€โ”€ component_executor.py
โ”‚   โ””โ”€โ”€ workflow_runner.py
โ”œโ”€โ”€ components/            # Original component code (preserved structure)
โ”‚   โ”œโ”€โ”€ base.py
โ”‚   โ””โ”€โ”€ your_components/
โ””โ”€โ”€ inputs/                # Bundled models/data files

๐Ÿ—บ๏ธ Roadmap

StatusFeature
๐Ÿšง In ProgressCode-to-canvas auto-creation (from editor โ†’ new node)
๐Ÿ“‹ PlannedEnhanced visualization for large-scale workflows
๐Ÿ“‹ PlannedCloud execution support

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

# 1. Fork and clone the repository
git clone https://github.com/martin98-afk/CanvasMind.git
cd CanvasMind

# 2. Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
.venv\Scripts\activate     # Windows

# 3. Install dependencies
pip install -r requirements.txt

# 4. Run in development mode
python main.py

# 5. Run tests (if available)
pytest

Pull Request Process

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

๐Ÿ“– Documentation

For full documentation, visit: CanvasMind Docs


๐Ÿ’ฌ Get Help


๐Ÿ“„ License

This project is licensed under the GPLv3 License.


๐Ÿ™ Acknowledgements


Star History

Star History Chart