LoopCraft
Sign In

Docs

Loop DSL Documentation

Learn how to use the LoopCraft DSL to define AI agent loops.

.loop.json Specification v1.0

Loop Definition Schema

A JSON document describing the complete structure of an AI agent loop.

Node Types

llm - Agent — runs prompt with tools

tool - Tool - External tool execution

condition - Condition - Branching

human-review - Human Review - Pause for approval

sub-loop - Sub Loop - Nested loop

Loop Engineering Concepts

Loop Engineering designs the control flow AI agents use to plan, act, observe, and iterate. Six core dimensions:

StagesDiscrete steps the agent executes.

TransitionsRules for moving between stages: sequential, conditional, or parallel.

ToolsExternal capabilities: web search, code execution, media, memory, custom functions.

MemoryHow the agent retains context: full history, sliding window, summarized, stateless.

GuardrailsSafety constraints: PII detection, content filtering, output validation.

TerminationEnd conditions: max iterations, quality threshold, human approval, stop signal.

Loop Definition Format (.loop.md)

Human-readable Markdown with YAML frontmatter. Export from the Builder or hand-write. Import via drag-and-drop. Use the CLI to scaffold from a template.

AI Generation & Dry Run

Describe your loop in natural language and AI generates the definition. Validate checks for structural errors. Dry Run simulates execution and reports path coverage.

CLI Toolkit

npx loopcraft initInteractive template selection, generates .loop.md

npx loopcraft validate file.loop.mdValidate structure and detect dead-loops

npx loopcraft export file.loop.md --target langgraphExport to LangGraph, OpenAI SDK, AutoGen, or CrewAI