Skip to main content

graph-r

pip install uu-graph-r → import graph_r (Python ≥ 3.12, one abi3 wheel per platform).

An embedded, persistent knowledge graph. Point it at a URL once; it crawls, distills each page into compact lookup metadata (title, snippet, heading anchors, links), and remembers. From then on, lookups answer locally — with URLs and anchors inside a token budget, never document bodies — and sync keeps the graph fresh for almost nothing: stored ETag validators are replayed on every crawl, so unchanged pages answer 304 and transfer no body, even after a process restart.

import graph_r

store = graph_r.Store.open_or_create("kb")
store.sync("https://docs.example.com/", depth=2)   # crawl → absorb → compact

for hit in store.query("install on linux"):
    print(hit.url, hit.anchor.label if hit.anchor else "", hit.score)

store.sync("https://docs.example.com/", depth=2)   # unchanged: zero bodies
  • One class, one loop. Store.sync seeds an in-memory crawler from the graph, crawls, absorbs, compacts, and discards the crawler — bodies and vectors never outlive the call.

  • References, never bodies. query, related, and due return URLs, titles, snippets, and heading anchors; fetch the page yourself if you want the content.

  • Adaptive freshness. Every document carries a revalidation interval that grows while unchanged and cuts sharply on change; due() lists what to check next, ranked by importance.

  • Any producer. add/touch are the writer seam for corpora that do not arrive by crawl.

  • Lineage. Typed edges (contains, derives with an exact-copy flag, conditions) between documents, read in both directions, a breadth-first walk up, down or both ways, and string attributes for large values:

    store.set_edges(view_col, [(table_col, "derives", True)])   # replaces the set
    store.walk(table, direction="in", depth=3, kinds=["derives"])  # downstream
    store.set_attrs(view, {"sql": producing_sql, "type": "VIEW"})
    

    Ids are canonicalised. Every method keys a url exactly as add stores it: scheme and host lower-cased; userinfo, a default port, one trailing slash and the #fragment dropped; query parameters sorted (a string that does not parse as a URL is kept verbatim). So bq://p/d/t#c and bq://p/d/t are the same document — give a column its own path segment (bq://p/d/t/c).

  • Exhaustive listing. urls(prefix) returns every live document under a prefix, sorted — not ranked like query.

  • Deterministic release. close() drops the mapping and the writer lock now, so the directory can be deleted (Windows refuses while a file is mapped). A store written by another format version raises FormatVersionError (a GraphRError) with found and supported.

  • Thread-safe. Every method detaches from the interpreter; driving the store through asyncio.to_thread is the intended pattern.

  • Durable. An mmapped, checksummed store with write-ahead logging, crash-safe compaction, and lock-protected single-writer / many-reader access — implemented in Rust, shipped as one abi3 wheel per platform (Python ≥ 3.12).

Dual-licensed AGPL-3.0-or-later / commercial (contact spicyzhug@gmail.com).

Metadata

Release files for uu-graph-r 0.4.2

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

Source distribution (sdist)

Source distribution for uu-graph-r 0.4.2
File Size Uploaded
uu_graph_r-0.4.2.tar.gz 455.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for uu-graph-r 0.4.2
File
uu_graph_r-0.4.2-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
uu_graph_r-0.4.2-cp312-abi3-manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64 Details
uu_graph_r-0.4.2-cp312-abi3-manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.28+ ARM64 Details
uu_graph_r-0.4.2-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
uu_graph_r-0.4.2-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details

Total release size: 13.4 MB

Release files / uu_graph_r-0.4.2.tar.gz

Download URL uu_graph_r-0.4.2.tar.gz
Size 455.3 kB
Tags Source
SHA-256 checksum
How to use checksums
306f56a168e3a56bb78a682bdab3818b180b87b33d7e5d5bc20d6b8f4bce8c0c
BLAKE2b-256 checksum
How to use checksums
f466dc8842326d7ff083ba471806a2bd979cb254ade808a2cdb295c0a12d271d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / uu_graph_r-0.4.2-cp312-abi3-win_amd64.whl

Download URL uu_graph_r-0.4.2-cp312-abi3-win_amd64.whl
Size 2.7 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
09d90c528635fb8c247f37069319a0389a17206b4dda0f36b9fdbcc58b908be0
BLAKE2b-256 checksum
How to use checksums
d3a9be72cd2ea9e01ab90fd47f549416530be0f25e7c16cc01674116fa280507
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / uu_graph_r-0.4.2-cp312-abi3-manylinux_2_28_x86_64.whl

Download URL uu_graph_r-0.4.2-cp312-abi3-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
28f89607b882be523785ef363342e1f217e5fd847b8e5fa6bb6c4d530549a5c3
BLAKE2b-256 checksum
How to use checksums
4e0d183976f1c6dc0e87eb9dde0334306d17ec48e351c950db148c97916d9290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / uu_graph_r-0.4.2-cp312-abi3-manylinux_2_28_aarch64.whl

Download URL uu_graph_r-0.4.2-cp312-abi3-manylinux_2_28_aarch64.whl
Size 2.6 MB
Tags CPython 3.12 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
66be9bf8ccf531d583c2234c37871218134b4a9d046cd6dd60f6eb6a8fafbeb9
BLAKE2b-256 checksum
How to use checksums
2f92e937afa628c829ce74df2ac7a53b4ddfdaeab75f093925c5e9cb2cb6eb55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / uu_graph_r-0.4.2-cp312-abi3-macosx_11_0_arm64.whl

Download URL uu_graph_r-0.4.2-cp312-abi3-macosx_11_0_arm64.whl
Size 2.5 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
257be1c031ace4fb8ab7f1dc3cab9b4561f2242e57a6cf2d00e019344bb70cab
BLAKE2b-256 checksum
How to use checksums
26ad7d1c32c28caabce112154ff2c846ff509d3347000c1d880a3b62cbaf6fa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / uu_graph_r-0.4.2-cp312-abi3-macosx_10_12_x86_64.whl

Download URL uu_graph_r-0.4.2-cp312-abi3-macosx_10_12_x86_64.whl
Size 2.6 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
952419d35bba356f4dcb359547b23e1630ffe3ec167e4086ceb22859f5a68b79
BLAKE2b-256 checksum
How to use checksums
cccf8857d0269927e14036255c340448b80e39cbece417ea26ebaaaf78cbc57e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

6 release files

0.5.0

6 release files

This release

0.4.2 This release

6 release files

0.4.1

6 release files

0.4.0

6 release files

0.2.1

5 release files

0.2.0

5 release files

0.1.0

5 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