docs: 建立 Agent 三层选型的需求审计与验证基线#93
Draft
JoshuaZ16 wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景与纠偏
本 PR 用于建立主持编排 Agent 的三层技术选型基线,目前不在三个候选中做出最终决定。
Issue #86 中“先用普通 Python、后续再考虑 LangGraph”是 2026-07-20 上午基于两方案实验形成的阶段性路线。前一版 PR 错误地把它提升成了最终决定;本次已撤回该结论。加入供应商 Agent Runtime 候选后,现有普通 Python / LangGraph 双方案实验不足以支撑三选一。
当前代码需求审计
以仓库当前主持主链为证据:
IntentModelPort.generate()固定调用一次;ActionExecutor.execute()恰好一次;NarrationModelPort.generate()固定调用一次;tool_calls、ToolMessage 回填或工具循环;因此当前已实现代码中:
ActionExecutor.execute()是确定性应用端口调用,不是模型自主选择的 tool call。“玩家动作可以概念化为工具”适合指导接口设计,但不能替代对运行时工具需求的审计。
已知后续方向包含网络搜索,但其调用形态还没有定义:应用固定搜索不构成模型工具循环;模型自主决定是否搜索才是工具调用;search → fetch → refine/cite 才可能形成多轮工具调用。这部分必须先形成验收用例,再参与三方案权重判断。
三个候选层次
选择依据不是“能否流式输出”,而是项目确认需要:
已有实验能证明什么
现有两个独立、业务无关项目已经证明:
TextDelta、ToolCall、ToolResult、Completed等结构化事件;这些数据不能证明当前项目应继续普通 Python、改用 LangGraph,或供应商 Runtime 是否更合适,因为第三个方案尚未在同条件下实现和测量。
本次修改
proposal / 决策未定;不变的架构边界
ActionExecutor.execute()仍是唯一权威命令边界;验证
git diff --check通过;tests.test_architecture:9/9 通过;plain-python-tool-agent:3/3 通过;langgraph-tool-agent:1/1 通过。关联 #86;本 PR 保持 Draft,合并前还需确认近期工具需求并补齐供应商 Runtime 的同条件实验。