← Back to Manifesto

Determinism Over Guessing

"Validate output against a strict graph, not another LLM."

The Problem

Your agent returns structured data. A bank downstream needs it to be true, not plausible.

LLM-as-a-judge asks another probabilistic model whether the answer is correct. That doubles the bias and the bill.

The deterministic is back — because it's the only way to guarantee an SLA.

The Buzzword Replacement Table

Every probabilistic pattern maps 1:1 onto a deterministic primitive:

Prompt / Loop Engineering Finite State Machines (Step Functions)
LLM-as-a-Judge JSON Schema + Ontology Graph Validation
Context Inflation Eviction Policies + Data Models

LLM-as-a-judge costs GPU tokens.
Ontology validation costs fractions of a cent of CPU/memory.

Show, Don't Tell

Confine inference to a rigid contract — tokenops_ontology.yaml:

tokenops_ontology.yaml
version: "1.0"
domain: "customer_operations"

ontology:
  entities:
    - name: "Client"
      properties:
        id: "UUID"
        status: "STRING"
    - name: "Invoice"
      properties:
        id: "UUID"
        amount: "FLOAT"
        currency: "STRING"

  allowed_relations:
    - origin: "Client"
      relation: "HAS_BILLING_DISPUTE"
      target: "Invoice"

harness_constraints:
  enforce_json_schema: true
  fail_on_unknown_relation: true   # KILL SWITCH on hallucination

Validation is pure math — no tokens spent:

runtime check (zero-token)
import { validateResponse } from '@carloscortezcloud/tinkuy-agent/ontology';

const result = validateResponse(llmOutput, schema);
if (!result.valid) {
  throw new OntologyViolationException(result.violations); // → ASL Catch
}
Download tokenops_ontology.yaml ↓ v1.1 · T-Box schema · 78 lines

Try It: Valid vs Hallucination

Same validator, two outcomes. Same cost: $0.00.

Client → HAS_BILLING_DISPUTE → Invoice VALID — serialize + compress payload (prompt cache hit)

The Kill Switch

Determinism only matters if you enforce it. Pair ontology validation with a financial circuit breaker that Step Functions matches by exception name:

Step Functions ASL Catch
{
  "StartAt": "EvaluateFinancialGuardrail",
  "States": {
    "EvaluateFinancialGuardrail": {
      "Type": "Task",
      "Resource": "arn:aws:lambda:...:sayay-guard-interceptor",
      "Catch": [ {
        "ErrorEquals": ["TokenBudgetExceededException"],
        "Next": "FinancialKillSwitchTriggered"
      } ]
    },
    "ValidateOntologyWithTinkuy": {
      "Type": "Task",
      "Resource": "arn:aws:lambda:...:tinkuy-neptune-validator",
      "Catch": [ {
        "ErrorEquals": ["OntologyViolationException"],
        "Next": "HandleHallucinationError"
      } ]
    }
  }
}

Key Insight

"fail_on_unknown_relation: true" is the difference between a doc and a kill switch.

Reject corrupt data before it touches your database — and before the token bill records it.

Tinkuy on GitHub → ONTOLOGIES-101 →