Skip to main content

Book 4 · The AI Solutions Architect · 7 min read

The RAGAS 4-Book Arc and Obligation-First Architecture

Faithfulness 0.71 to 0.91 across four books. Context Precision 0.82 to 0.93. The RAGAS trajectory tracked retrieval quality — it did not measure whether the Cologne customer's deletion was processed in 72 hours, whether Sanjaya's audit report satisfied the regulator, or whether Vastralaya's p99 held at 115ms during the Diwali spike. Both mattered. They measured different properties of the same system.

The RAGAS 4-Book Arc and Obligation-First Architecture

The dashboard loaded in four seconds.

It was a Tuesday morning in March, four months after the Diwali sale. Arjun had opened the monitoring dashboard the way he opened it every morning. He had been expecting four seconds because the last seven Tuesdays had been four seconds. The expectation had not yet become a habit, because the memory of forty-one seconds was still recent enough to be the comparison.

He poured chai and did not set it down before he drank it.

The Valid Failure: A System That Was Working for Reasons No Longer Explainable

At the start of Book 4 Chapter 1, the system had been a successful architecture for one tenant that was carrying six without the structural capacity to account for them. It had been running correctly — by most measures — and it had been running on luck.

The luck had been quantified:

  • A 0.02 cross-encoder margin between the right tenant's answer and the wrong tenant's, held across six tenants and three months through the particular distribution of recently-upserted chunks on any given Tuesday
  • A GDPR deletion answered by hand in four hours, confirmed with a written note that was not fully certain of completeness
  • A 41-second dashboard load that was queue depth arithmetic, not a bug, from six tenants' embeddings in one shared index

None of these were errors. The system had no errors. The system had luck — and the specific discomfort of a builder sitting in front of something that is working correctly for reasons that are no longer entirely his to explain.

The Valid Source: The RAGAS Trajectory Across Four Books

The RAGAS scores tracked one dimension of what had happened across the series — retrieval quality and grounding fidelity. They were honest about what they measured and what they did not.

Book Technique Faithfulness Context Precision
Book 1 Dense retrieval (ChromaDB) 0.71 0.82
Book 2 Hybrid search + rerank 0.79 0.85
Book 2 Full RAGAS (all four dimensions) 0.84 0.89
Book 3 CRAG 0.88 0.87
Book 3 Fine-tuned bge-small INT8 0.88 0.91
Book 4 Per-tenant isolation (zUdyog) 0.88 0.93
Book 4 Per-tenant model (Jaipur) 0.88 0.92
Book 4 Multimodal image queries (Vastralaya) 0.91 0.88
Book 4 Under 40× load (national retailer) 0.88 0.91

From Faithfulness 0.71 to 0.91. From Context Precision 0.82 to 0.93 (for the baseline tenant). The trajectory was real: a dense retriever that hallucinated lining specifications became a fleet of per-tenant systems that retrieved correctly under load, for six different catalogs, in two modalities.

What RAGAS did not measure:

  • Whether the Cologne customer's data had been deleted within seventy-two hours
  • Whether Sanjaya's audit report had contained every field the whiteboard line specified
  • Whether Vastralaya's p99 had held at 115ms during the Diwali spike
  • Whether the compliance inquiry from the financial regulator had been answered in forty minutes with a signed JSON export

Those were real outcomes. They were unmeasured by RAGAS — not because they did not matter but because they were a different kind of correctness. The scores tracked whether the system was honest in the moment of answering. The compliance architecture tracked whether the system was accountable after the moment had passed.

The Valid Knowledge: What Obligation-First Architecture Means

By Chapter 7 the luck had become architecture. The margin was not 0.02 points of hope across six tenants in one collection. It was a topology — six collections, six KMS keys, a query path that had no route between them. The GDPR deletion was not a developer with a terminal and a list assembled in real time. It was a pipeline that knew where the data was because the data had been written with that question in mind from the start.

The ordering was the thing.

Each solution in Books 1 through 3 had begun with a measurement — a RAGAS score, a query log, a latency number — and moved toward a technique. The architecture had been built capability-first: what does this technique make possible? HyDE made vague query retrieval possible. CRAG made evidence grading possible. INT8 ONNX made cost-zero embeddings possible.

The five whiteboard lines of Book 4 moved in the opposite direction. They began with what the system owed before arriving at what to build.

Cross-tenant isolation — not an optimisation but a promise to one tenant that its data does not leak to another. The collection topology was the engineering answer to the legal obligation.

GDPR deletion — not a compliance checkbox but a commitment that the system can find and remove everything it holds about a customer and produce a timestamped receipt. The SHA-256 hash and the five-store pipeline were the engineering answers to the regulatory obligation.

Per-tenant models — not a performance improvement but an acknowledgement that different tenants have different catalogs. The LRU ModelCache with the MODEL_REGISTRY was the engineering answer to the epistemic obligation.

Multimodal retrieval — not a feature addition but a recognition that the modality Vastralaya's customers use is not the modality the architecture assumed. The CLIP dual-encoder and modality router were the engineering answers to the obligation to receive what the customer actually sent.

Audit trail — not a monitoring tool but the system's ability to stand behind its own answers after the moment of answering has passed. The DynamoDB table with three GSIs and an IAM Deny policy was the engineering answer to the accountability obligation.

The system had been built to answer customers. It had not been built to answer for itself. By Chapter 8, both were true.

The whiteboard photograph — taken by Draupadi at the moment of the Bengaluru meeting, before anyone stood up — was still on her phone four months later. She had shown it once, during a call with a prospective new tenant, to explain what the system had been built to address before explaining what it had been built to do.

Krishna described it to Arjun in one sentence: "She used the whiteboard to sell the architecture."

The five lines, photographed and never erased, had changed meaning without changing words. In Chapter 1 they were five problems. By Chapter 7 they were five guarantees — five things the system now demonstrably did, under real conditions, with real tenants.

Sanjaya's line had not changed in meaning at all. It had been a requirement from the moment he wrote it: AUDIT TRAIL: WHO READ WHAT. WHICH MODEL. WHICH PATH. WHICH TENANT. IMMUTABLE. When the compliance inquiry arrived, Sanjaya ran the audit report query himself. He sent the output to the regulator. His notebook had one entry for the event — the time, the request ID, the time of the regulator's acknowledgement — and then nothing further, because nothing further had been needed.

The Pramana Framework, across four books, had been built toward one definition:

A system that knows not just its catalog and its query distribution, but the name of the tenant it serves, the regulation it operates under, the record it must keep, and the answer it must give when the regulator asks what happened and why.

In Book 1 it had been an honest retriever for one tenant. In Book 2 it had learned to reach more precisely. In Book 3 it had learned to route differently depending on the shape of the question. In Book 4 it had learned to be six different systems simultaneously — each one isolated, each one compliant, each one auditable, each one serving the modalities its customers actually used.

What the fleet had become was not a feature list. It was a set of answers to questions the system had not been asked in Book 1 and could not have answered if it had been.


This article covers concepts from Book 4, Chapter 8 of the RAG Mastery Series. The series builds ShopBot — a production RAG system — across four books, from first embeddings to a fleet of six isolated, compliant, auditable tenants.

This is the concept. The book is the system.

Book 4: The AI Solutions Architect

Articles give you understanding. The book gives you a working system — full production code, RAGAS evaluation scores, and the patterns that hold up at 11 PM when something breaks.