Positioning: Deterministic AI Workflow Engine · Interactive Playground
Welcome to PatchCat! PatchCat is both a production-grade deterministic AI workflow orchestration engine and a white-box interactive playground designed for AI engineers, architects, and learners. In this guide, you will learn how to orchestrate workflows in under 5 minutes—whether you have an API key or want to test DAG mechanics completely offline.
By the end of this quickstart tutorial, you will know how to:
- Launch PatchCat in your local browser environment.
- Explore DAG topology and slot resolution offline without an API key.
- Connect an LLM provider (Google Gemini, DeepSeek, OpenAI, or local Ollama) using your own API Key (BYOK).
- Execute a pre-built industrial workflow (Customer Support Intent Classification & VIP Logistics Routing).
- Inspect real-time token streams, DeepSeek reasoning chains, and 3-tier security execution logs.
- Build, customize, and experiment with your own visual DAG workflows.
Before you start, make sure you have:
- Node.js
>= 18.0.0 - npm
>= 9.0.0or pnpm - A modern browser (Chrome, Edge, Firefox, Safari)
- (Optional, for live LLM execution) An API Key from any supported provider (not needed for offline playground testing):
- 🔵 Google Gemini (Free tier available at Google AI Studio) — Recommended
- 🐳 DeepSeek (DeepSeek Platform)
- 🟢 OpenAI (OpenAI Platform)
- ⚡ SiliconFlow (SiliconFlow Cloud)
- 🦙 Ollama (Locally installed and running at
http://localhost:11434)
git clone https://github.com/GuoBug/PatchCat.git
cd PatchCatnpm installnpm run devOpen your browser and navigate to http://localhost:5173. You will see the PatchCat Visual Workflow Canvas.
PatchCat operates with a 100% Client-Only Privacy Architecture: your API Keys are stored exclusively in your browser's LocalStorage and connect directly to model providers. They are never transmitted to any intermediary backend.
- In the top navigation bar, click the
API Keybutton (or the key icon). - Select your preferred provider from the left sidebar (e.g., Google Gemini).
- Paste your API Key into the input field.
- Click
测试连通性 (Test Connection):- PatchCat automatically tests the endpoint and fetches all available chat models (e.g.,
gemini-2.5-flash,gemini-2.5-pro,gemini-2.0-flash).
- PatchCat automatically tests the endpoint and fetches all available chat models (e.g.,
- Click
← Back to Canvasin the top-left corner. Your provider is now active and marked with a green indicator in the header!
Tip
Recommended Model: For Google Gemini, we recommend gemini-2.5-flash for instant response speeds and high availability on the free tier.
Upon initial launch, PatchCat pre-loads the Customer Support Routing workflow template.
This workflow consists of 5 canonical nodes:
- Click the blue
▶ Run Workflowbutton in the top right corner. - Watch the execution in real time:
- Nodes transition from
idle➔running(with live spinner) ➔success(with latency badge). - The LLM node streams generated tokens live on the canvas.
- The JavaScript Code node extracts the intent (
物流催单), evaluates urgency (4分), and routes the ticket to the🚀 物流专线极速客服队列 (Logistics VIP).
- Nodes transition from
- Click on any node to open the Right Property Inspector Panel and inspect its input parameters, prompt template, or formatted JSON output.
PatchCat includes an enterprise-grade execution logging engine integrated directly into the Settings Center.
- Click the
Settingsbutton in the top navigation bar, then switch to theExecution Logs (运行日志)tab. - Switch between the 3 Configurable Log Levels:
概要 (Summary): Macro workflow lifecycle, HTTP status codes, latency, and system alerts.详细 (Detailed): Node IDs, runtime parameters (model,temperature,max_tokens), and DAG layer wave scheduling.开发 (Development): Full Prompt inputs, variable resolution payloads, and LLM generated responses.
- Strict Zero-Leakage Guarantee: Notice that even in
Developmentmode, all API keys (sk-***,AIzaSy***), Bearer tokens, and passwords are automatically masked with***[MASKED]***. - Tools in the Console:
- Filter by Type:
All,System,Request,Node,Error,Security. - Search: Filter logs in real time by keywords or Node IDs.
- Expand Payload: Click
详情 Payloadto inspect formatted JSON trees and copy with one click. - Export: Click
导出to download logs as.jsonor.txtreports.
- Filter by Type:
Ready to create your own pipeline? Follow these simple steps:
Click the + Add Node dropdown in the top header and add any of the standard nodes:
Input: Define custom input variables and types (string,number,boolean,json).Prompt: Write prompt templates with dynamic variable slots using{{nodeId.property}}.LLM: Select models (Gemini, DeepSeek, OpenAI), configure temperature, and set system prompts.Code: Write custom JavaScript transformation scripts withinputsandconsole.logcapture.Output: Format and present final workflow outputs.
Click and drag from a source node's right handle (output port) to a target node's left handle (input port).
PatchCat supports powerful Mustache-style variable interpolation:
PatchCat's engine utilizes Kahn's Topological Algorithm:
-
Automatic Parallel Waves: Nodes on the same dependency layer execute concurrently via
Promise.all. -
Cycle Detection: If you accidentally connect a cyclic loop (
$A \to B \to A$ ), PatchCat detects the cycle in milliseconds, highlights the affected nodes in red, and presents an alert banner to prevent infinite loops.
Beyond serving as a production-grade workflow runtime, PatchCat is designed as an interactive AI playground for developers, researchers, and learners to inspect and experiment with deterministic orchestration primitives without friction:
Without entering any API keys, click Run Workflow and choose Validate Flow Only (Skip LLM):
- Safely bypasses remote LLM network calls while verifying Kahn topological ordering, concurrency waves, and port bindings;
- Validates Mustache slot parsing (e.g.
{{nodeId.property}}) and fallback defaults; - Traces real-time node state transitions and downstream data flow.
- Try drawing a reverse edge from node B back to node A on the canvas to create a loop;
- Click Run and witness the scheduler intercept the cycle in milliseconds, highlight the offending nodes in red, and block deadlocks before execution starts.
Run the built-in contract assertion suite locally to explore state machines and structured schema guarantees:
# Run all deterministic contract tests
npm test
# Run real LLM structured output benchmark
npm run test:abCause: Google's free tier on preview or experimental models (e.g., gemini-3.7-flash) occasionally experiences global traffic spikes.
Solution: Click the LLM node, open the Property Panel, and switch the model dropdown to gemini-2.5-flash or gemini-2.0-flash, which offer stable high throughput. PatchCat also includes a built-in 1.5s automatic retry mechanism.
If a preset workflow was created with gpt-4o-mini, but your active provider is Google Gemini, PatchCat's resolveTargetModel engine automatically remaps the request to gemini-2.5-flash, eliminating cross-vendor 400/404 errors.
PatchCat features 100% automated test coverage across DAG sorting, variable resolving, LLM client streaming, and logger sanitization:
npm test- 📖 Explore the System Architecture Documentation
- 📐 Review the Graph Schema Specification
- 💡 Check out the Development Notes & ADRs
- ⭐️ Star and contribute to PatchCat on GitHub

