Skip to main content

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

Metadata

Release files for factq 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for factq 0.1.0
File Size Uploaded
factq-0.1.0.tar.gz 65.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for factq 0.1.0
File Interpreter ABI Platform
factq-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 68.5 kB

Release files / factq-0.1.0.tar.gz

Download URL factq-0.1.0.tar.gz
Size 65.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1089f422e9edebc6e4bf4cd0a1a60d7b4cd5cdf0cdfc54b37ff9a12047977846
BLAKE2b-256 checksum
How to use checksums
74c95ef9538bffb54bd7fc89336b243a7953b4d048485873d88b7023f64cfa78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 28, 2026.

Transparency log

Release files / factq-0.1.0-py3-none-any.whl

Download URL factq-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37b8b49a5ce97c434bebece779e16df744aaae00b1126efb4f49980dddc86008
BLAKE2b-256 checksum
How to use checksums
81c3a8e57fa6caa6ac275f6337d69d3d8c6e599f3fc39a4d72c550c37b5520ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page