MADR format · break-even math · revisit triggers
Architecture Decision Records
Every infrastructure, privacy, model-routing and agent-interoperability decision — with the numbers that justify it and the signal that would reverse it.
- ADR-001
Cloud Run v2 (`min_instances=0`) over GKE Autopilot/Standard
Enterprise AI agent orchestrators, RAG retrieval APIs, MCP tool servers, and asynchronous contract-extraction workers are I/O-bound, stateless, and bursty (spending 85%–95% of wall-clock request time awaiting Vertex AI, Document AI, Cloud DLP, or database responses). Teams frequently default to Kubernetes (GKE Standard or Autopilot) out of organizational habit, incurring permanent cluster management fees, node idle overhead, and platform engineering burden.
AcceptedBlueprint 01 (Support Automation), Blueprint 02 (Contract Processing Jobs), Blueprint 03 (SQL Analytics Agent & MCP Server)
- ADR-002
Cloud Firestore Vector Search over Vertex AI Vector Search Index Endpoints
Blueprint 01 requires a multi-tenant Knowledge Base (KB) capable of semantic retrieval over 768-dimensional `text-embedding-005` vectors combined with strict pre-filtered metadata predicates (`tenant_id == X`, `product_tier == Y`, `doc_status == "published"`). Many teams instinctively provision Vertex AI Vector Search (Matching Engine) Index Endpoints or third-party managed vector databases (Pinecone/Qdrant), unaware that Vertex AI Vector Search requires dedicated 24/7 deployed index nodes costing $150–$220+/month even at zero queries.
AcceptedBlueprint 01 (Technical Support Automation Hybrid RAG)
- ADR-003
Per-Node Model Routing — Gemini 3.8 Flash vs Gemini Pro
Routing 100% of enterprise AI traffic to a frontier reasoning model (Gemini Pro) destroys unit economics and inflates P95 latency, whereas routing 100% of traffic to a fast distilled model (Gemini 3.8 Flash) degrades accuracy on legally dense contract clauses (indemnification, limitation of liability) and complex multi-CTE SQL window functions.
AcceptedBlueprint 01 (Support), Blueprint 02 (Contracts), Blueprint 03 (SQL Analytics)
- ADR-004
Cloud DLP Sensitive Data Anonymization Before Vertex AI Inference
Enterprise support tickets (BP01), M&A/commercial contracts (BP02), and free-text SQL comment columns (BP03) routinely contain regulated PII and financial identifiers (`CREDIT_CARD_NUMBER`, `US_SOCIAL_SECURITY_NUMBER`, `IBAN_CODE`, `EMAIL_ADDRESS`, `PHONE_NUMBER`, `PERSON_NAME`, `IP_ADDRESS`). Sending raw unredacted data directly to LLM prompts or observability logs violates GDPR data minimization, PCI-DSS scope reduction, and enterprise SOC 2 policies.
AcceptedBlueprint 01 (Support), Blueprint 02 (Contracts), Blueprint 03 (SQL Analytics)
- ADR-005
Zero-Trust Private IAM OIDC, Vercel BFF Pattern & VPC-SC Isolation
Exposing AI agent APIs, RAG retrievers, or MCP SQL servers as public `--allow-unauthenticated` Cloud Run endpoints with static API keys creates severe risks: credential leakage in client bundles, lateral movement across microservices, and data exfiltration from Cloud Storage, Firestore, or BigQuery. At the same time, modern enterprise web portals (often hosted on Vercel or Cloud Run) need a clean, low-latency way to authenticate to private GCP backends without embedding long-lived Service Account JSON keys.
AcceptedBlueprint 01 (Support), Blueprint 02 (Contracts), Blueprint 03 (SQL Analytics)
- ADR-006
Standardizing Tool Access via MCP and Agent Delegation via A2A
As enterprises deploy multiple specialized AI agents (Technical Support in BP01, Contract Risk in BP02, SQL Analytics in BP03), hardcoding database clients, Zendesk/Jira REST wrappers, and inter-agent HTTP glue directly inside each agent's prompt loop creates N × M integration sprawl, duplicated security logic (SQL AST validation, DLP scrubbing, rate limiting), and tight coupling to a single LLM framework.
AcceptedBlueprint 03 (Production MCP Read-Only SQL Server) & Optional Extension Pattern for Blueprint 01 (Cross-Agent A2A Delegation & Ticketing MCP)