Halgorithem includes an interactive terminal UI built with Rich that walks you through configuring and running a full verification session from the command line — no Python scripting needed. It covers every step: providing an API key, choosing source documents, setting parameters, entering a prompt, and reviewing results.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.
Starting the TUI
The TUI requires an OpenAI API key to generate the AI response. If the
OPENAI_API_KEY environment variable is already set, the TUI detects it and skips the prompt. Otherwise, you are asked to enter it at startup. The key is masked as you type.Interactive walkthrough
API key
The TUI checks for an existing
OPENAI_API_KEY environment variable. If found, it displays the first four characters and continues. If not, you are prompted to enter your key. Leaving the field empty exits the program.Choose a source mode
Select how you want to provide truth documents:
urls— enter one or more web page URLsfiles— enter one or more local file pathsboth— enter both URLs and file paths
urls.Enter URLs and/or file paths
Depending on the source mode you chose, you are prompted to enter URLs and/or file paths as comma-separated lists. The TUI confirms how many sources were queued. If no sources are provided, the program exits.
Configure settings
Three parameters are configurable with sensible defaults:
- Verification threshold — minimum cosine similarity score to count as supported (default
0.30, range0.0–1.0) - Sentences per chunk — how many sentences to group into each comparison chunk (default
2) - Sentence overlap — how many sentences to carry over between consecutive chunks (default
1)
Enter your prompt
Type the question or instruction you want the AI to answer. The TUI passes this to
Engine.generate() along with your source documents as factual grounding.View results
The TUI runs three steps with a spinner — scraping sources, generating the AI response, and verifying claims — then clears the screen and displays the full results:
- AI Output — the raw text generated by the model
- Sources — the URLs and file paths used as truth documents
- Run Config — the threshold, chunk size, overlap, and source count used
- Verification Summary — a table showing supported, weak, contradiction, and hallucination counts out of total claims
- Issues — a panel for each flagged claim showing its status, score, reason, unsupported terms, and the closest matching source chunk
Results display
The verification summary table shows counts for each status:| Status | Meaning |
|---|---|
| Supported | Score ≥ 0.65 — strong semantic match to source |
| Weak support | Score ≥ threshold — partial match |
| Contradictions | Number mismatch or negation detected in matching chunk |
| Hallucinations | Score below threshold — no supporting source found |