Aisop – Define AI agent workflows as Mermaid or JSON flow graphs AISOP launched an open protocol that defines AI agent workflows using Mermaid or JSON flow graphs, enabling multi-step programs with branching, parallel execution, and error handling in a single portable JSON format. The protocol supports 14 control flow patterns and three-layer separation of metadata, flow graph, and function definitions, making AI programs token-efficient and readable by any language. This standard aims to replace proprietary visual builders and non-portable code-based workflows with a machine-readable, version-controllable format optimized for LLM comprehension. An open protocol for defining structured AI programs using Mermaid or JSON flow graphs. AISOP enables defining multi-step AI programs with visual Mermaid or structural JSON control flow — branching, parallel execution, sub-tasks, and error handling — all in a single portable JSON format. | Approach | Definition | Portable | Machine-readable | Token-efficient | |---|---|---|---|---| | Natural language prompts | Free text | Yes | No | No | | Python / YAML workflows | Code / config | No | Partially | No | | Visual builders Dify, etc. | Proprietary | No | No | No | AISOP | Mermaid + JSON | Yes | Yes | Yes | AISOP files are plain JSON with flow graphs Mermaid or JSON — readable by any language, editable in any editor, versionable in git, and optimized for LLM comprehension. { "role": "system", "content": { "protocol": "AISOP V1.0.0", ... } }, { "role": "user", "content": { "instruction": "...", "aisop": { ... }, "functions": { ... } } } | Element | Purpose | |---|---| system | Program metadata identity, version, description | user | Instruction, flow graph, and function definitions | { "role": "system", "content": { "protocol": "AISOP V1.0.0", "axiom 0": "Human Sovereignty and Wellbeing", "id": "greeting assistant", "name": "Greeting Assistant", "version": "1.0.0", "summary": "Classify user intent and respond", "flow format": "mermaid" } }, { "role": "user", "content": { "instruction": "RUN aisop.main", "user input": "{user input}", "aisop": { "main": "graph TD\n greet Greet -- classify{Classify}\n classify -- |question| search Search \n classify -- |chat| reply Reply \n search -- end node End \n reply -- end node" }, "functions": { "greet": { "step1": "Say hello to the user" }, "classify": { "step1": "Classify user intent as 'question' or 'chat'" }, "search": { "step1": "Search for relevant info" }, "reply": { "step1": "Generate a friendly reply" }, "end node": { "step1": "Output final response" } } } } The flow graph Mermaid format : php graph TD greet Greet -- classify{Classify} classify -- |question| search Search classify -- |chat| reply Reply search -- end node End reply -- end node Dual Flow Format — Mermaid string AI-native or JSON flow object code-native , mixable in the same program 14+ Control Flow Patterns — sequential, decision, parallel fork/join, delegate, loop, convergence, error routing, batch iterate, retry, data isolation, step-level sub-task, agent dispatch, HITL confirmation, runtime assertion Three-Layer Separation — metadata, flow graph, function definitions Topology / Behavior Split — flow graph defines connections, functions define runtime behavior Sub-task Support — main + named sub-tasks via delegate nodes or step-level RUN aisop.