Framework
GRAIN The RAG Engineer
GRAIN is a retrieval loop: Gather, Rank, Assemble, Inspect, Navigate. Gather collects candidate passages. Rank orders them for the question actually asked. Assemble builds the context the model may see. Inspect checks that the cited chunk is the one used. Navigate decides the next lookup or the refusal. If you cannot point at the passage, you do not have retrieval. You have a fluent guess.
- The moves
- 5
When to use it
Use it when a RAG demo cites the wrong paragraph with a straight face. If the team cannot open the chunk the model used, the loop is broken at Inspect.
The moves
- 01
Gather
Source selection, permissions, versioning, and the corpus contract that decides what belongs in the index.
- 02
Rank
First-stage retrieval (dense, sparse, or hybrid), then a reranker that orders candidates before assembly.
- 03
Assemble
Token budget, chunk order, deduplication, instruction layout, and citations that keep evidence usable.
- 04
Inspect
Failure traces, bad-chunk workflows, and eval suites that connect a wrong answer to a retrieval decision.
- 05
Navigate
TTL policy, re-ingest jobs, change detection, and signals that show operators how old an answer could be.
The book
The RAG Engineer
Retrieval Systems That Agents Can Actually Trust in Production
Open the bookRelated frameworks
STACK
The Agentic Codebase
STACK is a five-layer architecture for repositories where humans and agents share work: Structure, Toolchain, Agent configuration, Connection, Knowledge and quality. The agent OS is versioned like the app.
SENSE
AI Agents for Startup Strategy
SENSE is a five-move strategic intelligence layer: Scan, Evaluate, Navigate, Simulate, Execute. It turns agent work from a productivity shortcut into a sourced claim that changes a watchlist, an assumption register, or a Monday decision.
CHORUS
The Multi-Agent Organization
CHORUS is a six-skill coordination protocol for teams of 2 to 15 people who share work with specialised AI workers: Charter, Handoff, Orchestrate, Review, Update, Sync. Org charts name reporting lines. CHORUS names coordination lines.
Essays on this site
Terminology
Not a grain-size metaphor and not “we added a vector store.” GRAIN is the inspectable loop. RAG names the architecture. The RAG Engineer is available now in English and Dutch paperback, hardcover, and Kindle.
Citation
GRAIN (The RAG Engineer). Len P. van der Hof, Systems for the Strategic Self. https://lenvanderhof.com/frameworks/grain/