Run directory structure
Each run produces a directory underruns/ in your working directory:
state.db is the source of truth for run state. If a run is interrupted, dagraph reads state.db to determine which nodes have already completed and skips them on resume.
trace.jsonl records every LLM call, tool invocation, and node lifecycle event as an OpenTelemetry GenAI span. You can feed this into any OTel-compatible observability tool.
The artifact store
dagraph stores each node’s output as a UTF-8 text blob identified by its SHA-256 hash. When a node completes, the scheduler:- Computes the SHA-256 digest of the output text.
- Writes the blob to
artifacts/sha256/<digest>.bin(skipped if the file already exists). - Updates
artifacts/index.jsonto recordnode_id → digest.
Content-addressing means that if two nodes produce identical output — for example, two researchers who reach the same conclusion — the blob is stored exactly once on disk. The index maps both node IDs to the same digest. This gives you automatic deduplication with no extra configuration.
Referencing upstream outputs in prompts
Use a node’sid as a Jinja2 variable anywhere a downstream node has depends_on pointing to it. dagraph resolves the variable to the node’s stored output text at render time.
synthesizer runs, dagraph fetches the stored artifact for research and injects it into the prompt. You never manage file paths or artifact hashes manually.
For map nodes, the output is a JSON array of per-item strings. Iterate over it with the fromjson filter:
Writing outputs to files
Use the top-leveloutputs map to write specific node outputs to files after a successful run. This is useful when you want to save a final report, generated code, or structured data to a predictable location for downstream scripts or CI steps.
Inspecting artifacts
Useagentgraph inspect to read stored artifacts without parsing the run directory manually.
<run_id> is printed to the console when you run a workflow. You can also list recent runs with:
Deterministic replay
Every run automatically records afixture.jsonl file alongside state.db. This file captures every LLM response in the order it was received. Use the --replay-from flag to replay a past run using the recorded responses instead of making live LLM calls:
- Debugging — reproduce a run exactly to inspect intermediate state or test a prompt change.
- Testing — run your DAG against recorded responses in CI without incurring LLM costs.
- Iterating on prompts — change a downstream node’s prompt and replay to see the effect without re-running expensive upstream nodes.
Secrets redaction
Before computing the SHA-256 digest and writing a blob, dagraph runs the content through a secrets redactor that replaces patterns matching common credential formats (API keys, tokens, passwords) with[REDACTED]. The on-disk blob and the index entry both reflect the redacted form. This means:
- Secrets never land in artifact files even if a node accidentally echoes them.
- Two outputs that differ only in their secret values hash to the same digest after redaction, giving you correct deduplication.