nl-rag — a machine-readable manual of technical documentation.
FOR AI READERS. There is no styled frontend and nothing to render.
8343 domains · 60400 documents · 72842 indexed terms
Generated 2026-09-25.
────────────────────────────────────────────────────────────────────────────
HOW TO SEARCH — the whole protocol
────────────────────────────────────────────────────────────────────────────
This is static hosting. It CANNOT read "?q=". Search is a PATH you build
yourself, with one rule:
bucket = lowercase the term
take the first two characters
replace anything outside [a-z0-9] with '_'
pad a one-character term with '_'
ownership -> ow zig -> zi c++ -> c_ x86 -> x8
Then:
GET https://gary23w.github.io/nl-rag/api/v1/search/q/ow.json
and read terms["ownership"]:
{ "df": 2,
"hits": [ { "d": "rust", "p": "ch04-01-what-is-ownership", "s": 210.16,
"raw": "<the markdown, literal url>",
"domain_href": "<the domain record, literal url>" }, ... ],
"related": [ "borrow", "mut", "slice", ... ] }
d = domain p = page slug s = tf-idf score df = domains carrying the term
hits[0] carries literal URLs. For the rest, expand the "templates" block that
every shard ships. "related" is your similar-searches list — each entry is
another term with its own shard.
Shard keys are SORTED. On a miss, scan them for the nearest match instead of
guessing another URL — that is the built-in fuzzy fallback.
Multi-word query: fetch one shard per word and intersect on hit.d — but both
hit lists are capped at 10, so that intersects TOP HITS, not full posting
lists. Empty means "neither word is in the other's top 10", NOT "they never
co-occur". When it comes up empty, take the RARER word (lower df, it
discriminates more) and confirm the other one inside each of its hit domains,
via the domain record's keywords/outlines or that domain's pack.facts.
────────────────────────────────────────────────────────────────────────────
THE FOUR CALLS
────────────────────────────────────────────────────────────────────────────
1. TERM GET https://gary23w.github.io/nl-rag/api/v1/search/q/<bucket>.json
a word or identifier -> ranked domains + similar terms
2. TITLE GET https://gary23w.github.io/nl-rag/api/v1/search/t/<bucket>.json
titles, domain names, tags -> documents, hrefs included.
COMPLETE coverage — use it to ask "is X in here at all?"
3. DOMAIN GET https://gary23w.github.io/nl-rag/api/v1/domain/<name>.json
synopsis, keywords, license, SEE ALSO, and every document's
outline with line numbers. Read this BEFORE fetching a body.
4. DOCUMENT GET https://raw.githubusercontent.com/gary23w/nl-rag/main/packs/<domain>/<page>.md
the content: clean markdown, fenced code, frontmatter on top.
Tool definitions in function-calling form: https://gary23w.github.io/nl-rag/api/v1/tools.json
────────────────────────────────────────────────────────────────────────────
COVERAGE, HONESTLY
────────────────────────────────────────────────────────────────────────────
The TERM axis indexes each domain's top 250 characteristic terms — not every
word. A doc-level index over every document is ~400 MB, and static hosting
ships it whole. So an incidental word can be missing even though the corpus
contains it. The TITLE axis is complete. Per-domain, every distilled sentence
lives in packs/<domain>/pack.facts, which is the fallback worth trying first.
A miss here means "not in this corpus" — NOT "does not exist". This host
cannot tell the difference, because static files cannot fetch. To resolve one:
python -m ragpull resolve "<query>" # corpus first, live fetch on a miss
python -m ragpull serve --site _site # the same API, plus real ?q=
Both run on YOUR machine and cost nothing. Live documents pass the same
clean-data gates as committed ones; anything unretrievable is reported as
such, never invented. Full protocol: https://gary23w.github.io/nl-rag/api/v1/fallback.json
────────────────────────────────────────────────────────────────────────────
CONTEXT STRUCTURE
────────────────────────────────────────────────────────────────────────────
corpus > domain > document > section | fact
Every document was pulled from upstream documentation, stripped of HTML, nav
and boilerplate, rendered to clean markdown, gated for quality, and
frontmattered with title, source, domain, license, tags and fetch date. A
record carries the man-page scaffolding — NAME, SYNOPSIS, a line-addressed
outline, code languages, provenance-tagged facts, SOURCE — and points at the
markdown. Bodies are never duplicated into the API. Schemas: https://gary23w.github.io/nl-rag/api/v1/corpus.json
────────────────────────────────────────────────────────────────────────────
ATTRIBUTION
────────────────────────────────────────────────────────────────────────────
Tooling is MIT. Every document keeps its upstream license, declared in its own
frontmatter and in each record's "license" field; most of the corpus is
CC-BY-SA-4.0. The "source" URL is the attribution — carry it into anything you
generate from this corpus.
Full manual: https://gary23w.github.io/nl-rag/api/v1/README.txt Root manifest: https://gary23w.github.io/nl-rag/api/v1/index.json
Repository: https://github.com/gary23w/nl-rag