Precision prompts. Seamless workflows.
The open-source, visual prompt orchestration and multi-agent workflow engine built for next-generation AI applications.
PatchCat is a modern, lightweight, yet enterprise-grade visual prompt orchestration platform and DAG execution engine. Designed for AI engineers, prompt designers, and developers building agentic workflows, PatchCat makes it effortless to chain prompts, LLMs, code transformations, and conditional routers into robust, parallelized pipelines.
With zero mandatory backend setup (Client-Only BYOK Mode) and direct connectivity to Google Gemini, DeepSeek, OpenAI, SiliconFlow, and local Ollama, PatchCat delivers high-performance prompt engineering right inside your browser with enterprise-grade telemetry and zero data leakage.
┌────────────────┐ ┌────────────────────────┐ ┌───────────────────────┐
│ User Input │ ────> │ Prompt Template Slot │ ────> │ LLM Classifier Node │
│ (Ticket / Raw) │ │ ({{input.query}}) │ │ (Gemini / DeepSeek) │
└────────────────┘ └────────────────────────┘ └───────────────────────┘
│
▼
┌────────────────────────┐ ┌────────────────────────┐ ┌───────────────────────┐
│ Final Dispatch Queue │ <──── │ Output Adapter Node │ <──── │ Code Router Sandbox │
│ (VIP Logistics / SLA) │ │ (Rendered JSON / Text) │ │ (JavaScript Decision) │
└────────────────────────┘ └────────────────────────┘ └───────────────────────┘
Why choose PatchCat over heavyweight orchestration tools?
| Feature / Metric | PatchCat 🐱 (Ours) | Flowise | Dify | Langflow |
|---|---|---|---|---|
| Architecture | 100% Client-Side / Edge | Node.js + Backend DB | Python + Celery + Redis + Postgres | Python + Backend DB |
| Deployment Weight | Zero Setup (Static Web / 0MB) | Heavy (Docker Compose) | Enterprise Heavy (~2GB+ Docker) | Heavy (Pip / Docker) |
| Data Privacy | Zero Data Leakage (BYOK In-Browser) | Server-stored Keys | Server-stored Keys | Server-stored Keys |
| Local LLM Support | Direct Ollama Web API | Proxy Bridge Required | Docker Network Configuration | Backend Proxy |
| Execution Engine | Kahn Topological DAG Scheduler | Sequential Graph | Async Event Worker | Directed Graph |
| Cold Start Latency | < 300 ms | 10 ~ 30 s | 30 ~ 60 s | 15 ~ 30 s |
| Memory Footprint | < 35 MB (Browser Tab) | ~300 MB | ~1.5 GB | ~500 MB |
| Code Node Sandbox | Native JS / Isolated Worker | VM2 Sandbox | Python Sandbox | Restricted Python |
- Drag-and-Drop Workflow Builder: Built on
@xyflow/react(React Flow v12) with custom node components (Input,Prompt,LLM,Code,Output). - Kahn's Topological Algorithm: Automatically partitions nodes into optimal parallel execution layers.
- Cycle Detection & Safety Warnings: Real-time cycle detection with visual warning badges and pre-flight validation.
- In-flight Abort Support: Cooperatively cancel running workflows at any moment via
AbortController.
- Direct Cloud & Local LLM Connectivity:
- 🔵 Google Gemini: Full support for
gemini-2.5-flash,gemini-2.5-pro,gemini-2.0-flash, with dynamic model discovery. - 🐳 DeepSeek: Seamless integration with DeepSeek-R1 (with live reasoning/thought streaming) and DeepSeek-V3.
- 🟢 OpenAI: Native support for GPT-4o, GPT-4o-mini, and custom models.
- ⚡ SiliconFlow: High-speed hosted open-source models.
- 🦙 Ollama & Local Models: Direct connection to local LLM instances (Llama 3, Qwen 2.5, Mistral).
- 🛠️ Custom OpenAI-Compatible Endpoints: Connect to any proxy, OneAPI, or self-hosted vLLM instance.
- 🔵 Google Gemini: Full support for
- Cross-Vendor Model Auto-Remapping: Intelligently adapts preset templates to your currently selected provider without broken requests.
- Transient 503 Auto-Retry & Diagnostics: Built-in exponential backoff for high-concurrency spikes and actionable Chinese/English error diagnostics.
- Live Token Streaming: Token-by-token real-time canvas rendering with fluid animations.
- Dual-Stream Reasoning Inspection: Dedicated visualization panel for DeepSeek R1 and Gemini thinking chains.
- Precise Token & Latency Telemetry: Accurate per-node execution duration and token usage calculation.
- In-Browser Safe Execution: Execute custom JavaScript scripts directly in browser sandbox with
inputsandconsole.logcapture. - Automatic JSON Markdown Stripping: Effortlessly parse structured outputs from LLMs wrapped in
```jsonblocks. - Smart Decision Routing: Conditionally dispatch workflows based on intent, urgency, and confidence scores.
- Configurable 3-Level Logging:
Summary (概要): System lifecycle (START,COMPLETE,ERROR), HTTP status codes, latency, and failure traces.Detailed (详细): Node IDs, runtime parameters (model,temperature,max_tokens), and DAG layer wave timing.Dev (开发): Full prompt inputs, intermediate outputs, and LLM responses.
- Zero-Exposure Security Sanitization (
sanitizeData):- Automatic recursive masking of all API Keys (
sk-***,AIzaSy***), Bearer tokens, and password fields across all log levels.
- Automatic recursive masking of all API Keys (
- Collapsible Visual Console Drawer: Built-in IDE-style terminal drawer with search, type filters, JSON payload inspector, and one-click JSON/TXT export.
- Mustache-Style Syntax: Interpolate data with
{{nodeId.propertyPath}}. - Deep Object & Array Navigation: Access nested fields such as
{{classifier.result.tags[0].name}}. - Fallback Defaults: Built-in fallback syntax
{{nodeId.output | "default_value"}}to safeguard against missing values.
# Clone the repository
git clone https://github.com/GuoBug/PatchCat.git
cd PatchCat
# Install dependencies
npm installnpm run devOpen your browser and navigate to http://localhost:5173.
- Click the API Key button in the top navigation bar.
- Select your preferred provider (Google Gemini, DeepSeek, OpenAI, SiliconFlow, or Ollama).
- Enter your API Key and click 测试连通性 (Test Connection) to fetch available models.
- Click ▶ Run Workflow to execute the pipeline!
PatchCat maintains rigorous code quality with 100% test coverage across core scheduling, variable resolution, and logging engines:
# Run all unit tests (Topological Sort, Engine, LLM Client, Logger, Routing)
npm test
# Run TypeScript type check
npm run typecheck
# Build for production
npm run build
# Preview production build locally
npm run previewPatchCat comes with ready-to-use industrial presets:
| Preset Name | Description | Nodes Involved |
|---|---|---|
| Customer Support Routing | Multi-class intent classification, urgency grading, and automated VIP queue dispatch. | Input ➔ Prompt ➔ LLM Classifier ➔ Code Router ➔ Output Dispatch |
| Self-Reflective Report Generator | Drafter generation combined with an expert Critic review loop for polished outputs. | Input Topic ➔ Drafter Prompt ➔ LLM Generator ➔ Critic Prompt ➔ LLM Critic ➔ Final Report |
| Multi-Agent Arbitration Pipeline | Parallel execution of policy check and sentiment analysis for dispute resolution. | Input Order ➔ Prompt Builder ➔ LLM Policy + LLM Sentiment (Parallel) ➔ Code Arbitrator ➔ Report |
| Layer | Technology |
|---|---|
| Frontend Framework | React 19 + TypeScript 5.8 |
| Build & Tooling | Vite 6 |
| Canvas & Nodes | @xyflow/react (React Flow v12) |
| State Management | Zustand + Immer |
| Styling & UI | Tailwind CSS v4 + Lucide Icons |
| Execution Engine | Native In-Browser Kahn's DAG Scheduler + SSE Stream Client |
| Testing | Node.js Native Test Runner (node --test) |
- Visual DAG Canvas with Kahn's Algorithm & Parallel Wave Execution
- Multi-Provider Hub (Google Gemini, DeepSeek, OpenAI, SiliconFlow, Ollama)
- DeepSeek R1 Thought/Reasoning Stream Visualization
- Dynamic JavaScript Code Node & Real-Time Transformation Sandbox
- 3-Tier Enterprise Logging Console & Secret Sanitization
- Template Import & Export (JSON Schema Draft-07)
- RAG & Vector Knowledge Base Node Integration
- Multi-Agent Autonomous Conversation Loops
- One-Click Workflow Export as Standalone REST API Endpoint
- Local Python Server Backend (FastAPI + vLLM Sandbox)
We welcome contributions from the global open-source community!
- 🐛 Found a bug? Submit an Issue
- 💡 Have a feature idea? Start a Discussion
- 🚀 Want to contribute code? Fork the repo and open a Pull Request.
Distributed under the MIT License. Free for commercial and personal use.