Causal Reasoning
causal

Explain Effect

Explain an effect by finding root causes (Causal explanation).

Answers "Why did X happen?" by:

  1. Finding all causal edges leading to the effect
  2. Recursively finding causes of those causes
  3. Returning root causes ranked by total strength

Why This Matters

Debugging and learning require causal explanation:

  • "Why did the prediction fail?"
  • "What caused user satisfaction?"
  • "What leads to memory consolidation?"

Enables agents to trace failures to decisions and improve.

Args: effect_id: Effect/outcome to explain current_user: Authenticated user db: Database session

Returns: Root causes ranked by strength

Example: ``` Effect: "agent_decision_good"

Returns:
{
    "effect_id": "agent_decision_good",
    "root_causes": [
        {
            "cause_id": "memory_past_success",
            "strength": 0.92,
            "chain_depth": 2
        },
        {
            "cause_id": "user_clear_intent",
            "strength": 0.78,
            "chain_depth": 1
        }
    ]
}
```
get/api/v1/causal/explain/{effect_id}

Request

  • The document declares no server URL.
  • Auth: HTTP bearer

Path parameters

effect_idstring required

Headers

X-API-Keystring nullable

Response

Successful Response

effect_idstring required
root_causesobject[]

Changes

No recorded changes to this operation across all 2 revisions of this API.