Home/Vector Databases/fact-checker
fact-checker logo

fact-checker

Enrichment pending
jagilley/fact-checker

Fact-checking LLM outputs with self-ask

GraphCanon updated today · GitHub synced today

308
Stars
40
Forks
0
Open issues
5
Watchers
2y
Last push
Jupyter NotebookCreated Dec 6, 2022

Trust & integrity

Full report
Maintenance
Dormant (991d since push)
As of today · Source: github_public_v1
Provenance
Not a fork · Personal account
As of today · Source: github_public_v1
Security (OSV)
No lockfile
As of today · Source: none

Public GitHub metadata and optional OSV dependency scans. Signals, not a guarantee. Trust methodology.

Overview

Fact-checking LLM outputs with self-ask

Capability facts

Languages
jupyter notebook

Source: github.language · Jul 11, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Python runtimePython

Source: README excerpt (regex_v1, Jul 11, 2026)

`python3 fact_checker.py 'insert question here'`
Source link

Tags

README

fact checking with prompt chaining

This repo is a simple demonstration of doing fact-checking with prompt chaining. How it works:

  • you ask your desired LLM a question
  • the LLM generates an initial answer to the question
  • the LLM self-interrogates what the assumptions were that went into that answer
  • the LLM sequentially determines if each of these assumptions are true
  • the LLM generates a new answer to the question, incorporating the new information

to run

Run

python3 fact_checker.py 'insert question here'

Be sure to wrap your question in quotes if you're passing it as a command line argument.

Alternatively, you can use the provided fact_checker.ipynb notebook.

example

Question: "What type of mammal lays the biggest eggs?"

Initial answer: The biggest eggs laid by any mammal belong to the elephant.

Assumptions made:

  • The elephant is a mammal
  • Mammals lay eggs
  • Eggs come in different sizes
  • Elephants lay bigger eggs than other mammals

Verification of assumptions:

  • The elephant is a mammal: TRUE
  • Mammals lay eggs: FALSE - Most mammals give birth to live young.
  • Eggs come in different sizes: TRUE
  • Elephants lay bigger eggs than other mammals: FALSE - Elephants do not lay eggs.

New answer: This question cannot be answered because elephants do not lay eggs and most mammals give birth to live young.

credits

Proof of concept by Jasper