Halgorithem is a Python library that detects AI hallucinations by splitting AI output into individual claims and verifying each one against your provided source documents. Unlike AI-based approaches, Halgorithem uses semantic embeddings, NLP, and symbolic math to flag unsupported claims, contradictions, and hallucinated facts — without requiring a second AI call.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.
Quickstart
Get from install to your first hallucination report in under 5 minutes.
How it works
Understand the claim-extraction and verification pipeline.
Python integration
Use Halgorithem directly in your Python scripts and notebooks.
API reference
Full reference for the Halgorithm class and Engine module.
What Halgorithem detects
Every AI output claim receives one of four verdicts after comparison with your truth documents:| Status | Meaning |
|---|---|
SUPPORTED | Claim is semantically supported by source documents |
WEAK_SUPPORT | Claim is related but not strongly backed |
CONTRADICTION | Claim directly conflicts with source documents |
HALLUCINATION | Claim has no grounding in source documents |
Get started in three steps
Key features
No AI required
Detection runs entirely on NLP and semantic similarity — no LLM calls needed for verification.
Number conflict detection
Catches numeric hallucinations — wrong dates, figures, costs, and statistics.
Negation mismatch
Flags claims where the AI inverts the meaning of a source statement.
AI pipeline integration
Drop into LangGraph, CrewAI, PydanticAI, or AutoGen workflows.
Web scraping
Automatically scrape URLs (including Wikipedia) as truth sources.
Interactive TUI
Run verification interactively from the command line with the built-in TUI.