AI原生单智能体架构
单智能体AI架构,其中一个智能体处理所有事务:解析请求、推理、通过MCP调用工具、生成响应。这是原型和简单自动化的默认架构——易于调试,但很快达到上下文窗口限制且难以并行化。适合快速交付的MVP和独立开发者。
Claw Code harness 架构图,展示用户循环、Python 编排层、Rust 运行时以及 LLM 提供商、文件系统和 MCP 服务器等外部系统。
User { # User
n1: circle label:"Start"
n2: rectangle label:"Enter CLI command"
n3: rectangle label:"View streamed output"
n4: circle label:"Done"
n1.handle(right) -> n2.handle(left)
n2.handle(bottom) -> Python.n5.handle(top) [label="Command"]
n3.handle(right) -> n4.handle(left)
}
Python { # Python Orchestration
n5: rectangle label:"Load session context"
n6: rectangle label:"Build prompt"
n7: rectangle label:"Call model"
n8: diamond label:"Tool needed?"
n9: rectangle label:"Route tool call"
n10: rectangle label:"Update memory"
n11: rectangle label:"Finalize response"
n5.handle(right) -> n6.handle(left)
n6.handle(right) -> n7.handle(left)
n7.handle(bottom) -> External.n15.handle(top) [label="LLM request"]
n8.handle(bottom) -> n9.handle(top) [label="Yes"]
n8.handle(right) -> n11.handle(left) [label="No"]
n9.handle(bottom) -> Rust.n12.handle(top) [label="Tool call"]
n10.handle(right) -> n11.handle(left)
n11.handle(top) -> User.n3.handle(bottom) [label="Answer"]
}
Rust { # Rust Runtime
n12: diamond label:"Permission granted?"
n13: rectangle label:"Execute tool in sandbox"
n14: rectangle label:"Stream tool events"
n12.handle(right) -> n13.handle(left) [label="Yes"]
n12.handle(top) -> Python.n11.handle(bottom) [label="Denied"]
n13.handle(bottom) -> External.n16.handle(top) [label="File access"]
n13.handle(right) -> n14.handle(left)
n13.handle(top) -> External.n17.handle(bottom) [label="MCP call"]
n14.handle(top) -> Python.n10.handle(bottom) [label="Observations"]
n14.handle(left) -> User.n3.handle(right) [label="Stream"]
}
External { # External Systems
n15: rectangle label:"LLM provider"
n16: rectangle label:"File system"
n17: rectangle label:"MCP server"
n15.handle(left) -> Python.n8.handle(right) [label="Plan"]
n16.handle(left) -> Rust.n14.handle(right) [label="File data"]
n17.handle(left) -> Rust.n14.handle(bottom) [label="Tool data"]
}
单智能体AI架构,其中一个智能体处理所有事务:解析请求、推理、通过MCP调用工具、生成响应。这是原型和简单自动化的默认架构——易于调试,但很快达到上下文窗口限制且难以并行化。适合快速交付的MVP和独立开发者。
微服务 API 网关架构图,展示请求路由、JWT 身份验证、速率限制、服务发现以及跨分布式后端服务的响应聚合。该模板模拟微服务生态系统中所有客户端流量的入口点,在请求到达内部服务之前执行安全策略。适合设计具有集中式横切关注点的可扩展 API 基础设施的平台工程师。