Metadata-Version: 2.5
Name: tarsier-graph
Version: 0.0.1
Summary: Deterministic, bitemporal knowledge graph of events.
License-Expression: Apache-2.0
Requires-Python: <3.13,>=3.12
Requires-Dist: httpx>=0.28.1
Requires-Dist: psycopg[binary]>=3.3.5
Requires-Dist: pydantic>=2.13.5
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: typer>=0.27.2
Description-Content-Type: text/markdown

# [•  Tarsier

A deterministic, bitemporal knowledge graph of events —
built from Wikidata, kept current from its change stream,
and honest about what it hasn't observed.

    pip install tarsier-graph
    export TARSIER_USER_AGENT="tarsier-graph/0.1 (you@example.com)"
    tarsier backfill --pack communication-history
    tarsier query as-of 1876-03-10

    as-of 1876-03-10T00:00:00Z  pack communication-history  rank preferred>normal

    QID        label                          window                    via
    Q1843318   telephony in the 19th century  [1800-01-01, 1900-01-01)  P585
    Q2916210   Mephisto                       [1876-01-01, 1877-01-01)  P571

A window of `[-infinity, …)` means the record gives an end but no start. The engine says what
it has, not what it guesses.

[Why this exists](#why-this-exists) · [The honesty model](#the-honesty-model) · [Writing a pack](#writing-a-pack) · [Probe cards](#probe-cards) · [Limitations](#limitations)

## Why this exists

Status: M0. Written at release.

## The honesty model

Backfill writes `observed` claims; the change stream writes `asserted` claims. A query about a time
before an `observed` claim's lower bound answers `unknown`, never `present`.

## Running it

Postgres comes from `docker compose up -d postgres`. Point the CLI at it with `TARSIER_DSN`
when it is not on the default port:

    export TARSIER_DSN="postgresql://tarsier:tarsier@127.0.0.1:5432/tarsier"
    tarsier pack compile packs/communication-history.yaml --count
    tarsier backfill --pack communication-history
    tarsier query as-of 1876-03-10 --json

`backfill` records every claim as `observed`: it reads the current revision of each item, so it
knows nothing about what the record said earlier. The change stream (M2) writes `asserted`.

### The page

    tarsier serve --pack communication-history            # http://127.0.0.1:8080/
    tarsier serve --host 0.0.0.0 --pack communication-history   # also your phone, same Wi-Fi

One page, two time axes: a record-time scrubber across the top (what the record said then) and
an event-time slider down the left (what was happening then). The same four endpoints answer
JSON: `/as-of`, `/as-known-at`, `/history`, `/diff`, in the shape `--json` prints.

See [docs/USER-TESTING.md](docs/USER-TESTING.md) for what is built today and what to try.

## Writing a pack

A pack is YAML: identifiers and configuration only. Validate it once live, confirm the printed
labels, and commit the lock file:

    tarsier pack validate packs/communication-history.yaml

## Probe cards

Optional enrichment, measured per model. Cards land with M4.

## Limitations

Written at release.

Wikidata structured data is CC0; see Wikidata:Copyright.
