Task graph
Nodes execute work. Edges encode dependencies, conditions, handoffs and recovery paths.
- Answers
- What happens next?
- Persists
- Run state and checkpoints
- Fails through
- Bad routes, races, unbounded loops
2026 production handbook Execution topologies, knowledge memory substrates and retrieval dynamics - designed as one production system.
Use explicit graphs when a single agent loop can no longer make dependencies, recovery, memory and evidence predictable. This handbook shows which graph to build, how the patterns compose and what must be proven before production.
AI graph engineering is the discipline of encoding execution paths, state transitions, dependencies, memory relationships and retrieval routes as inspectable structures. It shifts reliability from prompt wording into versioned topology, typed contracts and runtime evidence.
Do not ask "Which graph database or framework should we use?" Ask "Are we structuring what the system does, what it knows, or both?"
Nodes execute work. Edges encode dependencies, conditions, handoffs and recovery paths.
Nodes represent entities, facts or events. Typed edges carry relationships, provenance and time.
Shape one model call.
Template and examplesShape what the model sees.
Retrieval and token assemblyShape one agent's iteration.
Tools, observations and stop conditionsShape the whole system.
Nodes, edges, state, memory and evidenceGraph engineering does not replace prompt, context or loop engineering. It governs how those lower-level techniques compose across a system.
Choose the lightest topology that makes the required behavior explicit. Complexity is justified by a control need, not by the number of agents on the diagram.
A -> B -> CA -> {B | C | D}A -> [B, C, D] -> EGenerate -> Test -> ReviseLead -> specialist subgraphsPrepare -> Pause -> Approve -> ActGoal -> governed subgraphs -> synthesisA VDF AI DAG agent network is a multi-agent workflow in which nodes perform bounded work and directed edges encode dependencies. The outer graph is acyclic, so independent branches can run in parallel and completion, caching and re-execution remain predictable.
| Node type | Production role |
|---|---|
| Agent | Reason, generate or judge with a defined model, prompt, tools and guardrails. |
| Multi-agent | Run a bounded subnetwork with its own decomposition and aggregation contract. |
| Data | Retrieve, filter, map, normalize or join enterprise information. |
| Control | Branch, wait, rate-limit, approve, retry, cache or aggregate. |
| Integration | Read from or write to an API, application, event bus or storage system. |
In a separate execution benchmark, the routed condition used 94.9% less predicted energy than a pinned frontier-model baseline while aggregate quality remained within a pre-registered non-inferiority margin. This is a benchmark result, not a universal workload promise.
Read methods and task-level exceptions →A production graph carries a typed state object, not a continuously growing chat transcript. Nodes read only what they require and commit narrow updates under explicit merge rules.
| Channel | What belongs there |
|---|---|
request | Normalized goal, initiating principal, risk tier and correlation ID. |
evidence | Source references and retrieval metadata - not an unbounded transcript. |
artifacts | Versioned drafts, structured outputs and tool results. |
decisions | Routes, approvals, policy outcomes and their reasons. |
control | Iteration count, budgets, deadlines, retry state and cancellation flag. |
quality | Test results, evaluator scores, abstention flags and unresolved defects. |
Persist the state and graph pointer after a successful commit, not halfway through a side effect.
Use a run-scoped idempotency key so a resumed node cannot send, pay or write twice.
Retry transient failures; compensate a completed action whose downstream transaction fails.
Parallel branches must append, merge or override state under an explicit and tested rule.
A checkpoint is not a recovery mechanism until operators have resumed a failed run from it.
Terminate the worker after the external side effect succeeds but before the node reports success. A correct design resumes without duplicating the action.
Flat vector stores are useful for semantic recall, but they do not inherently represent identity, typed relationships, contradiction or what was true at a point in time. A temporal knowledge graph can add those semantics.
A fact edge carries two independent clocks:
The first edge is closed, not deleted. The graph can answer both "Where now?" and "Where on 1 June?"
Use lexical and vector retrieval first. Escalate only candidates in the uncertainty band, and preserve the evidence used for the decision.
Content-addressed immutable "worlds" and Merkle-style graph histories, as proposed by WorldDB, are promising for structural isolation and auditability. Treat them as an evaluated design option, not a settled enterprise standard.
GraphRAG complements passage retrieval by representing entity relationships and precomputing community-level context. Its strongest case is global sensemaking: questions whose answer must be assembled from patterns across a corpus.
| Query mode | Best for | Execution |
|---|---|---|
| Local | A specific entity or relationship | Find anchors, traverse a bounded neighborhood and join source text. |
| Global | Themes across the whole corpus | Map over community reports, rank partial answers and reduce them into a synthesis. |
| Hybrid / DRIFT | Broad question with local evidence needs | Use community context to broaden the start, then retrieve and verify detailed evidence. |
Microsoft GraphRAG uses hierarchical Leiden clustering and bottom-up community reports. It is established, documented and useful for global search.
Engineering risk: a 2026 preprint argues that modularity optimization on sparse knowledge graphs can yield many near-optimal partitions, reducing reproducibility across indexing runs.
Core-based hierarchy: deterministic density-aware communities proposed as an alternative for reproducible global retrieval.
Schema-constrained causal graphs: HCG-RAG reports 3-20x fewer nodes and 8-135x fewer build-time LLM calls than its most LLM-intensive baseline while matching entity-relation answer quality on the evaluated datasets.
The k-core and HCG-RAG results above are 2026 preprint findings. Validate them on your corpus, schema and query distribution before selecting a production index.
Production systems rarely win by forcing every question through one index. Classify the answer shape, then choose an analytical query, a local subgraph or global graph search - and combine them only when the evidence requires it.
Natural language -> constrained Cypher or SQL -> read-only execution.
Vector or lexical anchors -> bounded traversal -> evidence expansion.
Community reports -> parallel map -> score and filter -> reduce.
Validate the parsed query against schema, operation and cost allow-lists before execution.
Start with a two- or three-hop cap, then tune from measured recall and latency.
Budget by hierarchy level and require citations back to source text units.
Merge overlapping triplets, remove duplicate entity descriptions and order the remaining evidence topologically before it enters the model context. Context quality matters more than raw subgraph size.
A graph is justified when it makes a required property - dependency, recovery, specialization, temporal truth or corpus-wide reasoning - materially easier to test and operate.
| Primary need | Start with | Why |
|---|---|---|
| One bounded, unpredictable task | Single agent loop | Lowest structural overhead; retain stop conditions and tool limits. |
| Stable, multi-step process | Sequential task graph | Clear handoffs, deterministic recovery and simple observability. |
| Independent work can run together | Fan-out / fan-in DAG | Parallel speedup with an explicit reducer and predictable completion. |
| Output quality is objectively testable | Evaluator-optimizer | Feedback loop improves quality inside a hard budget. |
| Cross-domain work with isolated context | Supervisor + subgraphs | Specialists keep narrow tools and return bounded evidence. |
| Facts change and history matters | Bitemporal knowledge graph | Point-in-time answers and auditable corrections without destructive overwrite. |
| Multi-hop entity questions | Hybrid vector-graph retrieval | Semantic recall finds anchors; topology supplies relationships. |
| Whole-corpus themes | GraphRAG global search | Community summaries represent information no single chunk contains. |
| Auditable domain causality | Schema-constrained causal graph | Smaller graph, lower extraction cost and a reviewable ontology. |
Routing, tools, memory and retries are implicit. The system is hard to reproduce, authorize and contain.
Latency, state migrations and operational surface grow without adding a meaningful control boundary.
A dependency, policy, merge rule or recovery behavior is explicit enough to test independently.
Do not promote a graph because a happy-path demo completed. Promote it when the team can produce the evidence at every gate.
The team can explain why a graph is needed and which work remains deterministic code.
Every node has typed inputs, outputs, side effects, timeout and error semantics.
Resume, retry, cancellation and compensation have been exercised under failure.
Retrieval returns accessible provenance and fails closed across permission boundaries.
Task, route, retrieval and end-to-end outcome tests are versioned and repeatable.
Owners can reconstruct, contain, roll back and cost one run without developer archaeology.
The complete handbook in a print-ready format: topology catalog, state schema, memory lifecycle, GraphRAG flow, retrieval router, decision matrix and six production gates.

Graph engineering is the discipline of making an AI system's execution paths, state transitions, dependencies, memory relationships and retrieval routes explicit. It moves reliability work from prompt wording into versioned system structure.
A task graph controls what happens next: its nodes execute work and its edges carry dependencies or routes. A knowledge graph represents what the system knows: its nodes are entities or facts and its edges are typed relationships with provenance and, when needed, temporal validity.
No. A directed acyclic graph always moves forward and cannot revisit a node. Evaluator loops and state machines can contain cycles. A production design can still place a bounded cyclic subgraph inside one node of an outer DAG.
Use a DAG when the workflow benefits from explicit dependencies, parallel branches, specialist nodes, predictable retries, caching, policy per node and a finite completion structure. Keep a single loop when one bounded agent can solve the task with less operational overhead.
GraphRAG is most useful for multi-hop entity questions and global sensemaking across a corpus. Vector RAG is usually simpler and cheaper for local passage lookup. Many production systems route between vector, graph and analytical retrieval instead of choosing one exclusively.
Bitemporal memory records both when a fact was valid in the world and when the system learned or stored it. That allows point-in-time questions, late-arriving corrections and an audit trail without overwriting history.
There is no universal depth. Two or three hops is a practical starting bound for many enterprise queries because it limits expansion and latency. Tune it using measured recall, context size and failure cases, with strict maximums.
VDF AI Networks represents work as governed nodes and directed dependencies, including sequential and parallel branches, nested networks and explicit aggregation. Nodes can use different models, tools and policies, while SEEMR routes each stage under quality, cost, latency and energy objectives.
The source documents were reconciled against these official documentation pages, original papers and first-party VDF AI material. Preprint claims are labeled as such.
We will map the nodes, state, policies, retrieval modes and recovery semantics with your team - including which parts should remain ordinary deterministic software.