Architecture

AI Agent Core Architecture: Planner, Tools, Memory, Loop

Agents are more than LLM + prompt—architecture for planner, tools, memory, and the execution loop, mapped to this blog.

2026-06-04T12:12:57.454Z

AI Agent Core Architecture: Planner, Tools, Memory, Loop

AI Agent 核心架构:Planner、Tools、Memory 与执行循环

Agent 与 Chat 的本质区别

Chat Agent
单轮/多轮文本 多步执行
无工具 可调 API、DB、代码
无状态或仅会话 记忆 + 计划

Agent = LLM 决策 + 工具执行 + 状态机循环

AI Agent 执行循环架构图

四大组件

1. Planner(规划)

把用户目标拆成步骤。可以是:

2. Tools(工具)

每个 tool 需:name、description、parameters schema、handler

粒度原则:小而专,便于模型选择与审计。

3. Memory(记忆)

4. Orchestrator(编排器)

控制循环:何时继续、何时结束、失败重试、最大步数。

Agent 核心组件关系图

本博客 Agent 模块映射

站点 /ai 对应 backend/src/modules/agent

这是 产品型 Agent,比 CLI Agent 多了鉴权、限流、审计。

失败模式与护栏

Python 栈常见选型

小结

画 Agent 架构时,先问:工具有哪些、记忆存哪、循环谁管、失败怎么办。四问清楚,再选框架,避免「只会 chat 的假 Agent」。


参考:本仓库 agent 模块 · Anthropic/OpenAI tool use 文档。

标签