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.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 uu-graph-r 0.5.0
File Size Uploaded
uu_graph_r-0.5.0.tar.gz 510.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for uu-graph-r 0.5.0
File
uu_graph_r-0.5.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
uu_graph_r-0.5.0-cp312-abi3-manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64 Details
uu_graph_r-0.5.0-cp312-abi3-manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.28+ ARM64 Details
uu_graph_r-0.5.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
uu_graph_r-0.5.0-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.0.tar.gz

Download URL uu_graph_r-0.5.0.tar.gz
Size 510.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c8b7e624bedf7004c82131fc9e94f79df83cd70e3b6b93d8a03dfbcbfb27e4dc
BLAKE2b-256 checksum
How to use checksums
7071a424dfac6ea7e329fd790e43b5818a96532bdc56939d031dd449b4f89cc8
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.0-cp312-abi3-win_amd64.whl

Download URL uu_graph_r-0.5.0-cp312-abi3-win_amd64.whl
Size 2.7 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1cf50355795b61cc4959a3414db55e88bef624f85b99f322f934a491c924719b
BLAKE2b-256 checksum
How to use checksums
c41a7455d5489444cf52f1f4da7f3a894fda0643ce81523e7998978054fa78b7
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.0-cp312-abi3-manylinux_2_28_x86_64.whl

Download URL uu_graph_r-0.5.0-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
67310e35459e79c8b1a28e9a6c0c08f3dd521d5f5efac3d0d2e8f544e899c2a0
BLAKE2b-256 checksum
How to use checksums
45589c110d2a3ba087811ad33856b73903ec5c6c1b705e40226945c209f6481f
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.0-cp312-abi3-manylinux_2_28_aarch64.whl

Download URL uu_graph_r-0.5.0-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
3992419272c624c6788cb0f50a797cf05b6df4080ef90fb274d277aa573abce9
BLAKE2b-256 checksum
How to use checksums
5802901f68fa3351a20e51109d1c394225dbf1362167955be513e22c7b63c71b
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.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL uu_graph_r-0.5.0-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
9e2102f57a8cca7ad91734926d7368b7bb8c24284abdc5aaf2da86d82a6ac236
BLAKE2b-256 checksum
How to use checksums
6c9c0630eecdde67af77fa25d1cb3b470fc3b7c057ffaed42744dbe6788c981a
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.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL uu_graph_r-0.5.0-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
5660ecba0babbb5a9226202be13f8d9bcd63c396d64f9379ddb5d455482a9097
BLAKE2b-256 checksum
How to use checksums
98bd1a31ef5db05b8f167917e6692db7589ce0e9189e2d5ca2ce4cfc91d95ed6
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

0.5.1

6 release files

This release

0.5.0 This release

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