Class InferenceInitializer

java.lang.Object
ai.chatur.cortex.spring.inference.InferenceInitializer

public class InferenceInitializer extends Object
Computes inference once the application is ready, so that queries against a freshly started — possibly persistent — knowledge graph see inferred statements without waiting for the first branch approval.
  • Constructor Details

    • InferenceInitializer

      public InferenceInitializer(ai.chatur.cortex.CortexInference cortex)
      Creates the initializer.
      Parameters:
      cortex - the inference role used to recompute inference
  • Method Details

    • initializeInference

      @EventListener(org.springframework.boot.context.event.ApplicationReadyEvent.class) public void initializeInference()
      Recomputes inference over the approved assertions. Runs once, on ApplicationReadyEvent; failures are logged rather than rethrown, since a failure here must not prevent the application from starting.