Architecture case study · Enterprise banking

A RAG system built for trust, not just answers.

My reference architecture for a banking assistant that combines governed retrieval, bounded agents, MCP-enabled tools and transactional controls—while keeping every response grounded, permission-aware and auditable.

00 / PRINCIPLES

Start with boundaries, not a model.

A production RAG system is an information architecture with an LLM inside it. These principles shape every decision below.

01

Classify before executing

Intent and risk decide which data and tools a request may reach.

02

Retrieve with permission

Identity and document ACLs travel with every retrieval query.

03

Generate from evidence

Answers cite approved context or explicitly decline to answer.

04

Evaluate every layer

Retrieval, generation, safety and outcomes are measured separately.

01 / ARCHITECTURE

One control plane. Three execution paths.

Select a journey, then inspect any component. Static knowledge, customer records and write operations remain in distinct trust zones.

Enterprise RAG reference architecture · logical view

Active routeControl pointPlatform service
Knowledge plane

Curates governed enterprise content before it can be retrieved.

Serving plane

Classifies each request, applies policy, then invokes only the permitted path.

Bounded autonomous flowCustomer or human approval required before execution
Selected route

Autonomy modelTarget experience
Agent & tool plane

Lets agents discover and invoke approved capabilities through MCP without turning protocol connectivity into unrestricted authority.

02 / DECISIONS

The choices that make it production-grade.

Good architecture is not a list of services. It is a set of explicit decisions and accepted trade-offs.

01

Hybrid retrieval before generation

Dense vectors capture meaning; BM25 preserves banking terminology and regulated phrases. A reranker improves the final context set.

Trade-off: more latency for materially better precision.

02

Authorization inside retrieval

Entitlements become metadata filters at query time—not a check after sensitive passages are returned.

Trade-off: stricter indexing for enforceable boundaries.

03

APIs for facts, RAG for knowledge

Balances and transactions come from systems of record. The model explains results; it never becomes the source of truth.

Trade-off: more orchestration for correctness.

04

Deterministic workflow for actions

Card blocking uses step-up authentication, an idempotent state machine and transactional confirmation.

Trade-off: less autonomy for predictable execution.

05

MCP is a protocol boundary—not an authorization boundary

MCP standardizes discovery and invocation. A separate gateway still enforces identity propagation, tool scopes, argument validation and server trust.

Trade-off: additional policy infrastructure for portable, governed tools.

06

Agent autonomy follows the risk tier

Agents may plan and retry low-risk retrieval. Protected reads require consent; writes require step-up authentication, deterministic execution or human approval.

Trade-off: bounded flexibility instead of unrestricted autonomy.

03 / EVALUATION

Quality is measured across the chain.

A single “accuracy” score hides where the system failed. RAG, agent, tool, safety, operational and business measures stay separate.

Evaluate the system, not only the answer.

Versioned offline datasets gate releases. Trace-based online evaluation then detects retrieval drift, poor agent decisions, unsafe tool use and experience regressions.

Retrieval quality

Recall@K, MRR, NDCG, context precision and reranker lift.

OFFLINE
Grounded generation

Faithfulness, answer relevance, citation coverage and abstention.

RAGAS
Agent trajectory

Plan quality, route correctness, step efficiency, loop rate and successful stop conditions.

TRACES
Tools & MCP

Tool-selection precision, argument validity, server trust, permission denials and execution success.

CONTRACT
Safety & privacy

PII leakage, prompt injection, confused-deputy tests and authorization violations.

RED TEAM
Service health

P50/P95 latency, cache hits, tokens, tool failures, retries and fallback rate.

ONLINE
Business outcome

Task completion, correct containment, escalation quality and customer effort.

OUTCOME
04 / FRAMEWORK

Architecture translated into orchestration.

A compact, vendor-neutral blueprint for an interview walkthrough.

Governed RAG blueprint

Classification, authorization, retrieval, generation and evaluation remain independently testable.

How I would walk through this in an interview.

  1. Begin with risk boundaries.Why knowledge, data and actions need different paths.
  2. Separate ingestion from serving.Quality, permissions and freshness come before retrieval.
  3. Trace one request end to end.Follow identity, evidence, generation and audit.
  4. Defend the trade-offs.Precision, latency, autonomy and control.
  5. Close with measurement.Connect evaluation to customer and regulatory outcomes.