Skip to main content

Version control for verified truth

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

TruthGit

Version control for verified truth.

PyPI License: MIT Python 3.10+

WebsiteDocumentationDiscord


Like Git tracks code, TruthGit tracks claims. Verify with AI consensus. Store immutably. Trust, but verify.

$ truthgit init
$ truthgit claim "Water boils at 100°C at sea level" --domain physics
$ truthgit verify

[OLLAMA:LLAMA3] 94% - Accurate under standard atmospheric pressure
[OLLAMA:MISTRAL] 92% - True at 1 atm, varies with altitude
[OLLAMA:PHI3] 95% - Correct for pure water at sea level

✓ PASSED Consensus: 94%
Verification: a7f3b2c1

Why TruthGit?

In a world of AI-generated content, misinformation, and information overload, we need infrastructure for verified truth.

TruthGit provides:

  • Immutable storage — Claims are stored by their content hash (like Git)
  • Multi-validator consensus — No single AI is trusted alone
  • Auditable history — Every verification is traceable
  • Local-first — Works offline with Ollama, no API keys required
  • Open protocol — Self-host, federate, integrate

Installation

# Install TruthGit
pip install truthgit

# For local validation (recommended)
pip install truthgit[local]

# For cloud APIs (optional)
pip install truthgit[cloud]

# Everything
pip install truthgit[all]

Local Setup (No API Keys)

TruthGit works locally with Ollama:

# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh

# Pull models for diverse validation
ollama pull llama3
ollama pull mistral
ollama pull phi3

# Verify setup
truthgit validators --local

Quick Start

# Initialize a truth repository
truthgit init

# Create claims to verify
truthgit claim "The Earth orbits the Sun" --domain astronomy
truthgit claim "Python was created by Guido van Rossum" --domain programming

# Verify with local AI consensus
truthgit verify --local

# View verification history
truthgit log

Commands

Command Description
truthgit init Initialize a new truth repository
truthgit claim "..." --domain x Create a claim to verify
truthgit verify [--local] Verify claims with consensus
truthgit status Show repository status
truthgit log Show verification history
truthgit cat <hash> Show object details
truthgit validators Show available validators

How It Works

1. Content-Addressable Storage

Every object is stored by its SHA-256 hash (like Git):

.truth/
├── objects/
│   ├── cl/  # Claims
│   ├── ax/  # Axioms (immutable truths)
│   ├── ct/  # Contexts (groups of claims)
│   └── vf/  # Verifications (snapshots)
├── refs/
│   ├── consensus/  # Verified truth
│   └── perspectives/  # Per-validator views
└── HEAD

2. Multi-Validator Consensus

Claims are verified by multiple independent validators:

        ┌─────────────┐
        │   Claim     │
        └──────┬──────┘
               │
    ┌──────────┼──────────┐
    ▼          ▼          ▼
┌───────┐  ┌───────┐  ┌───────┐
│Llama3 │  │Mistral│  │ Phi3  │
│  92%  │  │  88%  │  │  90%  │
└───────┘  └───────┘  └───────┘
               │
               ▼
        ┌─────────────┐
        │ Consensus   │
        │    90%      │
        │  ✓ PASSED   │
        └─────────────┘

Default threshold: 66% (configurable)

3. Verification as Commit

Like Git commits, verifications are immutable snapshots:

from truthgit import TruthRepository

repo = TruthRepository()
repo.init()

# Create claim
claim = repo.claim(
    content="E=mc²",
    domain="physics",
    confidence=0.9,
)

# Verify with multiple validators
verification = repo.verify(
    verifier_results={
        "LLAMA3": (0.95, "Mass-energy equivalence"),
        "MISTRAL": (0.92, "Einstein's famous equation"),
        "PHI3": (0.94, "Verified relationship"),
    }
)

print(f"Consensus: {verification.consensus.value:.0%}")
# Consensus: 94%

Validators

TruthGit supports pluggable validators:

Local (No API Keys)

from truthgit.validators import OllamaValidator

validators = [
    OllamaValidator("llama3"),
    OllamaValidator("mistral"),
    OllamaValidator("phi3"),
]

Cloud (Optional)

from truthgit.validators import ClaudeValidator, GPTValidator, GeminiValidator

# Set environment variables:
# ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY

validators = [
    ClaudeValidator(),
    GPTValidator(),
    GeminiValidator(),
]

Human

from truthgit.validators import HumanValidator

validators = [
    OllamaValidator("llama3"),
    HumanValidator("reviewer"),  # Interactive CLI prompt
]

Configuration

.truth/config:

{
  "version": "1.0.0",
  "consensus_threshold": 0.66,
  "default_verifiers": ["OLLAMA:LLAMA3", "OLLAMA:MISTRAL"]
}

Use Cases

  • Knowledge Bases — Build verified, auditable knowledge graphs
  • Fact Checking — Multi-source verification for claims
  • Research — Track hypotheses and their verification status
  • AI Training Data — Curate high-quality, verified datasets
  • Documentation — Version control for technical claims

Roadmap

  • Federation — Sync truth between repositories
  • IPFS Storage — Decentralized content storage
  • Web UI — Visual truth explorer
  • GitHub Integration — Verify claims in issues/PRs
  • VS Code Extension — Inline claim verification

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

# Development setup
git clone https://github.com/truthgit/truthgit
cd truthgit
pip install -e ".[dev]"
pytest

Philosophy

"In a world where AI can generate infinite content, the scarce resource is verified truth."

TruthGit is built on three principles:

  1. Consensus over authority — No single source is trusted
  2. Immutability over mutation — Truth is append-only
  3. Openness over control — Protocol is open, self-hosting is encouraged

License

MIT © TruthGit


truthgit.com — Version control for verified truth.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

truthgit-0.5.0.tar.gz (72.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

truthgit-0.5.0-py3-none-any.whl (68.8 kB view details)

Uploaded Python 3

File details

Details for the file truthgit-0.5.0.tar.gz.

File metadata

  • Download URL: truthgit-0.5.0.tar.gz
  • Upload date:
  • Size: 72.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for truthgit-0.5.0.tar.gz
Algorithm Hash digest
SHA256 6386a840cdc9fb204609aaf3bf1ecd652a3fe55410177a3de1cb05d544a5727c
MD5 3a92e4ee0a06610fedb093640065ceba
BLAKE2b-256 92b14a78251226dc59c0fbccffb8c4ad7c356b0a3cb69f0ee3ddf0441e1d8df6

See more details on using hashes here.

File details

Details for the file truthgit-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: truthgit-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 68.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for truthgit-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ae8bb3c1231a9039b6b40d8a8f66d60e98857443f51a4ba85778927da22ad6c
MD5 f5925eef322e881a70385256efed1105
BLAKE2b-256 f9593112f2cfb05b3154c07363b748c065897ef1158d6567ad5a2c9e94b8a44e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page