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:
- Finding all causal paths from causes to target
- Weighting paths by edge strength
- 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
Response
Successful Response
Changes
No recorded changes to this operation across all 2 revisions of this API.