Skip to main content
The Fact Engine verifies factual claims against a supplied context using deterministic methods first. The deterministic verdict is authoritative; any LLM fallback is recorded as an advisory check and can never overwrite the deterministic outcome.

Features

  • TF-IDF semantic similarity — no LLM needed.
  • Keyword overlap analysis — fast and deterministic.
  • Entity matching — numbers, dates, names.
  • Citation extraction — with relevance scoring.
  • Negation detection — catch contradictions.
  • Advisory-only LLM fallback — invoked only when deterministic confidence is below min_confidence, and its result is stored in advisory_checks.

Usage

Result contract

The Fact Engine returns a DiagnosticResult. The deterministic verdict maps to a diagnostic status as follows: Confidence is exposed via developer_fields.deterministic_confidence and is never verdict-deciding — the mapping above is based on the deterministic verdict alone.

Scoring methods

methods_used in the result reflects this shape — each entry carries an advisory_only flag so callers can tell deterministic contributions from advisory ones.

Advisory-only LLM fallback

When the deterministic confidence is below min_confidence and a provider is configured, the engine calls an LLM for additional analysis. The LLM output is recorded in advisory_checks and does not change the returned status:
This preserves the guarantee from the 3-tier engine classification: the Fact engine’s deterministic path can emit VERIFIED with a proof_ref, but a heuristic or LLM signal alone can never do so.

Batch verification

BatchFactVerifier summaries are counted by diagnostic status: