R346 · Knowledge for agents › Retrieval over long documents

rete: an RDF graph as one file on object storage, queried by range request

Read the original

knowledge-graphrdfsparqlretrievalmcpobject-storageopen-source

Source: caviri/rete, Apache-2.0, surfaced 26 Nov 2026. The benchmark page's later sections are not verified line by line against the current revision.

What it is

Publishing a queryable RDF graph has normally meant running a triplestore: load the data, keep a SPARQL endpoint alive, pay for it while nobody queries. rete removes the server. A graph is built once into a single immutable .rete file, that file is dropped on anything that serves HTTP range requests — S3, Cloudflare R2, GitHub Pages, Zenodo — and clients run SPARQL against it in place, fetching only the byte ranges a query touches. The project's own analogy is the right one: this is to RDF what Parquet is to tables and PMTiles is to maps.

The same engine runs in four places — a Rust CLI and crate, Python, JavaScript, and the browser via WebAssembly — so a dataset published once is queryable from a notebook, a web page, or an agent, with no deployment in between.

How the file works

A 1 KiB header points at every section. A reader fetches the header, then only the sections it needs; there is no parse step and no index build on open, which the project measures at roughly 20 milliseconds even for a 62 GB file. Behind the header sit a dataset card, a front-coded term dictionary, and six permutation indexes cut into roughly 64 KiB tiles, each tile carrying a min/max synopsis so the planner can skip tiles without reading them. The file ends in a four-byte magic value, which gives a cheap integrity check a truncated download cannot fake.

The design consequence worth internalising: the unit of I/O is the tile, so a query's cost is the number of tiles it has to touch, not the size of the graph. The project reports opening a 62 GB file with a single range request fetching 128 KB.

Files are immutable. A change means a rebuild and a republish — there is no update path, and until the format reaches 1.0 a release may force you to rebuild what you have already published, so the source RDF has to be kept.

Build inputs and reasoning

It ingests N-Triples, N-Quads, Turtle, TriG, RDF/XML, Jelly, JSON-LD and YAML-LD, and can merge several inputs into one file. Reasoning is handled at two different times: --entail rewrites queries for OWL 2 QL at query time, while --materialize bakes RDFS/OWL RL inferences into the file at build time. There is no full entailment at query time, which is the honest trade for having no server to do the work.

The agent angle

The part that makes this more than a storage trick is that a published file is directly addressable by a model. There is an MCP bundle for one desktop assistant, a plugin for one coding agent that installs both build/publish skills and an MCP server over public datasets, and a hosted gateway that exposes MCP, REST and a SPARQL endpoint per published dataset. An agent given a .rete URL can issue SPARQL against a billion-triple graph without anyone provisioning a database for it — and, because the file is immutable and content-addressable by URL, the exact graph version an answer came from is a citable artifact rather than whatever the endpoint happened to contain that day.

What the numbers actually support

Two figures are solid and worth remembering:

Local query timings on a small synthetic graph are in the tens of milliseconds (33 ms for a triple pattern, 39 ms for a two-hop join, 107 ms for a GROUP BY), reported as five-run averages of a release build in a dev container.

Where to be sceptical

The deployment target is the thing not measured. Every HTTP figure on the benchmark page was produced "cold over HTTP against a local Range server" or a local nginx. The pitch is object storage across a network; the measurements are localhost. Range-request latency against S3 or R2, where each round trip costs tens of milliseconds and a query may need dozens of requests, is exactly where this design either works or does not, and no number addresses it. The project itself notes only a hypothesis — that the gap to a triplestore "would widen with faster storage and narrow over a slow link" — which concedes the point.

Benchmark provenance is weak, by the page's own statement. It says its tables "are not rerun by the documentation build" and that older sections "should not be treated as measurements of the current revision"; one comparison's most recent run is dated June 2026. The repository and docs also disagree about the version (0.3.2 against 0.7.8), which is a fair proxy for how fast this is moving.

The laziness is partial. Reads are lazy; evaluation is not fully streaming. Hash-join build sides, GROUP BY groups, DISTINCT sets and an ORDER BY without LIMIT are all held in memory, so the memory-bounded result above holds for the shape of query that was measured — a filtered count — and not for an arbitrary aggregation. A small local file is read whole. rete federate unions results across files and does not join them, so splitting a graph across files is not a scaling strategy.

It is pre-1.0 and says so plainly — "a highly experimental project", breaking changes expected in both the format and the APIs. It also declines the jobs it cannot do: for writes, transactions or an always-on endpoint under load it points at Oxigraph, Jena or GraphDB rather than claiming to replace them.

Why an engineering team should care

The interesting case is not replacing a triplestore you already run. It is the graph you never published because standing up and paying for an endpoint was not worth it: a dependency graph, a citation subset, an internal ontology with its instance data, a snapshot of a catalogue. Build, upload, hand out a URL — and the read path is a CDN rather than a service with an on-call rota. Against that, the costs are real and front-loaded: no writes, a full rebuild per change, no numbers for the network you would actually deploy on, and a format that is explicitly allowed to break before 1.0. The sensible move today is a spike on a dataset whose write pattern is genuinely publish-once, with your own range-request timings taken against the bucket you would really use.

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.