Skip to content

Structure Discovery

advanced

Discover causal structure, orient edges, get DAG graph, and calibrate adaptive thresholds.

Discover structure

POST/v1/memory/structure/discover

Launch full structure discovery pipeline: skeleton entropy, orientation, Meek propagation.

n_interventionsintegerDefault: 5

Number of active interventions to perform (1–50).

200Response
{
  "edges_discovered": 12,
  "edges_oriented": 8,
  "edges_uncertain": 4,
  "meek_propagated": 3,
  "dag": {
    "nodes": [
      0,
      1,
      2,
      3,
      4
    ],
    "edges": [
      {
        "source": 0,
        "target": 1,
        "oriented": true,
        "strength": 0.87
      },
      {
        "source": 1,
        "target": 3,
        "oriented": true,
        "strength": 0.72
      },
      {
        "source": 2,
        "target": 4,
        "oriented": false,
        "strength": 0.45
      }
    ]
  }
}

Get uncertainty

GET/v1/memory/structure/uncertainty

Get current structural uncertainty and best intervention target.

200Response
{
  "skeleton_entropy": 2.34,
  "uncertain_pairs": [
    [
      0,
      2
    ],
    [
      3,
      4
    ]
  ],
  "best_intervention_target": 2,
  "total_pairs": 10
}

Orient edge

POST/v1/memory/structure/orient

Actively orient the relationship between two specific patterns.

key_aarray[number]required

First pattern embedding.

key_barray[number]required

Second pattern embedding.

200Response
{
  "direction": "a_to_b",
  "significance": 0.89,
  "method": "bidirectional_perturbation"
}

Get graph

GET/v1/memory/structure/graph

Get the full discovered DAG with oriented and unoriented edges.

200Response
{
  "nodes": [
    0,
    1,
    2,
    3,
    4
  ],
  "oriented_edges": [
    [
      0,
      1
    ],
    [
      1,
      3
    ]
  ],
  "unoriented_edges": [
    [
      2,
      4
    ]
  ],
  "skeleton": [
    [
      0,
      1
    ],
    [
      1,
      3
    ],
    [
      2,
      4
    ]
  ]
}

Get thresholds

GET/v1/memory/structure/thresholds

Get auto-calibrated thresholds (StARS Phase 7.4).

200Response
{
  "causal_threshold": 0.35,
  "merge_threshold": 0.82,
  "consolidation_threshold": 0.65,
  "method": "stars_bootstrap",
  "n_bootstrap": 200
}

Calibrate

POST/v1/memory/structure/calibrate

Force recalibration of all adaptive thresholds.

200Response
{
  "recalibrated": true,
  "previous": {
    "causal_threshold": 0.3,
    "merge_threshold": 0.8,
    "consolidation_threshold": 0.6
  },
  "current": {
    "causal_threshold": 0.35,
    "merge_threshold": 0.82,
    "consolidation_threshold": 0.65
  }
}

Next steps