---
title: Agentic Loop Dependence Graph (ALDG)
url: https://www.emergentmind.com/topics/agentic-loop-dependence-graph-aldg
type: topic
---

# Agentic Loop Dependence Graph (ALDG)

Searching arXiv for recent papers on Agentic Loop Dependence Graph and closely related graph-based agent execution frameworks.
Agentic Loop Dependence Graph (ALDG) is a graph-based formalization of agent execution in which dependencies that would otherwise remain implicit in an agent loop are made explicit as nodes, edges, joins, and annotations. In the scheduler-theoretic formulation introduced in "From Agent Loops to Structured Graphs: A Scheduler-Theoretic Framework for LLM Agent Execution," ALDG is the explicit dependence structure obtained by lifting the implicit, context-window control flow of an Agent Loop into an immutable, static directed acyclic graph (DAG) under the Structured Graph Harness (SGH) [2604.11378]. Closely related papers use the same term, or near-equivalent graph formalisms, to model iterative planning, loop-aware static analysis, infinite loop detection, execution lineage, and runtime call-graph unrolling [2607.01942] [2607.01640] [2607.01641] [2606.15874] [2605.06365]. Taken together, these formulations suggest that ALDG is best understood not as a single universally fixed object, but as a family of graph representations for explicit agentic dependence, feedback, and recovery.

## 1. Definitions and conceptual scope

In the SGH framework, ALDG is identified with the SGH-validated static DAG for a given plan version, augmented with dependency types, escalation metadata, node state traces, contracts, and validation methods [2604.11378]. The core claim is that the classic Agent Loop can be re-expressed as an execution plan in which hidden sequencing assumptions such as “read files, then analyze” become explicit structural edges rather than transient context-window content.

Other works define adjacent objects with different emphases. Atomic Task Graph (ATG) represents planning and execution as an explicit dependency DAG of atomic tool-use units, then connects ATG to an ALDG that generalizes ATG to capture iterative behaviors and loop semantics while preserving verifiability [2607.01942]. AgentFlow defines an Agent Dependency Graph (ADG) as a triple of typed graphs over shared nodes, and then proposes ALDG as an extension with explicit loop nodes, loop-carried edges, and SCC-based loop abstractions [2607.01640]. IAL-Scan defines ALDG as a directed, attributed graph over agent execution elements, typed edges, and annotations, specialized for detecting feedback paths that can repeatedly reach costly or state-growing operations without an effective bound [2607.01641]. "LLM-as-Code Agentic Programming for Agent Harness" uses ALDG for the runtime, acyclic, unrolled dependence graph produced when deterministic code owns control flow and LLM calls are localized call sites [2606.15874]. "From Agent Loops to Deterministic Graphs: Execution Lineage for Reproducible AI-Native Work" does not use the term natively, but the paper’s execution-lineage DAG is explicitly aligned to ALDG for agentic loops [2605.06365].

| Formulation | Graph form | Primary purpose |
|---|---|---|
| SGH ALDG [2604.11378] | Immutable static DAG per plan version | Controllability, bounded recovery, auditability |
| ATG→ALDG [2607.01942] | Per-phase DAGs plus loop-aware meta-graph | Planning, reuse, localized repair |
| ADG→ALDG [2607.01640] | Typed dependency graphs plus loop nodes/SCCs | Static analysis, governance, security |
| IAL-Scan ALDG [2607.01641] | Directed attributed graph with feedback edges | Infinite loop detection and bound analysis |
| LLM-as-Code ALDG [2606.15874] | Runtime acyclic unrolled DAG | Deterministic control and depth-bounded context |
| Execution-lineage DAG [2605.06365] | Artifact-producing DAG with identity-based replay | Reproducibility and selective recomputation |

A common misconception is that ALDG necessarily denotes a cyclic graph because it refers to an “agentic loop.” The cited literature does not support a single answer. In SGH, the executable object is strictly acyclic and immutable within a plan version [2604.11378]. In ATG, cycles are disallowed inside each single-phase graph and iterative behavior is represented by graph evolution over time [2607.01942]. In AgentFlow and IAL-Scan, loops are first-class analytic objects discovered through SCCs, back-edges, or feedback edges in control/data-flow representations [2607.01640] [2607.01641].

## 2. Scheduler-theoretic foundation

The scheduler-theoretic formulation begins with an execution system
$$
E = (S, U, P, O, \Delta),
$$
where \(S = \{ (v, s_v) \mid v \in V, s_v \in \Sigma \}\) is the set of node states, \(U : S \to 2^V\) computes the ready set, \(P : 2^V \to V\) is the scheduling policy, \(O = \{ success, failure, retry, escalate \}\) is the observation space, and \(\Delta : S \times V \times O \to S\) is the state transition function [2604.11378]. Readiness is defined by
$$
U(S) = \{ v \in V \mid s_v = ready \wedge \forall (u, v) \in E: s_u = executed \}.
$$

Within this framework, the Agent Loop is characterized as a non-deterministic, single-ready-unit scheduler: at every reachable state \(s\), \(|U(s)| \le 1\), and the choice of what to activate comes from opaque LLM inference rather than an inspectable deterministic policy [2604.11378]. The paper identifies three structural weaknesses: implicit dependencies, unbounded recovery loops, and mutable execution history. Dependencies live only in the LLM’s context and memory; retry, skip, or replan decisions are ad hoc LLM outputs with no bound on attempts; and plans are silently rewritten in context, so one cannot reconstruct which plan governed which actions.

SGH addresses these weaknesses by lifting control flow into an explicit static DAG, separating planning, execution, and recovery into three layers, and imposing a strict escalation protocol with bounded budgets and monotonic recovery levels [2604.11378]. This places classic Agent Loops and graph executors on a continuum parameterized by ready-set cardinality and policy explicitness: the Agent Loop sits at \(|U| = 1\) with an implicit, non-deterministic policy, whereas SGH sits at \(|U| \ge 1\) with a deterministic, inspectable policy.

The SGH execution plan is
$$
\Pi = (id, version, V, E, \sigma, \kappa),
$$
with nodes \(V\), dependencies \(E \subseteq V \times V\), per-node configuration \(\sigma\), and output contracts \(\kappa\) [2604.11378]. Its graph is
$$
G = (V, E), \quad E \subseteq V \times V,
$$
subject to the acyclicity constraint
$$
\neg \exists C \subseteq E \text{ forming a cycle}.
$$
Because \(G\) is acyclic, it induces a strict partial order \(v_i \prec v_j\) whenever there exists a directed path \(v_i \to \cdots \to v_j\), and admits a topological ordering \(\tau : V \to \{1,\dots,|V|\}\) such that \((u,v)\in E \Rightarrow \tau(u) < \tau(v)\) [2604.11378]. In SGH, the scheduler dispatches all ready nodes respecting \(\tau\), allowing parallel execution waves when dependencies permit.

## 3. Construction and dependence semantics

The SGH paper gives an explicit lifting procedure from an Agent Loop transcript \(T = [t_1,\dots,t_n]\), where each turn produces an action \(a_i\), inputs \(x_i\), and outputs \(o_i\), into an ALDG [2604.11378]. The construction relies on deterministic dependency-extraction rules.

The **dataflow rule** adds an edge \((v_i, v_j)\) whenever turn \(t_j\) consumes an artifact produced at \(t_i\). The **tool-call rule** adds \((v_A, v_B)\) when tool or toolchain \(B\) requires outputs from tool \(A\). The **control-guard rule** adds \((v_i, v_j)\) with an `all_of` join when a postcondition at \(t_i\) is required by \(t_j\)’s precondition. The **alternative-path rule** groups alternative fixes as candidates feeding a successor through an `any_of` join. The **recovery lifting** rule is especially important: retries do not create edges, local patches are represented as recovery-state changes, and full replans create a new plan version \(\Pi'\) with a new graph \(G'\), never backward edges in \(G\) [2604.11378].

The resulting ALDG is not merely a bare DAG. It is the derived \(G = (V,E)\) annotated with join types (`all_of`/`any_of`), per-node contracts \(\kappa_v\), side-effect levels, and recovery metadata [2604.11378]. Plan validation checks acyclicity with Kahn’s algorithm, reachability, join consistency, contract well-formedness, and side-effect consistency before execution; plans failing these checks are rejected.

The paper’s illustrative example is a bug-fix task in a Python project. `search_auth` and `search_utils` are independent; `read_auth` depends on `search_auth`, `read_utils` depends on `search_utils`, `analyze` depends on both reads through `all_of`, `fix_A` and `fix_B` are alternative candidates from `analyze`, `run_tests` depends on either patch through `any_of`, `update_docs` depends on `analyze`, and `report` depends on both `run_tests` and `update_docs` through `all_of` [2604.11378]. The ready-set waves are
\(\{search\_auth, search\_utils\}\),
\(\{read\_auth, read\_utils\}\),
\(\{analyze\}\),
\(\{fix\_A, fix\_B, update\_docs\}\),
then `run_tests`, then `report`.

This example makes the semantics of joins explicit. For `report`,
$$
ready\_all\_of(report) \Leftrightarrow (\sigma(run\_tests)=executed \wedge \sigma(update\_docs)=executed),
$$
while for `run_tests`,
$$
ready\_any\_of(run\_tests) \Leftrightarrow (\sigma(fix\_A)=executed \vee \sigma(fix\_B)=executed).
$$
The paper states that `all_of` readiness is monotone in the executed set, whereas `any_of` is non-monotone because siblings can transition to `skipped` once one candidate succeeds [2604.11378].

The construction problem also appears in other graph-centric systems. ATG recursively decomposes a high-level task into a sequence of DAGs \(G_t=(V_t,E_t)\) with interface-preserving graph rewrites, typed edges, and per-node attributes such as status, cost estimate, provenance, cache key, iteration index, and invariants [2607.01942]. AgentFlow instead extracts typed nodes and edges from source code and framework semantics, building an ADG
$$
ADG_P = \langle ACDG_P, ACFG_P, ADFG_P \rangle
$$
over agents, prompts, models, capabilities, states, and policies [2607.01640]. These alternative constructions shift ALDG from transcript lifting toward static extraction or graph evolution, but they preserve the central idea that agentic dependencies should be explicit and inspectable rather than buried in unstructured trajectories.

## 4. State, recovery, and correctness properties

SGH specifies a node state machine
$$
\Sigma = \{ pending, ready, running, waiting\_human, blocked, executed, failed\_retryable, failed, cancelled, skipped \},
$$
with terminal states
$$
\Sigma_{term} = \{ executed, failed, cancelled, skipped \}
$$
[2604.11378]. Selected transitions include `pending → ready` when dependencies are met, `ready → running` on dispatch, `running → executed` on success when \(\kappa_v\) is satisfied, `running → failed_retryable` on transient error with remaining budget, `running → failed` on structural error, `ready → skipped` when a sibling in an `any_of` group executes, and `waiting_human → cancelled` on timeout or cancellation.

Bounded execution is central to the termination guarantee. Each node \(v\) has timeout \(\tau_v \in \mathbb{R}^+\) and retry budget \(b_v \in \mathbb{N}\), while `waiting_human` has finite timeout \(T_{human}\). A running node transitions to `failed` if time exceeds \(\tau_v\) or retries exceed \(b_v\) [2604.11378]. Under a valid finite acyclic DAG with all nodes reachable and bounded execution, the paper states the theorem of **Bounded Termination**: SGH’s main loop terminates with probability \(1\), and every node reaches a terminal state within bounded time. The stated time bound is
$$
\le \sum_v \tau_v \cdot (b_v + 1) + \sum_{waiting\_human} T_{human}.
$$

Soundness is explicitly conditional rather than absolute. Let \(p_v \in (0,1]\) be the probability that node \(v\)’s validation correctly accepts true outputs, with false-positive probability \(1-p_v\). If all nodes reach `executed` and validation errors are independent, then
$$
Pr[\text{all outputs correct}] \ge \prod_{v \in V} p_v.
$$
This makes the validation gap explicit and motivates deterministic or code-based validation for high-impact nodes [2604.11378]. A common misconception is that graphization alone guarantees correctness. The cited theorem does not claim that; it claims conditional soundness under validation reliability assumptions.

Recovery is formalized as a separate layer with a strict escalation protocol. SGH distinguishes a **Planner Layer**, **Runtime Layer**, and **Recovery Layer**, and enforces a context partition in which execution context \(C_{exec}\) and diagnostic context \(C_{diag}\) are disjoint during node execution [2604.11378]. Diagnostic information may enter execution only through a new plan version. Recovery levels are \(L_0 = local\_retry\), \(L_1 = local\_patch\), and \(L_2 = request\_replan\). The escalation invariant requires strict monotonicity,
$$
L(t+1) \ge L(t),
$$
requires that level \(i\) be exhausted before level \(i+1\) is invoked, and prohibits skipping levels [2604.11378]. Mechanical enforcement uses `recovery_state[v] ∈ {pristine, retried, patched}`.

This bound-oriented perspective is sharpened by IAL-Scan, which argues that visible exits are insufficient if they do not semantically constrain the controlling mechanism. Its ALDG analysis flags cycles when costly or state-growing nodes remain repeatedly reachable without an effective bound, and classifies bounds as `Covered` or `UncoveredOrWeak`, including `missing_bound`, `weak_bound`, `disabled_bound`, `ineffective_bound`, and `bypassed_bound` [2607.01641]. That work identifies Infinite Agentic Loops as structural failures arising from the interaction between agent logic, framework semantics, runtime observations, and termination mechanisms rather than from ordinary programming loops alone.

## 5. Variants and related graph frameworks

Several adjacent frameworks situate ALDG within broader graph-based agent research. ATG is a unified, training-free control framework in which planning recursively refines a task into DAGs and execution schedules antichains subject to resource constraints [2607.01942]. Single-phase graphs remain acyclic, but iterative behavior is represented by graph evolution
$$
G^{(i+1)} = \Phi(G^{(i)}, feedback_i),
$$
with termination when \(T(i)\) holds. The paper also gives an explicit ALDG definition with back-edges \(\mathcal{B}\), loop invariants \(I\), and termination conditions \(T(i)\), but restricts executable instances to acyclic \(G_t\) so that verifiability is preserved [2607.01942].

AgentFlow approaches the problem from static analysis of agent programs. Its ADG uses typed nodes from the abstract domain
\(\mathcal{A} \uplus \mathcal{I} \uplus \mathcal{M} \uplus \mathcal{C} \uplus \mathcal{S} \uplus \mathcal{G}\),
covering agent units, prompt contexts, model units, capabilities, memory/state objects, and control policies [2607.01640]. ALDG is then proposed as an extension
$$
ALDG_P = (V', E', \tau_V', \tau_E', \lambda')
$$
that adds loop nodes for SCCs, `loop_intra` edges, `loop_carried` edges, and optional `loop_exit` edges. This formulation is explicitly designed for SCC decomposition, back-edge detection, loop-carried dependence extraction, and taint-style fixpoint analysis.

IAL-Scan adopts a different abstraction. Its ALDG is
$$
G_A = (V_A, E_A, \lambda),
$$
a directed attributed graph whose node kinds include scopes, controllers, invocations, and state updates, and whose edge kinds include control flow, calls, workflow transitions, tool dispatch, handoff/reentry, message passing, and feedback edges such as `LOOP_BACK`, `RETRY_EDGE`, `ASYNC_CALLBACK`, and `AUTO_RETRY` [2607.01641]. The objective is not scheduling or replay but identification of feedback regions in which model calls, tool invocations, or state growth can repeat without effective coverage by counters, budgets, recursion limits, or timeouts.

The LLM-as-Code line of work reinterprets ALDG as the runtime dependence graph produced when loops and branches are owned by deterministic code rather than by the model [2606.15874]. In that setting, the execution history “becomes the call graph itself, a directed acyclic graph (DAG) of function and reasoning nodes,” and the crucial bound is on context assembly rather than on recovery. For an `AgentCall` node \(v\) with call depth \(D\),
$$
L_{a\_call}(v) \le c_0 + \sum_{d=1}^{D} (c_{frame}(d) + \kappa(d))
\le c_0 + D \cdot (c_F + c_S),
$$
whereas naïve orchestrator-style accumulation scales with total steps [2606.15874]. This formulation treats loop-carried dependence through forward-only iteration layers \(L[i] \to L[i+1]\), preserving acyclicity by unrolling runtime loops.

Execution lineage provides a further variant. There, the graph is \(G=(V,E)\) of artifact-producing computations, node identity is
$$
k_v = h(\sigma_v, x_v, \{k_u : u \in pred(v)\}),
$$
and replay is determined by identity equality [2605.06365]. The paper aligns this DAG to ALDG for agentic loops and argues that explicit dependencies and stable boundaries make change propagation, upstream preservation, and unrelated-branch isolation structural rather than heuristic properties.

## 6. Applications, empirical signals, and open issues

Although the SGH paper is explicit that it is “a position paper and design proposal” providing “a theoretical framework, design analysis, and experimental protocol, not a production implementation or empirical results,” the broader graph-centric literature supplies empirical signals about what ALDG-like representations enable [2604.11378].

ATG reports that explicit DAG-based planning and execution outperform strong baselines across ALFWorld, WebShop, and ScienceWorld using 7B–8B backbones. For example, with Mistral-7B, ATG obtains 55.73 on ALFWorld, 62.75 on WebShop, and 49.81 on ScienceWorld, compared with ReAct at 6.57, 14.63, and 19.12, and PoG at 23.72, 24.18, and 28.63; it also reduces average steps and lowers ALFWorld hallucinatory action rate to 12.14% versus 42.86% for ReAct [2607.01942]. These results are attributed to explicit dependencies, localized context per node, parallel scheduling, and minimal subgraph repair with reuse.

AgentFlow shows that dependency recovery is practical at scale. Implemented for five representative agent frameworks and evaluated on AgentZoo, a corpus of 5,399 real-world agent programs, it uncovers 238 taint-style prompt-to-tool risks. On 60 sampled projects, it recovers a median of 17 nodes and 28 edges per project, compared to 4 nodes/0 edges for Agent-Wiz and 2.5 nodes/2 edges for Agentic Radar; on 100 projects, it generates 2,295 components and 1,008 binding relationships for Agent BOM evaluation [2607.01640]. This indicates that typed dependence graphs are useful not only for execution but also for governance and security.

IAL-Scan evaluates its ALDG-based infinite-loop detector on 6,549 LLM agent repositories spanning 246,748 files and 33.41M LOC across eight frameworks. It reports 74 potential findings, with manual review confirming 68 Infinite Agentic Loops across 47 projects, for 91.9% precision [2607.01641]. The dominant impacts are API cost exhaustion and model denial of service, each at 95.6%, while dominant failure patterns include retry feedback without bound, tool-call iteration without bound, and multi-agent chat without turn bound. This underscores a central ALDG insight: feedback paths matter, but bound coverage over those paths matters more.

Other adjacent results emphasize maintainability and runtime control. Execution lineage preserves the final memo exactly in all runs, with zero churn and zero unrelated-branch contamination, in its unrelated-branch update task, while loop baselines regenerate and contaminate outputs; in an intermediate-artifact edit, only DAG replay achieves perfect upstream preservation, downstream propagation, unaffected-artifact preservation, and cross-artifact consistency [2605.06365]. In computer-use agents, deterministic program-owned control with an ALDG-like runtime DAG achieves 86.8% success within 15 steps on OSWorld, outperforming prior systems allowed 100 steps, with the paper attributing the gain to deterministic control and DAG-structured context [2606.15874].

Broader graphified agent loops extend the idea beyond text-first tool use. UniManip formalizes a bi-level Agentic Operational Graph over an Agentic Layer and Scene Layer and reports a 22.5% higher success rate than the strongest VLA baseline and a 25.0% higher task success rate than hierarchical baselines, while SAGE models long-term memory as a self-evolving graph memory substrate and reports 82.5/91.6 Recall@2/5 on NQ in zero-shot open-domain transfer after reader-writer feedback [2602.13086] [2605.12061]. These systems are not identical to SGH’s ALDG, but they reinforce the same research direction: graph-structured dependencies, explicit feedback channels, and bounded or analyzable iteration.

The main open issue is semantic plurality. One line of work restricts ALDG to immutable static DAGs per plan version [2604.11378]. Another treats loops as meta-graph relations over per-iteration DAGs [2607.01942]. Another elevates SCCs and loop-carried dependence to first-class objects in static analysis [2607.01640]. Another centers feedback paths, costs, state growth, and bound verification [2607.01641]. This suggests that future convergence, if it occurs, will likely be around a common objective—making agentic dependence explicit—rather than around a single canonical graph signature.

Source: https://www.emergentmind.com/topics/agentic-loop-dependence-graph-aldg