Skip to main content

graph-r

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.
  • 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).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

graph_r-0.1.0-cp312-abi3-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.12+Windows x86-64

graph_r-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ x86-64

graph_r-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

graph_r-0.1.0-cp312-abi3-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

graph_r-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file graph_r-0.1.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: graph_r-0.1.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for graph_r-0.1.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 cf6c4ffa16c6e163f7c3f0297b16db2d1c0c0bb2e3b06b34def47fccdcebddf1
MD5 9603e8cfa9db2c632ad862d573d04437
BLAKE2b-256 ac4304e21672718ca882e1a37da76d981e2967bd61e30097b179cd018a767976

See more details on using hashes here.

File details

Details for the file graph_r-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graph_r-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7e759fa7eb9614f0618045df207e7ec473e65011ad8a44e934cd59f232774665
MD5 e0a3ff4dc79ade5d5edd0d7f0b6dd9ea
BLAKE2b-256 1a15cff302e5343070008c1a642db5f0ba407781cee354c143b97ebc7ee8c8ee

See more details on using hashes here.

File details

Details for the file graph_r-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for graph_r-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ba9be896310fe62da988fb8f8e3a7ed11782a51648c057e30b925a816fbeb02f
MD5 bb8a637c633645f1834aa5cd3b3eb83c
BLAKE2b-256 df1d20d317ba41d78df462de5715a4e0b56a7c0a88ec631b764f1c25eea70e45

See more details on using hashes here.

File details

Details for the file graph_r-0.1.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for graph_r-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c18dacb7f51d2a65cb4bc7e827c62c3d1eb6ee5a4a419312e983a311484066ef
MD5 c609500f8584763ba276398b9bf31b12
BLAKE2b-256 ad7bb2467e400f889c00ded273a7a6cdab8d90c4c30c1a75a014d202ab495f0d

See more details on using hashes here.

File details

Details for the file graph_r-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for graph_r-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a83347fc0f5de8eaf8162b7d77d9ddf14736c9e5383b6c8f8692d0ab1b5221cb
MD5 66765ba9ac2f68a3d44b0b020e26a4ce
BLAKE2b-256 c8578f8b9f1441f3f458ef67c592c50eb0e5fd6c744cba4a79e60dfa1c41d452

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

5 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