RAG Orchestration Architecture
This note set starts from a concrete failure pattern — messy user input destroying downstream RAG quality — and follows the control logic that fixes it all the way up to a general request orchestration architecture.
The central idea is:
messy request
-> intention recognition
-> capability selection and governed execution
-> RAG as one capability
The design follows one discipline throughout: place a deterministic boundary at each point where probabilistic behavior causes damage, instead of trying to make the model smarter.
How To Read This Set
- CH00 tells the origin story; read it first to see why the architecture looks the way it does.
- CH01–CH02 are the control path (intention → orchestration); CH03 is the largest capability behind it.
- Use the internal-layer and evaluation chapters as reference depth, not front-to-back reading.
The Control Path
CH00_Preface.mdThe origin story: a real dirty-input RAG problem, and why the fix had to move upstream of retrieval.CH01_Intention-Recognition-Layer.mdThe first deterministic boundary: routing contract, ambiguity handling, and worked cases showing clarify/reject/execute decisions before any expensive work runs.CH02_Request-Orchestration-Layer.mdThe shared runtime for a company-wide agent system: capabilities, tools, and why only the orchestration layer may sequence tool calls.CH02_01_Runtime-Objects.md— the typed objects (interpretations, decisions, records) that make every step replayable and testable.CH02_02_State-Machine-and-Control-Loop.md— request states, retries, budgets, fallback, and event flow through the loop.CH02_03_Confidence-Safety-and-Validation.md— stage-scoped confidence assessment and the execution/validation decision tables.
The RAG Subsystem
CH03_RAG-Layer.mdEntry overview for the knowledge pipeline, plus the named end-to-end reference stack (MinerU → Elasticsearch + Qdrant → BGE reranker → direct LLM API with Instructor/Guardrails helpers).CH03_01_Ingestion-Validation-Layer.mdOffline quality gate: parse / OCR, structure reconstruction, validation, and quarantine so bad documents never reach the index.CH03_02_Enrichment-Chunking-Indexing-Layer.mdTurning validated documents into retrievable units: enrichment with authoritative/inferred separation, structure-aware chunking, lexical plus vector indexing.CH03_03_Retrieval-Layer.mdThe online evidence-finding pipeline: query shaping, permission-aware filtering, hybrid candidate retrieval, fusion and reranking, context assembly.CH03_04_Grounded-Answering-Layer.mdThe final guard: thin grounded generation with citation integrity, five explicit outcomes including abstention, and known failure modes of this layer.
Evaluation
CH04_Testing-and-Evaluation.mdWhat makes the design reviewable rather than aspirational: minimum test matrix, golden-case structure, first-version acceptance thresholds, and regression strategy on top of the CH02_01 runtime objects.
Principles Behind The Design
The worldview is not re-derived here; it lives in standalone articles:
- AI Coding 的防御性进化:平台化、业务解耦与结构的自然生长 Why bounded sandboxes, rigid platform foundations, and late abstraction beat premature DRY when AI writes most of the code.
- 文艺复兴:从 Linux 老派教条看 AI 时代的函数开发 Why small pure modules with strong contracts and explicit boundaries hold up under an AI caller.
- A First-Principles Architecture for Agent Routing and Safety Harnesses The full derivation of model-proposes-harness-executes, orthogonal verification, and risk-proportional authorization.
- Harness Engineering 合集 The six-part series on harnesses as the deterministic runtime around a probabilistic engine — boundary placement, context discipline, comparator design, and governed execution.
How those principles show up in this set:
- intention recognition exists because input quality is the earliest useful control point
- the harness owns permissions and escalation because reasoning should not imply execution authority
- evaluator contracts sit outside generation because correctness needs an external comparator
- context discipline exists because state is costly, degradable, and attention-limited
- layers stay modular so failures remain local and ownership stays clear
- no platform was designed first; orchestration grew out of a concrete RAG fix (the origin story is
CH00_Preface.md) - RAG was split into internal layers only after each layer’s responsibility stabilized
- policy stays central in definition but local in enforcement
One guardrail that follows from this style: a new layer earns its existence only by defining a real responsibility boundary, hiding unstable details, creating a stable contract, or improving reuse and ownership. A wrapper that forwards the same parameters inward without changing responsibility or ownership is ceremony, not modularity.
What This Set Covers And What It Does Not
Covered:
- why bad input harms downstream RAG quality and cost
- why intention recognition should happen before expensive retrieval
- how that control pattern grows into broader request orchestration
- why the harness is the authority boundary for execution
- how RAG fits as one capability inside a governed system
- a named end-to-end reference stack, assembled in
CH03_RAG-Layer.md
Not yet defined:
- calibration of the first-version confidence thresholds against labeled data
- detailed per-domain golden sets for routing, permission, and retrieval
- full production alert thresholds for latency, failure, and escalation drift
Grounded Answering Layer
Wednesday, July 15, 2026 in RAG Orchestration Architecture
Categories:
Purpose The grounded answering layer turns retrieved evidence into a user-facing output that remains tied to sources. Its job is to: answer from retrieved evidence preserve citation and provenance distinguish direct evidence from inference abstain, …
Enrichment Chunking Indexing Layer
Wednesday, July 15, 2026 in RAG Orchestration Architecture
Categories:
Purpose The enrichment, chunking, and indexing layer is the downstream preparation layer that turns validated canonical documents into retrievable knowledge units. Its job is to: add retrieval-useful annotations without changing source truth define …