Plexus Procedures
Configuration-based agentic workflow programming with first-class human-in-the-loop support.
What are Procedures?
Plexus Procedures is a domain-specific language (DSL) that enables you to define sophisticated agentic workflows through configuration, combining:
- Declarative YAML for component definitions (agents, prompts, tools, stages)
- Embedded Lua for orchestration logic and control flow
- High-level primitives that abstract LLM mechanics (e.g.,
Worker.turn()) - First-class HITL (Human-in-the-Loop) support for collaboration
Key Features
Uniform Recursion
Procedures work identically at all nesting levels - same parameters, outputs, HITL, and async capabilities everywhere.
Human-in-the-Loop
First-class primitives for approval, input, review, notifications, and alerts built directly into workflow control flow.
Async Operations
Spawn procedures in parallel with simple primitives. Monitor progress and wait for results with built-in concurrency support.
Built-In Reliability
Automatic retries, validation, error handling, and recovery patterns under the hood.
Quick Example
Here's a simple procedure that researches a topic and requests human approval:
name: content_reviewer version: 1.0.0 params: topic: type: string required: true outputs: approved: type: boolean required: true agents: researcher: system_prompt: | Research and summarize: {params.topic} tools: [search, done] workflow: | -- AI does research repeat Researcher.turn() until Tool.called("done") -- Human approves local approved = Human.approve({ message = "Approve this research?", context = {findings = State.get("findings")} }) return {approved = approved}
Core Concepts
Procedures
Reusable units of agentic work that accept typed parameters, return typed outputs, and can invoke other procedures recursively.
Agents
Configured LLM instances with system prompts, tools, and behavior settings. Each agent becomes a Lua primitive (e.g., Worker.turn()).
Workflows
Lua orchestration code that controls execution flow, manages state, invokes agents, and handles human interaction.
State & Stages
Mutable storage for tracking progress across turns, and high-level workflow phases for monitoring and status reporting.
Message Classification
Every message in Plexus has a humanInteraction classification that determines visibility and behavior:
- INTERNAL - Agent reasoning hidden from humans
- CHAT / CHAT_ASSISTANT - Conversational AI messages
- NOTIFICATION - Workflow progress updates
- ALERT_* - System monitoring alerts
- PENDING_* - Requests requiring human response
This unified system enables different UIs to filter messages appropriately - operator dashboards see notifications and requests, monitoring sees alerts, debugging sees everything.
Documentation
Getting Started
Learn the basics and write your first procedure
Human-in-the-Loop
Master collaboration patterns with humans
Examples & Patterns
Real-world examples from simple to complex
API Reference
Complete reference for all Lua primitives
Message Classification
Understand message types and visibility
Technical Specification
Complete DSL specification and reference
Additional Resources
AGENTS.md: Comprehensive technical specification located at /plexus/procedures/AGENTS.md
HTML Documentation: Complete standalone HTML documentation available at /plexus/procedures/docs/
GitHub: github.com/AnthusAI/Plexus