Causal Reasoning
causal

Discover Causal Edges

Discover causal edges within an episode.

This endpoint analyzes an episode to identify potential causal relationships between facts. It uses three discovery signals:

  1. Temporal precedence: Earlier facts might cause later facts
  2. Correlational: Co-occurrence suggests causation
  3. LLM inference: "What causes what in this episode?"

The discovered edges have strength estimates based on discovery signal confidence.

Why This Works

General intelligence requires moving from Observation → Intervention → Counterfactual. This endpoint discovers edges so agents can later predict (intervention) and explore hypotheticals (counterfactual).

Args: episode_id: The episode to analyze request: Discovery request with auto_save flag current_user: Authenticated user db: Database session

Returns: Discovered edges with strengths and mechanisms

Example: json { "episode_id": "ep_123", "edges_discovered": 3, "edges": [ { "id": "edge_1", "cause_entity_id": "fact_1", "effect_entity_id": "fact_2", "mechanism": "temporal", "strength": 0.85 } ] }

post/api/v1/causal/discover/{episode_id}

Request

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

Path parameters

episode_idstring required

Headers

X-API-Keystring nullable

Request body

episode_idstring required
auto_saveboolean

Save discovered edges to database

Response

Successful Response

episode_idstring required
edges_discoveredinteger required

Changes

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