1. Business & Users
- What exact business outcome are we driving?
- Who is the user? (Internal employee, developer, external customer)
- Autonomy: Advisory (recommends), Decision-Supporting (prepares), or Autonomous (executes writes)?
Opening script (0–2 min)
I’ll structure this system design into three explicit phases: Scope & Discovery: I will define the business problem, user personas, scale math, and data security boundaries. MVP Architecture: I will map out the leanest core loop using a single-agent pattern with human-in-the-loop controls to establish immediate value. Production & Scale: I will scale the design into an enterprise system—detailing multi-agent decomposition, isolated data layers, security guardrails, resilience, observability, and evaluation metrics.
Drive the interview. Cover all five dimensions before drawing boxes.
Defend single-agent first. Split only when a hard boundary is crossed.
Lean MVP: API Gateway → Agent Runtime (Cloud Run) → Gemini plan → tools → grounded response, with HITL on any write that changes real-world state. Session state stays outside the compute layer.
Security / Permission Boundary
Sub-tasks need different IAM levels, tenant isolation, or data residency domains.
Domain Complexity Boundary
System-prompt bloat and tool count (>10 tools) degrade reasoning accuracy.
Latency / Execution Boundary
Independent sub-tasks can run in parallel on specialized smaller models.
Never lump everything into “the database.” Separate by lifecycle and access pattern.
| Layer | Purpose | GCP stack |
|---|---|---|
| Session State | Active interaction state, step logs, short-term turn history | Memorystore (Redis) / Firestore |
| Long-Term Memory | Identity-scoped preferences and cross-session facts | Memory Bank / Firestore |
| Enterprise RAG | Unstructured knowledge — policies, runbooks, protocols | Vertex AI Search / Vertex Vector Search |
| Operational DB | Authoritative transactional SoR — billing, accounts, inventory | Spanner / AlloyDB / Cloud SQL |
Security is a vertical cross-cut — not a bolt-on.
Checkpoint 1 · User Input
Checkpoint 2 · Retrieval
Checkpoint 3 · Tool Execution
Checkpoint 4 · Model Output
Checkpoint 5 · Post-Action
Enterprise failure modes, not just happy-path boxes.
Stateless compute
Agent runtime on Cloud Run or GKE Autopilot — horizontal scale on concurrency/CPU.
Async tool queueing
Cloud Tasks / Pub/Sub for tools >5s so HTTP stays non-blocking.
Circuit breakers
Trip on downstream error/latency; degrade to cached or RAG-only responses with explicit gaps.
Backoff + jitter
All LLM and tool calls retry with exponential backoff to absorb 429s.
Rate limits & quotas
Per-tenant limits via Apigee to protect shared LLM quota.
Semantic cache
Exact/similar query matching via Vector Search to skip LLM for frequent static asks.
Log trajectories, not just inputs and outputs.
Closing summary (min 58–60)
To summarize: We designed an enterprise agentic system that balances speed to market with enterprise compliance. We started with a clean, single-agent MVP on Cloud Run to validate core business metrics. To scale to production, we split responsibilities across specialized sub-agents, isolated our storage into explicit Session, Memory, RAG, and Operational layers, and placed a 5-point security guardrail using Model Armor and Sensitive Data Protection. Finally, we protected system reliability using asynchronous queues and circuit breakers, while maintaining full visibility into the agent's trajectory using Cloud Trace and dual-track evaluation datasets.