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)
- Docs-First Resolution — Your project's
docs/folder is the first source of truth - Executable Verification — When docs can't answer, factq writes and runs Python code to verify facts in a secure sandbox
- Self-Growing Knowledge — Verified facts are saved back as markdown files, version-controlled in git
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1089f422e9edebc6e4bf4cd0a1a60d7b4cd5cdf0cdfc54b37ff9a12047977846
|
|
| MD5 |
952937a6f00dd1cdcb7960469a501556
|
|
| BLAKE2b-256 |
74c95ef9538bffb54bd7fc89336b243a7953b4d048485873d88b7023f64cfa78
|
Provenance
The following attestation bundles were made for factq-0.1.0.tar.gz:
Publisher:
ci.yml on factq-dev/factq-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
factq-0.1.0.tar.gz -
Subject digest:
1089f422e9edebc6e4bf4cd0a1a60d7b4cd5cdf0cdfc54b37ff9a12047977846 - Sigstore transparency entry: 1004569685
- Sigstore integration time:
-
Permalink:
factq-dev/factq-cli@66af60a01faa6fdd328a98cb6801897f71d0fbcb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/factq-dev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@66af60a01faa6fdd328a98cb6801897f71d0fbcb -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37b8b49a5ce97c434bebece779e16df744aaae00b1126efb4f49980dddc86008
|
|
| MD5 |
b88afe859d40d824069c3b5489a30d2c
|
|
| BLAKE2b-256 |
81c3a8e57fa6caa6ac275f6337d69d3d8c6e599f3fc39a4d72c550c37b5520ec
|
Provenance
The following attestation bundles were made for factq-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on factq-dev/factq-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
factq-0.1.0-py3-none-any.whl -
Subject digest:
37b8b49a5ce97c434bebece779e16df744aaae00b1126efb4f49980dddc86008 - Sigstore transparency entry: 1004569692
- Sigstore integration time:
-
Permalink:
factq-dev/factq-cli@66af60a01faa6fdd328a98cb6801897f71d0fbcb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/factq-dev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@66af60a01faa6fdd328a98cb6801897f71d0fbcb -
Trigger Event:
push
-
Statement type: