多智能体系统上生产的五大挑战与解法
做法与步骤
- 挑战一:控制多智能体执行流。用 Strands Agents SDK 的 Graph 模式定义智能体间执行顺序,实现人工介入分支;用 Agents as Tools 模式让 Supervisor 按需调用 Coder、Validator、Reporter、Tracker 等专用智能体。
- 挑战二:为每个智能体选对 LLM。通过 Amazon Bedrock 按角色选 Claude 模型:Haiku 做基础路由,Opus 做规划,Sonnet 做执行。
- 挑战三:可靠运维生产智能体。用 Amazon Bedrock AgentCore 托管运行时,提供监控、会话隔离和私有 VPC 部署。
- 挑战四:缓解 AI 生成代码执行的安全问题。用 AWS Fargate + ALB 为每个会话提供临时沙箱容器,通过自定义 Code Interpreter 隔离执行代码。
- 挑战五:监控与管理。用 DynamoDB + SNS + Cognito 构建管理仪表盘和故障告警系统。
- Deep Insight 开源并提供三种部署:自托管 CLI 版适合开发迭代,Web 版支持非开发者上传数据与人工审核计划,AgentCore 托管版用于生产,三者共享同一多智能体架构。
对实践的启示
做多智能体应用时,别只调提示词;要显式设计执行流、按角色选模型、隔离代码执行环境,并提前规划监控与告警。可参考 Deep Insight 的开源实现和分层技术栈。
原文摘引
Instructions alone aren’t enough. You need to design how the agent thinks, when it verifies, and what it does when things go wrong.
Building a multi-agent system is now pretty straightforward. Taking it to production is where the real challenges begin.
This is exactly why it’s become critical to go beyond prompt engineering alone and design the agent’s entire cognitive architecture and execution flow.
▸ 展开原文全文(37 段,抓取自 AWS)
Artificial Intelligence
5 production challenges in multi-agent systems and how Deep Insight solved them
Building a multi-agent system is now pretty straightforward. Taking it to production is where the real challenges begin. Thanks to open source frameworks and cloud services, you can set up an agent in a matter of days. A few tool calls, a few lines of prompt, and you have something that looks impressive. But the moment teams try to move beyond a pilot and into real business applications, they hit a familiar wall. If you’ve ever tried to put an agent into production, these frustrations will sound familiar:
Why doesn’t the agent follow our business logic, skip validation steps, or catch edge cases?
You tweak the prompt, add more examples, swap out the model. The same problems keep coming back. That’s because agents don’t follow a fixed sequence of instructions. They make their own judgments based on context. Instructions alone aren’t enough. You need to design how the agent thinks, when it verifies, and what it does when things go wrong. This is exactly why it’s become critical to go beyond prompt engineering alone and design the agent’s entire cognitive architecture and execution flow.
To tackle these challenges head-on, the AWS Solutions Architecture team built Deep Insight, a production-grade multi-agent system. In this post series, we share what the team learned firsthand while building Deep Insight across three posts. We will walk through how we applied Context Engineering techniques proposed by Anthropic (multi-agent architecture, structured note-taking, human-in-the-loop, and more) in a real production environment. We also cover the trade-offs we encountered along the way (with code) and the operational insights we gained from deploying and running this agent on AWS.
Blog series overview
- Part 1: 5 production challenges in multi-agent systems and how Deep Insight solved them.
- Part 2: Beyond the context window: Context Engineering techniques and how Deep Insight applied them.
- Part 3: Harness engineering in practice: moving Deep Insight from dev to production.
This is Part 1 of a three-part series. It defines the five core challenges any production multi-agent system must solve and shows how each layer of the stack addresses them, from Strands Agents SDK and Amazon Bedrock to Amazon Bedrock AgentCore, Application Load Balancer, and AWS Fargate. Parts 2 and 3 cover Context Engineering and production deployment.
Introducing Deep Insight
Deep Insight is a multi-agent system that turns complex data analysis into automated insights. Given a CSV file and a natural-language prompt, a hierarchy of specialized agents (Coordinator, Planner, Supervisor, Coder, Validator, Reporter, and Tracker) collaborates on the analysis. Together they load the data, run analyses, generate charts, validate calculations, and produce a professional report (.docx) with citations.
We will explore the architecture in detail later. First, let’s see it in action. For the demo, we feed advertising data from a fictional food company, Yummy Food (yummy-food-market.csv) with a column definitions file (column_definitions.json), and provide the prompt: Analyze this from a sales and marketing perspective, generate charts and insights, and produce a .docx report. Deep Insight generates an analysis plan, presents it to the user for approval, and, once approved, executes the analysis.
| | Content |
| Input | CSV data file ( yummy-food-market.csv ) + Column definitions file (column_definitions.json ) |
| Example prompt | “Analyze this from a sales and marketing perspective, generate charts and insights, and produce a .docx report.” |
| Output | DOCX report (two versions, one with citations and one without) plus chart graphics (PNG) |
The Deep Insight web demo video that follows shows the full workflow, from uploading data and reviewing the analysis plan to real-time streaming and downloading the finished report.
How can I try it?
Deep Insight is open sourced on GitHub with a full setup guide, and offers three deployment options spanning development to production.
The first is the Self-Hosted version, which runs locally through the CLI. It’s optimized for rapid iteration with full code-level access to every agent, prompt, and workflow. It sets up in about 10 minutes, which makes it well suited to development. (A Self-Hosted demo video is available on YouTube.)
The second is the Web version, a browser-based UI for uploading data, reviewing analysis plans (Human-in-the-Loop, or HITL), and downloading reports, all without writing code, making it accessible for non-developers. (The preceding demo video shows the Web version in action.)
The third is the Managed AgentCore version, a production deployment option powered by Amazon Bedrock AgentCore, a platform to build, connect, and optimize agents at scale, with any framework or model. This version deploys the agents on AgentCore runtime, a capability of Amazon Bedrock AgentCore. The system runs entirely within a private virtual private cloud (VPC), with a custom Code Interpreter hosted separately on AWS Fargate, and agents run concurrently in isolated per-user environments. It’s the right choice when you need session isolation and private VPC deployment. Part 3 covers its deployment and operations in detail.
All three share the same multi-agent architecture, so an agent validated in development deploys to production as-is.
Solution overview
Building a production multi-agent system takes more than good prompts. You need the right technology stack and infrastructure to address how agents collaborate, how they reason, how you deploy them, where they safely execute code, and how you monitor operational health. Deep Insight solves problems across these five key areas. Because the agents generate both code and report content, we also cover responsible AI controls for production in Solution detail 2.
| Challenge | Technology | Approach |
| “How do we control execution flow across multiple agents?” | Strands Agents SDK | Use Strands’ Graph pattern to define execution order between agents and implement human-in-the-loop branching. Use Strands’ Agents as Tools pattern so the Supervisor can invoke specialized agents (Coder, Validator, Reporter, Tracker) as tools on demand. |
| “Which large language model (LLM) should each agent use?” | Amazon Bedrock | Select the right Claude model for each role: Haiku for basic routing, Opus for planning, Sonnet for execution. |
| “How do we reliably operate a finished agent in production?” | Amazon Bedrock AgentCore | Managed runtime with monitoring, session isolation, and private VPC deployment. |
| “How do we mitigate the security issues of executing AI-generated code?” | AWS Fargate + Application Load Balancer (ALB) | Per-session ephemeral sandbox containers for isolated code execution through a custom Code Interpreter. |
| “How do we monitor and manage the system?” | Amazon DynamoDB + Amazon Simple Notification Service (Amazon SNS) + Amazon Cognito | Admin dashboard and failure alerting system. |
The following architecture diagram (Figure 1) illustrates this at a glance. The green boxes represent the Strands Agents multi-agent structure, which addresses challenges 1 and 2 from the preceding table. We will cover this in detail in the upcoming Solution detail 1: Multi-agent system design section. The remaining infrastructure components shown in the diagram address challenges 3, 4, and 5, which we will walk through in Solution detail 2: Production deployment and operations.
Solution detail 1: Multi-agent system design
Deep Insight uses a multi-agent architecture in which eight agents collaborate to produce one high-quality deliverable. Each agent works in its own independent context, performs only its specialized tasks, and passes only compressed results onward.
The Coordinator routes user requests, the Planner breaks tasks into discrete steps, the Plan Reviewer collects user f