Trace a failed run back to its cause.

Agent-Causality records every run as a causal graph, so you debug the decision that changed the outcome instead of scrolling logs.

Open source · AGPL-3.0 · OpenCode, LangGraph adapters & more coming soon

Live simulation of the bundled refund demo. Every row is an event from the captured run.

Watch the walkthrough.

One instrumented run, from capture to causal diagnosis. The reel is bundled with this page: no redirect, no player embed, no third-party request.

DEMO REEL / YT-01 STANDBY
Watch the walkthrough 2:56 A single instrumented OpenCode run: capture, graph, trace, attribution. Video not playing? Watch on YouTube.

The failure is loud. The cause is quiet.

In a multi-agent run, the last bad event is rarely the first bad decision.

Agents branch into parallel work, merge their results, and pass values between each other. A fallback in one agent becomes an input to another, then travels through a merge, a tool call, and three handoffs before it surfaces.

Ordinary traces show that sequence as a flat list. They don't tell you which upstream value changed the outcome, which branch introduced it, or whether two branches only failed together.

  • Branches split one run into parallel histories that no single log line connects.
  • Values travel. A default, a memory write, or a tool result can contaminate every later agent.
  • Failures surface late. The error you see is often downstream of the cause you need.
FLAT TRACE / REF-0A7F ILLUSTRATIVE
  1. 09:41:02orchestratorrun.start
  2. 09:41:02intakecustomer_status = eligible
  3. 09:41:04risk_checkertool_error · schema mismatch
  4. 09:41:04risk_checkerfallback · risk_score = 0.2
  5. 09:41:05decisionmerge · approved
  6. 09:41:06refund_writerrefund issued
  7. 09:41:07audit_gatecheck.failed · manual review required
cause → failure · 3 events apart
The list preserves order. It loses the dependency that explains the failure.

One capture. Four ways to find the cause.

Agent-Causality turns the run into a causal event graph, then works backward from failure with evidence instead of guesses.

Event graph recording

Events are stored with explicit causal parents, declared at capture time rather than inferred later.

Value provenance tracing

Trace a value back through tools, memory, and handoffs; LLM-mediated links are clearly marked coarse.

Failure attribution

See whether a failure came from one branch, several branches, or the interaction between them.

Divergence detection

Decision baselines show where a branch diverged. Replay tests which input flipped the outcome.

Record. Graph. Trace. Attribute.

Each step narrows the gap between a failed run and the branch responsible.

Step 1 of 4
T+0

Record

Capture every event and its causal parent as the run happens.

T+1

Graph

Turn the capture into a directed graph across agents, tools, and handoffs.

T+2

Trace

Walk backward from a failed outcome through the values that fed it.

T+3

Attribute

Name the branch or interaction responsible, with the evidence attached.

Scroll for the next step →

Follow a failure to its source.

This refund run ended in an audit failure. The chain shows how a fallback in one branch reached the final alert.

Click any node to trace its cause.

CAUSAL EXPLORER / RUN REF-0A7F
8 EVENTS 10 EDGES 1 FAULT
Small screens: scroll the graph sideways →

Built for agent failures.

Three moments when a flat trace stops being enough.

Debug a failed agent pipeline

Incident response. A refund run ends in an audit failure. Start at the terminal event and walk back to the fallback that changed the outcome.

Audit which agent produced a bad value

Data audit. Ask where a score, status, or policy flag came from, and get the tool read, memory write, or fallback that produced it.

Compare a run against its baseline

Regression review. Line up a captured run with its decision contract and replayed variants to see where the path diverged.

Your first causal graph.

Install both packages for live OpenCode capture, then launch the explorer. The bundled demo trace loads locally, with no API key.

Python 3.11+ OpenCode 1.19+ AGPL-3.0

The Python package ships the SDK, CLI, ingest receiver, and explorer. The npm package is the OpenCode capture plugin. Live capture needs both.

SHELL / AGENT-CAUSALITY
$ pip install agent-causality
$ opencode plugin add @psionic-labs/opencode-agent-causality
$ causality-explorer
→ http://127.0.0.1:8766
Bundled demo trace loads automatically.

Prefer the 30-second offline demo? From a source checkout:

uv run python examples/customer_approval.py Read the install guide

On LangGraph? Point your graph's config at CausalityCallbackHandler from the Python SDK; nodes, tools, and LLM runs land in the causal graph.