> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dagraph.app/llms.txt
> Use this file to discover all available pages before exploring further.

# dagraph: run parallel AI agent workflows from YAML

> dagraph is a workflow-as-code CLI that runs YAML-defined DAGs of LLM calls in parallel across 7 providers, with HITL gates and deterministic replay.

dagraph lets you define AI workflows as plain YAML files, check them into git, and run them from the command line. Instead of wiring agents together in code or clicking through a UI, you describe a directed acyclic graph (DAG) of nodes — each node is an LLM call, a code execution step, or a human approval gate — and dagraph handles the scheduling, parallel execution, checkpointing, and artifact storage for you.

## How it works

A dagraph workflow is a YAML file with a `nodes` list. Each node declares what it does (`type`), which model to use (`model`), what prompt to send (`prompt`), and which other nodes it depends on (`depends_on`). dagraph reads the dependency graph, groups independent nodes into parallel waves, and fires each wave concurrently. When a wave completes, the next wave starts automatically — no orchestration code required.

Here is a stripped-down version of the built-in research example:

```yaml theme={null}
name: research
budget:
  max_tokens: 50000
  max_usd: 2.00

nodes:
  - id: research_a
    type: agent
    model: claude-haiku-4-5-20251001
    prompt: |
      Research "{{ topic }}" from a TECHNICAL perspective.
      Return 5–8 bullet points.

  - id: research_b
    type: agent
    model: claude-haiku-4-5-20251001
    prompt: |
      Research "{{ topic }}" from an ECONOMIC perspective.
      Return 5–8 bullet points.

  - id: synthesizer
    type: agent
    model: claude-sonnet-4-6
    depends_on: [research_a, research_b]
    prompt: |
      Synthesize these two research angles on "{{ topic }}":
      == Technical == {{ research_a }}
      == Economic == {{ research_b }}
```

`research_a` and `research_b` have no dependencies, so dagraph fires them in the same wave. `synthesizer` depends on both, so it waits until both complete — then receives their outputs as template variables.

## Key capabilities

<CardGroup cols={2}>
  <Card title="Parallel execution" icon="bolt">
    Nodes with no mutual dependencies run simultaneously. dagraph computes the wave schedule automatically from your `depends_on` declarations.
  </Card>

  <Card title="7 LLM backends" icon="shuffle">
    Claude Code (default), Anthropic API, OpenAI, Gemini, AWS Bedrock, Ollama, and Codex. Mix providers per node using model-prefix routing (`openai/gpt-4o`, `ollama/llama3.2`).
  </Card>

  <Card title="HITL gates" icon="user-check">
    Insert `approval_gate` or `user_input` nodes to pause a run and wait for a human decision. Resume with `agentgraph approve` or `agentgraph respond`.
  </Card>

  <Card title="Deterministic replay" icon="rotate-left">
    Every run writes a fixture file. Replay any run without making LLM calls — useful for iterating on prompts and debugging logic without spending tokens.
  </Card>

  <Card title="Content-addressed artifacts" icon="box-archive">
    Node outputs are stored by SHA-256 hash. Downstream nodes reference outputs by ID, not by copying text, keeping LLM context bounded.
  </Card>

  <Card title="Workflow-as-code" icon="code-branch">
    YAML files are the source of truth. Version them in git, diff them in PRs, deploy them through CI — no proprietary platform lock-in.
  </Card>
</CardGroup>

## Node types

dagraph supports 10 node types that cover the most common patterns in AI workflows:

| Type             | What it does                                                           |
| ---------------- | ---------------------------------------------------------------------- |
| `agent`          | Single LLM call. Renders a Jinja prompt, calls a model, stores output. |
| `evaluator_loop` | Generator + evaluator pair that iterates until the evaluator approves. |
| `loop`           | Iterative agent loop with a Jinja termination condition.               |
| `approval_gate`  | Pauses the run and waits for a human `approve` or `reject`.            |
| `user_input`     | Pauses and waits for free-text, a selection, or a confirm response.    |
| `planner`        | Emits new nodes at runtime based on intermediate results.              |
| `map`            | Fan-out: runs one agent call per item in a list, concurrently.         |
| `subgraph`       | Runs another DAG file as a single composable node.                     |
| `bash`           | Runs a shell command in a sandbox; stdout becomes the artifact.        |
| `python_exec`    | Runs Python code in a sandbox; same output contract as `bash`.         |

## What dagraph is not

dagraph does not manage your prompts in a database, provide a visual drag-and-drop editor, or require a hosted platform to run. It is a CLI tool and a Python library. Your workflows live in files you own.

<CardGroup cols={2}>
  <Card title="Get started" icon="rocket" href="/quickstart">
    Install dagraph and run your first workflow in under 5 minutes.
  </Card>

  <Card title="Installation" icon="download" href="/installation">
    Full install options and backend configuration for all 7 providers.
  </Card>
</CardGroup>
