Engineering Playbook № 01a book and a Code Lab you run
Start With the Question
Choosing Retrieval, SQL, Graphs or a Hybrid Agent by the Shape of the Answer
An architecture playbook for AI assistants that have to be complete, not just convincing.
- playbook
- 71 pages · PDF
- code lab
- 8 labs · no keys, no cloud account
- benchmark
- 36 questions · computed ground truth
- measured on
- Azure OpenAI · AI Search · Neo4j
Who still has time for a 400-page book to make one architecture decision?
I spent quite some time tuning retrieval for answers it could never give. This playbook is what that time taught, cut down to what you need to decide and to build: the point, one worked case, measured results, and the code.
- A weekendto read it. Seventy-one pages, no warm-up chapters, and a verdict at the end of every build chapter.
- Secondsto run a lab. Eight of them, with no keys and no cloud account, each one a proof.
- Four designsalready built on the same data and measured. You compare results; you do not build four prototypes.
- An afternoonto run the same harness on your own questions, pages and a table.
What you are buying
A playbook you run, not just read.
Under every page, a lab. Under every lab, a recorded run.
The business problem
Found. Cited. Incomplete.
The business asked the company chatbot something that sounded trivial: list every retail project we have delivered. It found the five best-matching case studies, offered three, cited every one and stopped. The truth was 31 projects, in an archive of 240.
Nothing was broken. No bug, no bad chunk, no hallucination to point at. It is the most expensive kind of wrong answer, because nothing flags it. It surfaces later, as a decision somebody made on a partial list.
The answer was not in any passage. It was in all of them at once.
Inside the playbook
The book, the lab and the evidence, opened.
Eleven pages, free to read. Tap or click a page to enlarge it.
- OpeningThe day my RAG was perfectly wrong
- Part I · Understand
- 01Not all questions are created equallab-00
- 02What a correct answer requireslab-00
- Part II · Build
- 03When retrieval is enoughlab-01
- 04When the answer must be computedlab-02
- 05When relationships and meaning matterlab-03
- 06When one source is not enoughlab-04
- Part III · Measure
- 07Measuring the answer, not the demolab-05
- 08Route firstlab-06
- Part IV · Apply
- 09The question-first frameworklab-07
- ClosingThe architecture you didn’t need
Proves
Azure OpenAI, Azure AI Search, the Azure model router, and Neo4j for the graph. Every store and model sits behind a small port.
A keyword index, read-only SQLite and an in-memory graph stand in for the cloud. Python 3.12 and uv are all you need.
Adapter outlines for LangChain, other vector stores and Azure Cosmos DB show where another provider connects.
Every design answered the same questions, with a model in the loop and a manifest for each run. What the runs showed:
On questions that need every record it answers fluently from a sample, and nothing in the answer says so.
Tables and a graph both matched the computed truth on every structural answer. Neither holds the prose.
A graph without its business definitions lost more than half its score. SQL, given the same definitions as views, caught up.
Of the four designs it scored highest and cost the most per question. A router in front of it lowered the bill here. Whether routing pays depends on your traffic, so the lab ships the replay.
The scores, the cost per question, the variance between identical runs and the wrong answers each design gave are in the book, with the run or the source behind every number. The pilots were published first:
The fix is a decision, made earlier
Write down what a correct answer must contain.
A question is hard when the shape of its answer does not match the shape in which the knowledge is kept. Six shapes are worth telling apart, plus the one that needs none of this.
- The answer
- The evidence
- The architecture
- The measurement
You leave with that order and two tools: the answer contract and the architecture decision matrix.
What you get
A playbook, a lab, and the evidence between them.
- .pdfThe playbookSeventy-one pages as a PDF, for the screen and for print: opening, nine chapters in four parts, closing.
- src/ labs/The Code LabThe
question_firstpackage, eight labs, the test suite, and adapters for Azure and Neo4j. - data/The case, in three shapesOne fictional company as pages, tables and a graph with its ontology, and 36 question contracts.
- results/Every recorded runManifests, per-question rows and metrics, so you can inspect every measurement without spending a cent.
- .md .yaml .csvFour worksheetsThe question-to-architecture sheet, the contract template, the decision record, the readiness checklist.
Secure checkout
Card details go to the payment provider inside this frame; this page never sees them. After payment you land on a confirmation page and the download link is on its way.
The embedded checkout did not load. Open the checkout in a new tab instead; it is the same payment.
Before you buy.
Do I need an Azure account?
No. The eight labs and the test suite need no account and no key: they run on a keyword index, a read-only SQLite file and an in-memory graph. You need Azure OpenAI, Azure AI Search and Neo4j only to reproduce the model-in-the-loop numbers yourself, on your own account and at your own cost. The recorded results of those runs are in the archive either way.
How long until something runs?
About five minutes from unzipping. You need Python 3.12 or newer and uv. One command installs the Code Lab, the next runs the first lab, and you should see 36 questions and four lines that start with [ok].
Do I need a graph or ontology background?
No. The reader I wrote for is a Python-capable developer, AI engineer, architect or technical lead. The graph, the ontology and the definitions are introduced on the case in chapter 05, with the SQL alternative measured next to them.
Is the company real? Are the numbers?
Naissus Pay is invented, so that every answer can be computed and every design graded against it. The runs are real. A number in the text is either resolved from a recorded run with a manifest, or quoted from one of my earlier articles and labelled as previously published.
Will these results hold on my data?
They are not a forecast. They describe one fictional company, 36 questions, and the stated models and prices on the stated dates. What transfers is the method, and the last lab exists for that: it runs the same harness on your own questions, pages and a table.
Can I use the code at work? Can my team share a copy?
You may adapt the example code into software you build for yourself, your employer or your clients, commercial software included, with no fee and no attribution. The playbook and the archive are licensed to one named person, so a colleague who reads them needs their own copy. If you are buying for a team, write to me.
What does it cost?
The launch price is €39 until 31 December 2026. From 1 January 2027 it is €49. VAT is included where applicable. One price, for one person, with every later 1.x version included.
Can I get a refund?
The playbook is a digital download that arrives within minutes, so once the archive has been downloaded the purchase is final; the checkout asks you to confirm this before you pay. Should the download not arrive, the archive be damaged, or the playbook not match what this page describes, please write to me and I will put it right or refund you in full. Refunds are issued by AgentaOS, the merchant of record, to the original payment method. If you are unsure whether the playbook is for you, the preview pages above show the real material, and a question before you buy is always welcome.
How is this different from the articles?
The articles are pilots of twelve to thirty-two questions chosen by shape. The playbook turns them into one method, adds the SQL design, twenty held-out questions written before any tuning, eight labs and the harness for your own data, and measures the four designs again with a manifest for every run. Where it quotes an article instead, it says so.
What formats, and will there be updates?
The playbook is a PDF. There is no HTML or EPUB edition. Every correction and every later 1.x version is free to you. The Code Lab is supported by its documentation and its tests; there is no helpdesk.



Start With the Question



