It started as a system to help me deal with my health issues and became my OS: Retinue is a
#sparql backed framework for AI agents.
Learning about
#RAG I asked Fable 5:
github.com/Retinue-OS/retinu… how is this different from RAG?
The core difference: RAG retrieves *text* for the LLM to read; this computes *answers* the LLM only interprets.
In RAG, you embed chunks, do similarity search, and stuff the top-k passages into context — the LLM then synthesizes something plausible from what happened to be retrieved. That fundamentally can't answer aggregate questions: no amount of chunk retrieval gets you "you slept longer than 78% of nights," [github](
github.com/Retinue-OS/retinu…) because that needs the full distribution at query time, and pasting a year of five-minute CGM readings into a prompt [github](
github.com/Retinue-OS/retinu…) isn't retrieval, it's a haystack. Here the agent writes SPARQL, and the store does exact joins, GROUP BY, and counts over years of observations — the store does the aggregation, the agent does the reasoning [github](
github.com/Retinue-OS/retinu…) . The result is deterministic and can't hallucinate.
The second difference is the semantic layer. RAG retrieval is fuzzy over unstructured text; here everything is normalized into shared vocabularies (SOSA, LOINC, SNOMED), so a glucose reading from a CGM, a sleep score from a ring, and a step count from a watch are all the same shape and join without negotiation. Plus provenance is structural: each file's triples land in a named graph derived from the file's path, rather than chunk metadata bolted on. The doc's own summary is apt: grep gets you text, SPARQL gets you joins — and RAG is essentially fuzzy grep.
They're complementary, though: this architecture deliberately leaves the prose bodies of notes unstructured, and answering questions *about prose* is exactly where RAG-style retrieval still fits. Structured facts → SPARQL; narrative text → retrieval.