Causal Reasoning
causal

Predict Outcome

Predict outcomes given causes (Interventional reasoning).

This implements the second level of Pearl's Causal Ladder: "What if I DO X?" (vs. just observing)

Given a set of causes, predicts the most likely effect by:

  1. Finding all causal paths from causes to target
  2. Weighting paths by edge strength
  3. Estimating probability of target outcome

Why This Matters

Planning requires interventional reasoning. We can:

  • Ask "If I take action X, what will happen?"
  • Trace causal chains to predict downstream effects
  • Identify necessary conditions for goals

Args: request: Cause IDs and target to predict current_user: Authenticated user db: Database session

Returns: Predicted outcome with probability and causal chain

Example: ``` Causes: ["memory_user_said_hello", "memory_i_responded"] Target: "user_satisfaction"

Returns:
{
    "outcome_id": "user_satisfaction",
    "probability": 0.78,
    "confidence": 0.85,
    "causal_chain": ["said_hello", "responded", "user_satisfaction"]
}
```
post/api/v1/causal/predict

Request

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

Headers

X-API-Keystring nullable

Request body

cause_idsstring[] required

Starting cause fact IDs

target_idstring required

Target fact ID to predict

max_depthinteger

Response

Successful Response

outcome_idstring required
probabilitynumber required
confidencenumber required
causal_chainstring[]

Changes

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