Skip to main content

FathomDB

Python SDK for FathomDB — a local-first, embedded retrieval engine for application and agent workloads, built on SQLite.

A FathomDB database is a single file on your disk and runs in your process without a server. Plain open uses no model network access. Explicitly enabling the pinned default embedder may fetch verified weights on a cold cache, as described below.

Status: pre-1.0, beta

The 0.8.x line is under active development (documentation target: 0.8.31; newest published release: 0.8.30). The public surface can change between minor releases, and scale/stability guarantees are staged for 0.9.x and later.

Install

pip install fathomdb==0.8.30

Requires Python 3.10 or newer. Wheels are abi3, so one wheel per platform serves every supported interpreter. The package is a PyO3 binding to the FathomDB Rust engine and has no Python dependencies of its own. In the in-development 0.8.31 release line, the optional fathomdb[cli] extra (pip install 'fathomdb[cli]') installs the lockstep fathomdb-cli binary wheel alongside the SDK while keeping the base fathomdb wheel free of console scripts.

Quick start

from fathomdb import Engine

engine = Engine.open("./app.sqlite")

engine.write([
    {
        "kind": "doc",
        "body": "the quick brown fox",
        # Provenance is MANDATORY on every canonical row: source_id is the
        # axis erase_source() erases on, so a row without one is unerasable.
        "source_id": "import-2026-07",
    }
])

result = engine.search("brown fox")
for hit in result.results:
    print(hit.id, hit.kind)

engine.close()

What is on the surface

  • Engine lifecycle — Engine.open, engine.close, engine.drain, engine.counters(), engine.open_report() (including reranker_compiled, cuda_compiled, and rerank_available capability booleans), and a logging-subscriber seam.
  • Writes — engine.write(batch) of canonical nodes ({"kind", "body", "source_id", "logical_id"?, "state"?, "reason"?, "valid_from"?, "valid_until"?, "properties"?}) and edges ({"edge": {"kind", "from", "to", "source_id", "properties"?}}).
  • Search — engine.search(query, ...) fuses FTS5 lexical retrieval with dense vector retrieval, with optional cross-encoder reranking, JSON/property filters, an opt-in explain sidecar, and opt-in agent search hints (SearchResult.hints). A soft_fallback field reports when a branch could not contribute, rather than degrading silently.
  • Frozen reads and evidence — engine.freeze_read_context, engine.search_frozen, engine.search_with_evidence, engine.resolve_evidence, and bounded batch engine.resolve_evidence_many (1..=50 refs with per-slot partial-result outcomes).
  • Reads — the fathomdb.read module: read.get, read.get_many, read.list, read.collection, read.operational_collections, read.operational_collection, read.mutations, read.projections, read.crossed_boundary_since. Each takes a ReadView selecting existence state and world-time validity where applicable.
  • Graph — fathomdb.graph.neighbors, fathomdb.graph.search_expand for bounded BFS expansion from search hits, and fathomdb.graph.expand with predicates and optional historical as_of_write_cursor / as_of_epoch_ms coordinates.
  • Record lifecycle — engine.transition, engine.purge, engine.erase_source.
  • Projections — engine.configure_projections, declaring which fields are filterable, searchable or rankable. The engine owns every derived index; you never maintain one by hand.
  • Typed errors — a single-rooted hierarchy under fathomdb.errors.EngineError with typed payload attributes, so you branch on DatabaseLockedError or EmbedderNotConfiguredError instead of parsing message strings.

Embeddings

Vector search needs vectors. Engine.open(path, use_default_embedder=True) opts into the engine's pinned default embedder; on first use the weights are downloaded and cached under ~/.cache/fathomdb/embedders/. The default is False — a plain Engine.open performs no network access at all, and vector writes then raise EmbedderNotConfiguredError rather than quietly doing nothing.

Release cached module models

from fathomdb import release_models exposes release_models(), which drops both standalone CLS and cross-encoder caches before success. Call it after admitted model work finishes. Loading, cache waits, inference or another release raises OverloadedError immediately and clears neither cache. Empty/repeated release constructs nothing; later healthy calls reload on demand. Engine-owned Mean providers close separately with their Engine. Terminal CUDA loss still requires process restart. See model lifetime and examples.

Erasing data

Every canonical row carries a source_id, and that is deliberate: it is what makes the row erasable. Under the default autonomous policy, engine.erase_source(source_id) removes every row written under that provenance together with its full-text, vector and secondary-index shadows, and finishes the erasure at rest. engine.purge(logical_id) does the same for a single governed record. Both are idempotent, so an interrupted erasure obligation can simply be retried.

A store configured with physical_erasure_policy="explicit_maintenance" requires an exclusive maintenance window for physical erasure; direct erase/purge outside that window raises MaintenanceError. Queueing an erasure intent does not delete or hide records. Completion is certified by the maintenance result, while incomplete cleanup retains its durable fences. See the maintenance guide.

Other SDKs

The same engine is available as a Node.js package (npm install fathomdb). The Rust application peer is fathomdb-sdk (import fathomdb_sdk), available in 0.8.30; use the Rust SDK installation guide. The fathomdb crate remains the separate lower-level engine facade.

Building from source

From an owned checkout, select its declared developer tools and create its own .venv:

bash scripts/setup-python-owned.sh --provision

The helper installs a locked, noneditable wheel built from this source tree, with the declared production features and owned interpreter. Its receipt records source, wheel and native-module identity. Linked worktrees need separate environments; never borrow or repoint another checkout's binding. The explicit test-hooks gate separately builds its candidate wheel for tests.

License

MIT. See the LICENSE file shipped in this distribution.

Source, issues and full documentation: https://github.com/fathomadb/fathomdb

Metadata

Release files for fathomdb 0.8.31

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

Built distributions (wheels)

Table of built distributions (wheels) for fathomdb 0.8.31
File Actions
fathomdb-0.8.31-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for fathomdb-0.8.31-cp310-abi3-win_amd64.whl
fathomdb-0.8.31-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for fathomdb-0.8.31-cp310-abi3-manylinux_2_28_x86_64.whl
fathomdb-0.8.31-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for fathomdb-0.8.31-cp310-abi3-manylinux_2_28_aarch64.whl
fathomdb-0.8.31-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for fathomdb-0.8.31-cp310-abi3-macosx_11_0_arm64.whl
fathomdb-0.8.31-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for fathomdb-0.8.31-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 51.2 MB

Release files / fathomdb-0.8.31-cp310-abi3-win_amd64.whl

Download URL fathomdb-0.8.31-cp310-abi3-win_amd64.whl
Size 7.3 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
feeeca9df6a3fd5f5ee66e4a87e1bbd990a93cd0420fd65e032f146e4e07c35b
BLAKE2b-256 checksum
How to use checksums
86a8b41655532754cd1d7d7abd9653c8ced9bf6c30ee25c030fb517112320f4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Nov 24, 2026.

Transparency log

Release files / fathomdb-0.8.31-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL fathomdb-0.8.31-cp310-abi3-manylinux_2_28_x86_64.whl
Size 20.8 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
265d5737dffc9a912f82f652b010ba55c1604ed4fe34d1fe45940c8d5c0eda98
BLAKE2b-256 checksum
How to use checksums
0365e4f11a54f6f61d47032e5f543a8bf52563cc6981bc9e880e767a22abc723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Nov 24, 2026.

Transparency log

Release files / fathomdb-0.8.31-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL fathomdb-0.8.31-cp310-abi3-manylinux_2_28_aarch64.whl
Size 8.1 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
502d821acdf6f8588a8f3b996b285b101842c726f98a2b8fb99cc9a0b161e24b
BLAKE2b-256 checksum
How to use checksums
37f9739ed194a98102866cc348af282bbc4ae20401928a6feec0b24cdd4a0266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Nov 24, 2026.

Transparency log

Release files / fathomdb-0.8.31-cp310-abi3-macosx_11_0_arm64.whl

Download URL fathomdb-0.8.31-cp310-abi3-macosx_11_0_arm64.whl
Size 7.3 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6ab1272e7b0697f33d205f9689ae8c8ca21565698831333f3beb975cda7d9aa7
BLAKE2b-256 checksum
How to use checksums
25991927e4c499c5bd7f65c1b18752edf8222676e2411b3e55f3a25502fd38c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Nov 24, 2026.

Transparency log

Release files / fathomdb-0.8.31-cp310-abi3-macosx_10_12_x86_64.whl

Download URL fathomdb-0.8.31-cp310-abi3-macosx_10_12_x86_64.whl
Size 7.7 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8f1418717fa53606e612663a5a8320a39c92a7317a4316c602abb00a7a17beda
BLAKE2b-256 checksum
How to use checksums
d2f3bc7fcfd47cb43595e352049b917ebc4675195bcd73f4f744504f91e4fbd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Nov 24, 2026.

Transparency log

Security for fathomdb 0.8.31

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for fathomdb-0.8.31-cp310-abi3-win_amd64.whl

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 Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.31 This release

5 release files Full provenance

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