build: Rework docs, docs-site and speedup CI
Proposed Changes
- Add a CPU-only torch install: The lock took PyTorch from PyPI. On Linux that build pulls about 15
nvidia-*packages andtriton, so every CI job restored a 3 GB uv cache and installed a 6 GB environment. Four extras need torch:embed-local,extract,docling, andchunk-neural.
[dependency-groups]
+torch-cpu = ["torch", "torchvision"]
+[tool.uv.sources]
+torch = { index = "pytorch-cpu" }
+torchvision = { index = "pytorch-cpu" }
+
+[[tool.uv.index]]
+name = "pytorch-cpu"
+url = "https://download.pytorch.org/whl/cpu"
+explicit = true
-
uv applies a source to direct dependencies only, so the
torch-cpugroup lists both packages. Every job still installs all extras. Only the torch build changes. -
Package metadata cannot choose a torch build for users, because PyPI rejects dependencies that name another index and
tool.uv.sourcesis not published. The install docs, the quickstart, and the README now showuv pip install ... --torch-backend=auto. uv picks the build that matches the GPU driver, or the CPU build when it finds no GPU. The installation page links to the PyTorch install page for other builds. -
The docs site takes the Docling look: Inter and JetBrains Mono, black and grey text, a light blue dropdown box, and a 48 px translucent top bar with a 2 px accent bar and bold text on the active menu. GitHub and PyPI show as icons, the menus stay left-aligned, and a Quickstart button sits at the right. Docs pages get a tinted sidebar pill, an "On this page" heading, and a "Copy page" menu with Copy, View as Markdown, Open in ChatGPT, and Open in Claude. The menu reads the per-page Markdown that
docusaurus-plugin-llmswrites whengenerateMarkdownFilesis on, so the generated API pages have no menu. -
The docs navigation has three top-level views: Documentation, API reference, and Changelog. The Documentation sidebar follows a reader's journey (Getting started, Core concepts, Build the graph, Resolve and enrich, Search and answer, Operate, Benchmarks), with concept and guide pages grouped by topic. The configuration and trace-span references join the Python API under API reference. No page moved, so every URL is unchanged. The seven benchmark pages were in no sidebar before. A new page now needs its id added to
docs/sidebars.js. -
CHANGELOG.mdfollows Keep a Changelog and renders at/changelog.make changelogrebuilds it from the git history with git-cliff, which groups feat, fix, perf, and refactor commits and skips docs, test, build, ci, chore, and style. The docs deploy and preview workflows now also run whenCHANGELOG.mdchanges. -
The docs build had two warnings that did not fail it. Two generated API pages put a second
classattribute on<details>blocks, and the benchmarks page description tripped the LLM-docs plugin. The link rewriter in.github/scripts/docs_api_links.pynow strips those attributes, with a test, and the API pages are regenerated.make docs-buildnow fails when the log has a warning or error line, so CI catches the next one. -
The changelog page lays out each release as a row: a sticky column with the version, date, and jump links, and the sections beside it, with Added, Changed, and Fixed filter chips. A remark plugin builds that markup from the plain
CHANGELOG.mdat build time, and the site config copies the file to the git-ignoreddocs/docs/changelog.mdbecause the docs plugin only builds files underdocs/. -
The dark theme uses a lighter-blue logo.
How did you test it?
Measured in a scratch copy with uv 0.12.18, fresh cache, zstd for the compressed size:
| Before | After | |
|---|---|---|
| Cache, compressed | 3,108 MB | 859 MB |
| Environment | 6.0 GB | 2.2 GB |
nvidia-* and triton in the lock | 15 and 1 | 0 |
- 2,199 unit tests pass and
ty checkpasses withtorch 2.14.1+cpu. uv lock --checkpasses.uv pip install "agentic-graphrag[extract,embed-local]" --torch-backend=autoresolves totorch 2.14.1+cpuwith no CUDA packages.- The lock has CPU wheels for Python 3.11 to 3.14 on Linux x86_64 and aarch64, macOS arm64, and Windows.
The CI timings on this PR are the first measurement on real runners.
Notes for the reviewer
- The install page is rewritten to list the base install, the extras, and the PyTorch methods, and the prose in the docs and README names the library Agentic GraphRAG instead of
agrag. - A fresh install of 0.0.4 resolves
selectolax1.0.0, which removed the parser thatagrag.loadersimports, soimport agrag.loadersandimport agrag.ingestionfail. The lock pins 0.4.11, so CI never saw it. This PR capsselectolaxbelow 1.0. A fresh install now resolves 0.4.13 and both imports work. A later change can move the HTML reader to the lexbor parser. - The lock moves torch from 2.13.0 to 2.14.1 and torchvision from 0.28.0 to 0.29.1.
pip-auditskippedtorchandtorchvision, because the+cpuversions are not on PyPI.make security-auditnow runsuv auditonuv.lockinstead, andpip-auditis removed from the dev group. On the same dependencies,uv auditreported every advisory package thatpip-auditreported (6 of 6, with shared advisory ids), plusdocling-slim, and it covers both torch packages. OSV treats2.0.0+cpulike2.0.0.uv auditis experimental in uv, so the target passes--preview-features audit-command. The step stayscontinue-on-error, as before.make sync(uv sync --locked --all-groups --all-extras) now installs CPU torch. A bareuv syncinstalls no torch, because thetorch-cpugroup and the extras are not defaults. A contributor with a GPU can install the CUDA build into their own environment.
Checklist
- I have updated the related issue with new insights and changes
- I added unit tests and updated the docstrings
- I've used one of the conventional commit types for my PR title:
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test: - I documented my code
Summary by cubic
Switches the lockfile to CPU-only PyTorch so CI restores a much smaller uv cache and installs a smaller environment, and rebuilds the docs site around the new install guidance.
On Linux, PyPI's torch pulls in 15 nvidia-* packages plus triton, giving a 3 GB compressed cache and a 6 GB environment; both now drop to 859 MB and 2.2 GB. The install page covers what the base install includes and how to pick extras, and the README, quickstart, and install docs recommend --torch-backend=auto, which selects the build matching the GPU driver or falls back to the CPU build. The docs also cover the pip route and the CPU-index setup in pyproject.toml for uv add users, and the prose uses the product name "Agentic GraphRAG" instead of the agrag handle.
Docs
- The site matches Docling's font, text colours, and dropdown style, with a translucent top bar, GitHub and PyPI icons, a redesigned footer with grouped link columns, and a dark-mode logo; each page gains a Copy menu offering Copy, View as Markdown, Open in ChatGPT, and Open in Claude.
- Generated API pages are split into one page per object, keeping genuine object pages and dropping only true re-export copies (the
buildmodule pages are kept via a.gitignoreexception), and the sidebars are reorganized into three top-level views without changing any URLs. - A
CHANGELOG.mdrendered at/changelogis rebuilt from git history with git-cliff, laying out each release as a block with per-type filters and jump links;make changelognow guards against missing git tags. - The docs build now fails on warnings, and the API link rewriter strips the
classandmarkdownattributes that griffe2md writes on<details>blocks; generated pages keep each Returns description on one list item. The deploy and preview workflows also run whenCHANGELOG.mdchanges. - Prose across the codebase, docs, and contribution guides is rewritten in plain simple English, with a follow-up pass restoring possessives and natural grammar the first rewrite dropped.
Side effects
- torch moves from 2.13.0 to 2.14.1 and torchvision from 0.28.0 to 0.29.1.
pip-auditis removed;make security-auditnow runsuv auditonuv.lock, which matches advisories by package name and version so it covers the+cpubuilds.- The
torch-cpudependency group pins both packages to the CPU index because uv applies sources to direct dependencies only. selectolaxis capped below 1.0 to avoid an unannounced major release that dropped the parser loaders import.