Skip to content

Advanced Inference

advanced

Bayesian belief classification, Phi-B routing decisions, and Expected Free Energy evaluation.

Belief classify

POST/v1/memory/belief/classify

Classify query via Bayesian inference: exact match, novel composition, or new pattern.

querystringrequired

Text query to classify (auto-embedded).

200Response
{
  "classification": "composition",
  "probabilities": {
    "exact_match": 0.12,
    "composition": 0.73,
    "novel": 0.15
  },
  "best_match_id": "pat_a1b2c3",
  "confidence": 0.73
}

Routing decide

POST/v1/memory/routing/decide

Routing decision via Phi-B geometric surprise: which pathway for a query.

querystringrequired

Text query (auto-embedded).

contextstring | null

Optional context text to influence routing.

200Response
{
  "pathway": "energy",
  "scores": {
    "exact": 0.23,
    "energy": 0.89,
    "attention": 0.45
  },
  "geometric_surprise": 0.34,
  "confidence": 0.89
}

EFE evaluate

POST/v1/memory/efe/evaluate

Evaluate Expected Free Energy for candidate pathways.

querystringrequired

Text query (auto-embedded).

pathwaysarray[string]Default: ["exact", "energy", "attention"]

Candidate pathways to evaluate.

200Response
{
  "evaluations": {
    "exact": {
      "efe": 2.34,
      "epistemic_value": 0.12,
      "pragmatic_value": 0.89
    },
    "energy": {
      "efe": 1.23,
      "epistemic_value": 0.67,
      "pragmatic_value": 0.92
    },
    "attention": {
      "efe": 1.89,
      "epistemic_value": 0.45,
      "pragmatic_value": 0.78
    }
  },
  "recommended": "energy"
}
Tip

Lower EFE indicates a better pathway. The system uses these evaluations internally for Active Inference routing — this endpoint exposes the decision process for debugging and observability.

Next steps