基础设施Infrastructure · 单元Unit 01
先搭骨架:一张图看懂 AgentScopeBuild the skeleton: see AgentScope as one map
先建立 15 个功能域的坐标系,再往里填 API。学完本单元,你能判断一个问题属于哪一层,以及下一步该看哪个模块。Build a coordinate system of 15 functional domains before memorizing APIs. After this unit you can locate any problem in the right layer and know which module to open next.
学习目标Learning goals
- 说出 AgentScope 从消息到模型、工具、状态、运行时的主链路Describe the main path from message to model, tools, state and runtime
- 把任一公开类型归入一个功能域Assign any public type to a functional domain
- 区分 Python 与 Java 两套实现的对应关系Map Python and Java implementations to each other
概念闪卡Concept cards
点击卡片翻面查看解释。Click a card to flip it and reveal the explanation.
关键 APIKey APIs
点击进入对应的 Python 或 Java 参考页。Open the exact Python or Java reference for each type.
AgentPython 智能体主类Python agent entry pointReActAgentJava 智能体主类Java agent entry pointMsg统一消息契约Unified message contractHookJava 生命周期扩展点Java lifecycle extension point问题巩固Check yourself
完成 10 道题;答错会自动进入错题本。Answer all ten questions. Wrong answers are added to your wrong-answer book automatically.
01ReAct 推理循环由哪个功能域负责?Which functional domain owns the ReAct reasoning loop?
解析Why Agent 运行时负责推理、工具调用和会话执行;消息域只定义数据契约。The agent runtime drives reasoning, tool calls and conversation execution; the message domain only defines the data contract.
02把远端 MCP 工具接入本地 Toolkit,属于哪个功能域?Bringing remote MCP tools into the local toolkit belongs to which domain?
解析Why MCP 域负责连接生命周期、传输方式与工具暴露;执行仍由工具域完成。The MCP domain manages connections, transports and tool exposure; execution still belongs to the tool domain.
03框架内唯一的结构化消息契约是什么?What is the single structured message contract in the framework?
解析Why Msg 承载文本、思考、工具调用、工具结果和多模态数据块,其他协议都要先转换到 Msg。Msg carries text, thinking, tool calls, tool results and multimodal data blocks; other protocols must convert into Msg first.
04Java 版的核心构件名是什么?What is the core Java artifact called?
解析Why agentscope-core 提供 Agent、模型、消息、工具、状态等核心类型;其他构件都是扩展。agentscope-core provides agents, models, messages, tools and state; every other artifact is an extension.
05Python 安装包的名称是什么?What is the Python package name?
解析Why Python 包名就是 agentscope,公开模块包括 agentscope.agent、agentscope.model、agentscope.tool 等。The Python distribution is named agentscope, with public modules such as agentscope.agent, agentscope.model and agentscope.tool.
06权限规则与决策引擎位于哪个 Python 模块?Which Python module contains the permission engine?
解析Why PermissionEngine、PermissionRule 和 PermissionMode 都在 agentscope.permission 中,工具执行前会经过它。PermissionEngine, PermissionRule and PermissionMode live in agentscope.permission and run before tool execution.
07流式增量、工具调用与生命周期事件定义在哪个模块?Which module defines streaming deltas, tool-call and lifecycle events?
解析Why agentscope.event 定义 EventBase 及 TextBlockDeltaEvent、ToolCallStartEvent、ReplyEndEvent 等事件。agentscope.event defines EventBase plus TextBlockDeltaEvent, ToolCallStartEvent, ReplyEndEvent and friends.
08Java 版直接实现 ReAct 循环的核心类是什么?Which Java class directly implements the ReAct loop?
解析Why ReActAgent 是可直接使用的智能体实现;AgentBase 提供生命周期骨架,RuntimeContext 承载调用上下文。ReActAgent is the ready-to-use agent implementation; AgentBase provides the lifecycle skeleton and RuntimeContext carries call context.
09下列哪一项不是本手册划分的功能域?Which of the following is NOT a functional domain in this manual?
解析Why 数据库属于具体存储实现,被记忆、状态、会话等域使用,本身不是独立功能域。Databases are concrete storage implementations used by memory, state and session domains, not a domain of their own.
10API 全景页面的主要用途是什么?What is the full API map mainly for?
解析Why API 全景覆盖两套运行时的全部公开类型,适合已知目标、需要精确跳转时使用。The full API map covers every public type in both runtimes and is best when you know the target and need an exact jump.
接着看的生产事故Production incidents to read next
—