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 open files 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.

  • Many writers. Any number of processes may hold a writable Store on one path; open_or_create is safe when they race to create it. Each write holds the commit lock only for its append; with store.transaction() as tx: holds it across a block, so a read-modify-write is serializable and the block commits as one append. A writer that cannot get the lock in ten seconds raises LockedError (a GraphRError).

  • Durable. An mmapped, checksummed store with write-ahead logging, crash-safe compaction, and many-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.5.1

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.5.1
File Size Uploaded
uu_graph_r-0.5.1.tar.gz 513.4 kB Details

Built distributions (wheels)

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

Total release size: 13.6 MB

Release files / uu_graph_r-0.5.1.tar.gz

Download URL uu_graph_r-0.5.1.tar.gz
Size 513.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9663e2444e124bbbbfa9d4cf2c32f3a6ddeb02138b8a88c9d8c5d35ad891a4d7
BLAKE2b-256 checksum
How to use checksums
61f4644169ff4895cc4aa1d8af5b00426c9ada29926456f16ef573c8204bcbdd
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 15, 2026.

Transparency log

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

Download URL uu_graph_r-0.5.1-cp312-abi3-win_amd64.whl
Size 2.7 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a5fe1fced4e2d8308486b2d3bce96949e7aefa9ed36f05ff9ab640f0237767d4
BLAKE2b-256 checksum
How to use checksums
cb23b61be41464c94f214c44a02d4488f660fd3b6ead506d9f62bea557d858c8
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 15, 2026.

Transparency log

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

Download URL uu_graph_r-0.5.1-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
57f1d44b1d27ffbbcc98db2d5da228133f2e27d495c452d2dfcdca88b81a2e0c
BLAKE2b-256 checksum
How to use checksums
8f354a5bc061e53b48fdf2c3733b0a61df6f8dcef022a9d69f3f52ab8ef08639
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 15, 2026.

Transparency log

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

Download URL uu_graph_r-0.5.1-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
f9bdf9ba480f493006462dff11d8e9f4d90a5521c2bbb914fa7ed171746f91f4
BLAKE2b-256 checksum
How to use checksums
a00e2c122f87a0c6d95a3b455d2ce1ab0f888b85aa4e3b7bfeb06494523ac153
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 15, 2026.

Transparency log

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

Download URL uu_graph_r-0.5.1-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
00eb78031e2fe544578fbfe38910a7a34c07f524178bf37ad8c5f9829b0a582e
BLAKE2b-256 checksum
How to use checksums
88e043d2fdee6638d37a6b95969a253f8e6011e73df913483b12ec57695da75a
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 15, 2026.

Transparency log

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

Download URL uu_graph_r-0.5.1-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
a6058dea4606b39c00feb457a2c8bebde12570e3a917df4a53db095cf38b1eec
BLAKE2b-256 checksum
How to use checksums
936f898bb2081341a62bb37fc1492a77ed8f2d09b7b074838412a12b742a5e40
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 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.1 This release

6 release files

0.5.0

6 release files

0.4.2

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