eino
eino copied to clipboard
feat(adk): impl deepagents
What type of PR is this?
feat(adk): deepagents prebuilt agent with planning, storage, and long-term memory
Check the PR title.
- [x] This PR title match the format:
(optional scope): - [x] The description of this PR title is user-oriented and clear enough for others to understand.
- [x] Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo
(Optional) Translate the PR title into Chinese.
feat(adk): 实现 DeepAgents 预置代理,提供规划、存储与长期记忆能力
(Optional) More detailed description for this PR (en / zh).
en: This PR introduces a new prebuilt ADK agent named "DeepAgents" that provides:
- Planning & task decomposition via
write_todos(session-scoped plan using planexecute.Plan) - Storage management tools:
ls,read_file,write_file,edit_file(backed by abstractStorageinterface for pluggable backends) - Sub-agent creation via
tasktool (compose a specialized child agent with custom instruction) - Long-term memory tools when
MemoryStoreis provided:remember,recall,update_memory,forget,list_memories(checkpoint-persisted, implementation expected in eino-ext)
Design highlights:
- Agent constructor
deepagents.New(ctx, *Config)wires model, storage, optional memory store and extra tools. - Clear separation between working memory (Session) and long-term memory (MemoryStore).
- Extensible via
ToolsConfigto add user-defined tools. - Secure & predictable tool parameter schemas using
schema.ToolInfo; JSON parsing viasonic.
Usage:
- Provide
model.ToolCallingChatModel,Storageimplementation (eino-ext), and optionalMemoryStore. - Call
deepagents.Newto obtain anadk.Agent, usable standalone or in compose.StateGraph.
zh: 本 PR 新增预置 ADK 代理 “DeepAgents”,能力包括:
- 规划与任务拆解:
write_todos(基于 Session 的 planexecute.Plan) - 存储管理:
ls、read_file、write_file、edit_file(抽象Storage接口,便于接入文件系统/内存/S3 等) - 子代理创建:
task工具(基于给定指令与模型创建子代理) - 长期记忆(可选):在提供
MemoryStore时启用remember、recall、update_memory、forget、list_memories(基于 CheckPoint 持久化,具体实现建议在 eino-ext)
设计要点:
- 构造函数
deepagents.New(ctx, *Config)统一注入模型、存储、(可选)记忆库与自定义工具。 - 明确区分工作记忆(Session)与长期记忆(MemoryStore)。
- 通过
ToolsConfig扩展用户自定义工具。 - 使用
schema.ToolInfo定义参数协议,sonic做高性能 JSON 解析。
使用方式:
- 传入
model.ToolCallingChatModel、Storage实现(eino-ext),以及可选的MemoryStore。 - 调用
deepagents.New获得adk.Agent,可独立使用或作为 StateGraph 节点。