Skip to main content

Your LLM's Local Source of Truth — a local-first knowledge base and verification engine for hallucination prevention.

Project description

factq

Your LLM's Local Source of Truth

A local-first knowledge base and verification engine that sits between you and your AI tools. It answers from proven knowledge first, validates through executable code when needed, and gets smarter with every query.

Install

pip install factq

Quick Start

import factq

# Initialize from project root — auto-indexes docs/ folder
fq = factq.init(".")

# Query checks project docs first, then KB, then Deepthink
result = fq.query("What version of Pydantic does our project use?")
# result.source: 'docs' | 'kb' | 'deepthink'

# Save a verified finding to the project's docs/ folder
fq.save("docs/research/pydantic_v2_migration.md", result)

Or from the CLI:

factq init                                    # index current project
factq query "What is our database schema?"    # docs-first resolution
factq save docs/research/schema_notes.md      # commit a finding

How It Works

Query → KB Lookup (docs/ folder, milliseconds)
  → Deepthink (LLM writes Python to verify, sandbox execution)
    → Commit (verified fact saved back to docs/, git-versioned)
  1. Docs-First Resolution — Your project's docs/ folder is the first source of truth
  2. Executable Verification — When docs can't answer, factq writes and runs Python code to verify facts in a secure sandbox
  3. Self-Growing Knowledge — Verified facts are saved back as markdown files, version-controlled in git
  4. MCP Server — Runs as a local MCP server for Claude Code, Cursor, and Windsurf

Why factq?

Traditional RAG Cloud Search factq
Verification Text similarity Citation links Executable code proof
Infrastructure 3-6 GB VRAM Cloud API Zero VRAM, ~28 MB
Knowledge Persistence Ephemeral chunks None Git-versioned docs/
Offline Partial No Fully offline
Gets Smarter Over Time No No Yes

Development

git clone https://github.com/factq-dev/factq-cli.git
cd factq-cli
uv sync
uv run pytest tests/ -v

License

Apache-2.0

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

factq-0.1.0.tar.gz (65.1 kB view details)

Uploaded Source

Built Distribution

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

factq-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file factq-0.1.0.tar.gz.

File metadata

  • Download URL: factq-0.1.0.tar.gz
  • Upload date:
  • Size: 65.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for factq-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1089f422e9edebc6e4bf4cd0a1a60d7b4cd5cdf0cdfc54b37ff9a12047977846
MD5 952937a6f00dd1cdcb7960469a501556
BLAKE2b-256 74c95ef9538bffb54bd7fc89336b243a7953b4d048485873d88b7023f64cfa78

See more details on using hashes here.

Provenance

The following attestation bundles were made for factq-0.1.0.tar.gz:

Publisher: ci.yml on factq-dev/factq-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file factq-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: factq-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for factq-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37b8b49a5ce97c434bebece779e16df744aaae00b1126efb4f49980dddc86008
MD5 b88afe859d40d824069c3b5489a30d2c
BLAKE2b-256 81c3a8e57fa6caa6ac275f6337d69d3d8c6e599f3fc39a4d72c550c37b5520ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for factq-0.1.0-py3-none-any.whl:

Publisher: ci.yml on factq-dev/factq-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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