Skip to main content

link-r

pip install uu-link-rimport link_r (Python ≥ 3.12, one abi3 wheel per platform).

A tiny, embeddable crawl-and-resolve link index. Give it a parent URL: it crawls sublinks to a configurable depth, distills keywords and topics from each page, and builds a compact hybrid index (dense embeddings + BM25 + metadata filters). Queries resolve to ranked remote URLs — document bodies stay at the URL and are fetched lazily by the caller.

import link_r

idx = link_r.LinkIndex.open_or_create("kb.lnkr")
idx.update("https://docs.example.com/", depth=2)
idx.save()

for hit in idx.search("how does auth work", k=10):
    print(f"{hit.score:.3f}  {hit.url}")

# Keep the knowledge base fresh: 304s are free, dead links are evicted.
idx.refresh(ttl_secs=86_400)
  • Zero-copy. The on-disk index is the file: search runs against mapped pages with no deserialization step, verified byte-reproducible.
  • Hybrid retrieval. Dense embeddings (deterministic hash embedder by default; ONNX bge-small behind the onnx feature) fused with BM25 via reciprocal-rank fusion, with categorical prefilters and an optional link-graph boost.
  • Conditional everything. Stored ETags become If-None-Match; an unchanged page answers 304 and transfers no body, and previously indexed links keep the crawl frontier alive through it.
  • Credential-safe. Tokens are host-scoped, stripped on cross-host redirects, never rendered in debug output; URL userinfo is never persisted.
  • Thread-safe. Blocking calls detach from the interpreter; driving the index through asyncio.to_thread is the intended pattern. 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.

uu_link_r-0.1.0-cp312-abi3-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.12+Windows x86-64

uu_link_r-0.1.0-cp312-abi3-manylinux_2_28_x86_64.whl (2.7 MB view details)

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

uu_link_r-0.1.0-cp312-abi3-manylinux_2_28_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

uu_link_r-0.1.0-cp312-abi3-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

uu_link_r-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

Release history Release notifications | RSS feed

0.2.0

5 files

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