ModelRefs / DAG (Directed Acyclic Graph) — AI Glossary
DAG (Directed Acyclic Graph) — AI Glossary
A graph structure for representing agent task plans where nodes are tasks, edges are dependencies, and the absence of cycles ensures forward progress.
Overview
DAG-based agent orchestration (LangGraph, Prefect, Airflow for ML) represents workflows as nodes (LLM calls, tool executions) connected by directed edges (data flow). Acyclicity ensures tasks complete without deadlock. DAGs enable parallel execution of independent branches and conditional routing. The foundational abstraction for production agent pipelines.
Reference details
| Topic | agents |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
How it works
- The graph is topologically sorted before anything runs, which both establishes an execution order and proves the structure is acyclic — a cycle is a validation failure rather than a runtime hang.
- A node becomes ready when every predecessor has completed, and a scheduler dispatches ready nodes up to a concurrency limit, so parallelism is a property of the structure rather than of the code.
- State moves along edges as explicit inputs and outputs, which is what makes a node testable in isolation and a run reproducible from its recorded inputs.
- Each node carries its own failure policy — fail the run, skip its descendants, or retry with a bound — and because the policy is per node it can differ for an idempotent fetch and a non-idempotent write.
- Since the structure is known in advance the whole graph can be validated and dry-run, so a missing credential or an unsatisfiable dependency surfaces before any model call is paid for.
- What the structure cannot bound is the work inside a node: a node containing an agent loop makes the graph's shape honest and its cost still unbounded.
Example: The critical path, not the sum
Four steps: A takes 2s, then B (3s) and C (5s) both depend on A and on nothing else, and D (1s) waits for both. Run serially and you wait 2 + 3 + 5 + 1 = 11 seconds. Because B and C are independent, the graph can run them at once, and the wall clock becomes the longest path through it: A + C + D = 2 + 5 + 1 = 8 seconds. Speeding up B buys nothing at all — it is not on the critical path. Writing the workflow as a graph is what makes that visible; a sequential script hides it.
Commonly confused with
A DAG is a fixed structure decided before execution, which is exactly what distinguishes it from an agent loop that chooses its next step at runtime. Acyclicity is the guarantee of termination, and it is also the limitation: a task genuinely needing to retry or revisit a step is not a DAG, which is why agent frameworks add explicit cycle support and then need step budgets to stay safe.
When to use it
Reach for it when:
- Pipelines whose steps are known in advance, where parallelism and retries should be explicit
- Where you want the execution plan to be inspectable and testable before it runs
- Fan-out/fan-in work — independent retrievals or tool calls merged at the end
Reach for something else when:
- Tasks whose next step depends on what the last one returned — that is a loop, not a graph
- Small linear pipelines, where the orchestration outweighs the work
- Assuming a DAG bounds cost: a node can still be an unbounded agent
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to DAG (Directed Acyclic Graph) — AI Glossary.
Frequently asked questions
What is DAG (Directed Acyclic Graph)?
A graph structure for representing agent task plans where nodes are tasks, edges are dependencies, and the absence of cycles ensures forward progress.
What concepts are related to DAG (Directed Acyclic Graph)?
Closely related concepts include task decomposition, parallel execution, state machine.