Deep Agents Architecture: Planning, Sub-Agents, and File-System Memory for Long-Horizon Tasks


A production-grade reference for building AI agents on AWS Bedrock with a NestJS gateway in 2026 — Bedrock AgentCore, action groups backed by Lambda, knowledge bases over S3 + OpenSearch, the routing-and-guardrail layer that NestJS must own, the model-selection cost arithmetic, three-layer observability (gateway + agent-internal + per-token cost), Bedrock Guardrails plus app-specific PII redaction, multi-agent collaboration patterns, and the failure modes you only learn about by running this in production.
AI system design interviews in 2026 are not the system design interviews of 2020. The senior bar now includes designing a multi-tenant LLM gateway, a real-time recommendation engine with two-tower retrieval and a learned-to-rank reranker, an image moderation pipeline grounded in policy, and a fraud detection system fusing streaming features with an online graph model. This guide walks through 15 of the most commonly asked AI system design questions — RAG, LLM gateway, recommendation, image generation, LLM search, inference platform, fraud, code review AI, voice assistant, evaluation platform, multi-agent orchestration, vector database, content moderation, MLOps, AI tutor — each with clarifying questions, capacity estimation, an architecture diagram, and the trade-offs interviewers listen for.
The agent demos that survive contact with production all treat memory as an architecture, not as a context window. This is the three-tier pattern — episodic, semantic, procedural — that separates the lifecycles, read paths, write paths, and failure modes the naive single-store approach conflates. Read paths, write paths, the consolidation pipeline that earns the architecture, where each tier physically lives, eight anti-patterns to retire, the 5-stage maturity ladder, and a portable design that lands cleanly on LangGraph, AutoGen, the OpenAI Agents SDK, the Anthropic Claude Agent SDK, and the Microsoft Agent Framework.
An LLM is a poor recommender but a great reranking layer. The hybrid architecture: retrieval narrows millions of items, the LLM reasons over a shortlist.
Advertise and partner
Reach engineering leaders and CTOs reading about AI, mobile and cloud architecture.
Sponsored mentions and co-authored articles or technical deep-dives. Relevant products only, always disclosed.