@seanchatmangpt/pictl
v26.4.9
Published
Process Mining in WebAssembly - High-Speed Algorithms for Browser and Node.js
Maintainers
Readme
pictl — Process Intelligence Control
21 process mining algorithms compiled to WebAssembly. Discover process models from event logs in browsers and Node.js — no Python, no services, just npm install.
Quick Start
CLI (60 seconds)
npm install -g @pictl/cli
pictl run process-log.xesNode.js (30 seconds)
const pictl = require('@pictl/engine');
await pictl.init();
const log = pictl.load_eventlog_from_xes(xesContent);
const dfg = JSON.parse(pictl.discover_dfg(log, 'concept:name'));
console.log(`${dfg.nodes.length} activities, ${dfg.edges.length} flows`);Browser (30 seconds)
<script type="module">
import pictl from '@pictl/engine';
await pictl.init();
const log = pictl.load_eventlog_from_xes(xesContent);
const dfg = JSON.parse(pictl.discover_dfg(log, 'concept:name'));
</script>Streaming (IoT / infinite event streams)
const pictl = require('@pictl/engine');
await pictl.init();
// Open session — no full log held in memory
const handle = pictl.streaming_dfg_begin();
// Feed events as they arrive
pictl.streaming_dfg_add_event(handle, 'case-1', 'Register');
pictl.streaming_dfg_add_event(handle, 'case-1', 'Approve');
pictl.streaming_dfg_close_trace(handle, 'case-1');
// Live snapshot (non-destructive)
const dfg = JSON.parse(pictl.streaming_dfg_snapshot(handle));
// Finalize: flush open traces, return DFG
const result = JSON.parse(pictl.streaming_dfg_finalize(handle));
console.log(`${result.nodes} nodes, ${result.edges} edges`);What It Does
pictl discovers process models from event logs. Give it a log of activities (who did what, when), and it finds the underlying process structure.
| Capability | What It Gives You | | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | 21 discovery algorithms | DFG, Alpha++, ILP, Genetic, PSO, A*, DECLARE, Heuristic Miner, Inductive Miner, Hill Climbing, ACO, Simulated Annealing, Process Skeleton, Optimized DFG | | 6 ML analysis algorithms | Classify, cluster, forecast, anomaly detection, regression, PCA | | Streaming API | Process infinite event streams with bounded memory | | Conformance checking | Token-based replay with fitness, precision, generalization | | 20+ analytics functions | Bottlenecks, variants, concept drift, dependencies, rework detection | | Predictions | Next activity, remaining time, outcome, drift detection |
Input: XES or JSON event logs. Output: Petri nets, DFGs, process trees, DECLARE models, JSON analytics.
CLI Reference
pictl run <log.xes> # Process discovery
pictl compare <algos> -i <log> # Side-by-side algorithm comparison
pictl diff <log1> <log2> # Compare two event logs
pictl predict <task> -i <log> # Predictive mining (next-activity, remaining-time, outcome)
pictl drift-watch -i <log> # Real-time EWMA drift monitoring
pictl ml <task> -i <log> # ML-powered analysis (classify, cluster, forecast, anomaly)
pictl watch # Config file watcher — re-run on change
pictl status # WASM engine health + system info
pictl doctor # 6-check environment diagnostic
pictl explain # Human/academic algorithm explanations
pictl init # Scaffold pictl.toml + .env.example
pictl results # Browse saved results in .pictl/results/
pictl powl <subcommand> # POWL model analysisOutput formats: --format human (colored terminal) or --format json (structured output)
Performance Benchmarks
Version: v26.4.7 | Hardware: Apple M3 Max (16P/4E, 36GB unified memory) | Methodology: Median of 7 runs
At a Glance (10K cases)
| Tier | Algorithms | Time | Use Case | | --------------- | -------------------------------------- | ---------- | ------------------------------------------ | | ⚡ Ultra-fast | DFG, Process Skeleton | 2.7–3.0 ms | Real-time dashboards, high-throughput APIs | | ⚡ Fast | Heuristic Miner, Inductive Miner | 14–25 ms | Interactive discovery, UI-driven analysis | | 🚀 Evolutionary | Genetic, ACO, PSO, Simulated Annealing | 21–25 ms | Quality optimization via population search | | 🔍 Optimal | ILP, A* Search | 77–87 ms | Best possible model, provable quality | | 📊 Streaming | Streaming DFG, Noise-Filtered DFG | 69–135 ms | Infinite streams, IoT, memory-constrained |
Key metrics:
- All 21 algorithms tested on real data (BPI 2020: 10,500 traces, 141K events)
- Linear scaling from 100 to 50,000+ cases
- Streaming: 1.4–23x overhead for bounded memory on infinite event streams
- Browser benchmarks: ~40–60% slower than Node.js (expected WASM sandbox overhead)
📖 Full benchmark report: docs/BENCHMARKS.md 📖 Benchmark documentation: docs/benchmarks/ — tutorials, methodology, reference
Documentation
Getting Started
- Quick Start — 5-minute setup
- Build Guide — Build from source
- Development — Development workflow
Performance & Benchmarks
- Benchmark Results — Full performance tables, all algorithms, all sizes
- Benchmark Docs — Tutorials, how-to guides, methodology, reference
API & Algorithms
- API Reference — Complete function reference
- Algorithm Reference — All 21 algorithms explained
- Configuration — Config files, ENV vars, profiles
Integration
- MCP Integration — Claude AI / MCP server
- Architecture — System design
- Contributing — How to contribute
Architecture
pictl/
├── wasm4pm/ # Rust core — 21 algorithms compiled to WASM
│ └── src/ # Discovery, conformance, analytics, streaming
├── packages/ # TypeScript monorepo (9 packages)
│ ├── @pictl/kernel # WASM facade — run(algorithm, handle, params)
│ ├── @pictl/engine # Lifecycle state machine
│ ├── @pictl/config # Zod-validated config, 5-layer precedence
│ ├── @pictl/planner # Execution plan generation
│ ├── @pictl/observability# CLI output, JSONL, OTEL spans
│ ├── @pictl/contracts # Receipts, errors, plans, hashing
│ ├── @pictl/testing # Parity/determinism/CLI test harnesses
│ ├── @pictl/ml # Micro-ML: classify, cluster, forecast, anomaly
│ └── @pictl/swarm # Multi-worker coordinator
├── apps/pmctl/ # CLI tool — pictl command
├── benchmarks/ # Node.js + browser benchmark suite
└── docs/ # Documentation (Diátaxis)Installation
# CLI
npm install -g @pictl/cli
# Library
npm install @pictl/engine
# From source
git clone https://github.com/seanchatmangpt/pictl.git
cd pictl/wasm4pm
npm install && npm run buildStatus
Production Ready — v26.4.7
- All 21 algorithms tested and operational
- All algorithms benchmarked with real Criterion results
- Validated on BPI 2020 (10,500 traces, 141K events)
- Linear scaling from 100 to 50,000+ cases
- Ready for npm publish
License
MIT OR Apache-2.0
