ExecutionConfig.json JSON
{
  "decision_context": "Cloud Migration Risk",
  "hypotheses": {
    "Success: Lower TCO": 0.4,
    "Failure: Egress Costs": 0.6
  },
  "evidence": [
    "Current egress is 50TB/mo",
    "Reserved instances available"
  ],
  "risk_tolerance": "medium",
  "calculate_expected_value": true,
  "identify_key_uncertainties": true,
  "suggest_experiments": true
}
Session UI (TabbedDisplay) Rendered
Overview Bayesian Update
✔ Posterior Probabilities Calculated
Hypothesis Posterior
Success: Lower TCO 62.4%
Failure: Egress Costs 37.6%

"Evidence of reserved instances significantly increased the likelihood of TCO success..."

Live Results Showcase

Explore actual Bayesian analysis artifacts and logs generated by this task in the test workspace.

Configuration Parameters

Field Type Description
hypotheses* Map<String, Double> Map of hypotheses to prior probabilities. Must sum to 1.0.
evidence List<String> Observed data points used to update the prior beliefs.
risk_tolerance String "low", "medium", or "high". Influences decision recommendations (Default: "medium").
calculate_expected_value Boolean If true, quantifies outcomes and risks (Default: true).
identify_key_uncertainties Boolean If true, identifies critical unknowns (Default: true).
suggest_experiments Boolean If true, recommends tests to reduce uncertainty (Default: true).
input_files List<String> File patterns (e.g. **/*.kt) to use as context.
decision_context String The problem statement or background for the analysis.

Task Lifecycle

01
Validation: Ensures probabilities are between 0 and 1 and sum to 1.0 (±0.01). Validates risk tolerance levels.
02
Context Loading: Reads specified input_files and inherits context from previous tasks in the orchestration.
03
Bayesian Update: The agent evaluates the diagnostic value of each piece of evidence and calculates posterior probabilities using Bayes' Theorem.
04
Multi-Stage Analysis: Sequentially performs Expected Value analysis, identifies Key Uncertainties, and designs Experiments based on the updated belief distribution.

Embedding Cognotik

Integrate ProbabilisticReasoningTask directly into your Kotlin applications or CI/CD pipelines using the UnifiedHarness.

Scenario A: Full Agent Planning

runPlan Example Kotlin
harness.runPlan(
    prompt = "Analyze the risks of migrating our legacy auth service to OAuth2.",
    cognitiveSettings = CognitiveModeConfig(type = CognitiveModeType.AdaptivePlanning),
    workspace = File("./project-analysis"),
    autoFix = true
)

Scenario B: Single Task Execution

runTask Example Kotlin
import com.simiacryptus.cognotik.plan.tools.reasoning.ProbabilisticReasoningTask.Companion.ProbabilisticReasoning

val config = ProbabilisticReasoningTaskExecutionConfigData(
    decision_context = "Market Entry Strategy",
    hypotheses = mapOf(
        "High Demand" to 0.3,
        "Moderate Demand" to 0.5,
        "Low Demand" to 0.2
    ),
    evidence = listOf("Competitor A just exited the market"),
    risk_tolerance = "low",
    suggest_experiments = true
)

harness.runTask(
    taskType = ProbabilisticReasoning,
    typeConfig = TaskTypeConfig(),
    executionConfig = config,
    workspace = File("./workspace")
)

Prompt Segment

The following logic is injected into the LLM context:

ProbabilisticReasoning - Reason under uncertainty using Bayesian analysis
  ** Specify hypotheses with prior probabilities (must sum to 1.0)
  ** Provide observed evidence to update beliefs
  ** Calculate expected values and quantify risks
  ** Identify key uncertainties that need resolution
  ** Suggest experiments to reduce uncertainty
  ** Useful for:
     - Risk assessment and management
     - Diagnostic reasoning (bug hunting)
     - A/B test analysis and decision making
     - Resource allocation under uncertainty
     - Technology adoption decisions