Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/TangibleResearch/Halgorithem/llms.txt

Use this file to discover all available pages before exploring further.

Every method that verifies AI output returns a list of claim result dicts — one per extracted claim. This page documents every field in those dicts. The exact fields present depend on the claim’s type and status.

Common fields

These fields are present on every claim result regardless of type or status.
claim_id
int
required
1-indexed position of the claim in the AI output. Claims are numbered in the order they appear after sentence splitting. Claims filtered out by is_meaningful_claim are not included in results and do not consume claim IDs.
claim
str
required
The extracted claim sentence as it appeared in the AI output, after cleaning.
status
str
required
Verification outcome. One of:
ValueMeaning
SUPPORTEDCosine similarity ≥ 0.65 against at least one truth chunk
WEAK_SUPPORTCosine similarity ≥ threshold (default 0.30) but < 0.65
CONTRADICTIONHigh similarity to a chunk that contradicts the claim (number or negation mismatch)
HALLUCINATIONNo chunk scored above the threshold
score
float
required
Best cosine similarity score found across all truth chunks. Range is 0.0–1.0 for typical semantic similarity (technically -1.0 to 1.0 for cosine). A score of 0.0 indicates no matching chunk was found.
type
str
required
Claim classification. One of:
ValueMeaning
SOURCEVerified by semantic similarity against truth document chunks
MATHContains an arithmetic expression that is evaluated directly (e.g. 2 + 2 = 4)
unsupported_terms
list[str]
Proper nouns and numbers found in the claim that do not appear in any truth document token set (accounting for synonyms). An empty list means all verifiable terms were found in the truth docs. Only meaningful for SOURCE claims.

SOURCE claim fields

Present on all SOURCE type claims (i.e., when type is "SOURCE").
matched_doc_id
int | null
The file_id of the truth document whose chunk scored highest against this claim. null if no matching chunk was found (status will be HALLUCINATION).
matched_source
str | null
The file path or URL of the best matching source document. Corresponds to the file_path field on the source document dict. null if no matching chunk was found.
matched_chunk_id
int | null
The chunk_id within the matched source document. null if no matching chunk was found.
chunk_text
str
The raw text of the best matching chunk. Empty string if no matching chunk was found.

CONTRADICTION-specific fields

Present when status is "CONTRADICTION".
reason
str
The detected contradiction type. One of:
ValueTrigger condition
"Number mismatch"A number in the claim is close in magnitude to a number in the matching chunk but not equal
"Negation mismatch"The claim and the matching chunk differ in negation (one asserts, the other denies)
ai_numbers
list[str]
Numbers extracted from the claim. Present on "Number mismatch" contradictions. Each element is a string representation of the number as it appeared in the text.
truth_numbers
list[str]
Numbers extracted from the best matching chunk. Present on "Number mismatch" contradictions.

MATH claim fields

Present when type is "MATH" and status is "CONTRADICTION".
expected
float
The evaluated value of the left-hand side of the expression (e.g. for 2 + 2 = 5, expected is 4.0).
got
float
The evaluated value of the right-hand side of the expression (e.g. for 2 + 2 = 5, got is 5.0).

Full example

The following shows a complete claim result dict for a SOURCE claim with a number mismatch contradiction:
{
    "claim_id": 3,
    "claim": "BASIC was developed in 1972.",
    "status": "CONTRADICTION",
    "score": 0.712,
    "type": "SOURCE",
    "matched_doc_id": 1,
    "matched_source": "sources/basic.txt",
    "matched_chunk_id": 2,
    "chunk_text": "BASIC was developed in 1964 at Dartmouth College by John Kemeny and Thomas Kurtz.",
    "unsupported_terms": [],
    "reason": "Number mismatch",
    "ai_numbers": ["1972"],
    "truth_numbers": ["1964"]
}
Year values (1400–2100) and small ordinal numbers (≤ 31) are intentionally excluded from number mismatch detection to avoid false positives on dates and list items. Only numerically close but unequal values that fall outside these ranges trigger a "Number mismatch" contradiction.

Status thresholds summary

The following table summarises how score and detected mismatches map to status:
ConditionStatus
Number mismatch detectedCONTRADICTION
Negation mismatch detected and score ≥ thresholdCONTRADICTION
score ≥ 0.65SUPPORTED
threshold ≤ score < 0.65WEAK_SUPPORT
score < thresholdHALLUCINATION
You can adjust the boundary between WEAK_SUPPORT and HALLUCINATION by passing a custom threshold to compare_to_docs, compare_to_files, or Engine.run. The SUPPORTED vs WEAK_SUPPORT boundary is fixed at 0.65.

Build docs developers (and LLMs) love