agents-build
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesebuild
功能扩展
Add capabilities to your AgentCore agent project.
为你的AgentCore Agent项目添加功能。
When to use
使用场景
- Adding cross-session memory to your agent
- Calling your deployed agent from a web app, mobile app, or backend service
- Configuring VPC networking for private resources (RDS, internal APIs)
- Building multi-agent systems with orchestrator/specialist patterns
- Migrating an existing Bedrock Agent to AgentCore
- Adding the Browser tool so the agent can navigate websites
- Adding the Code Interpreter so the agent can execute code in a sandbox
- Removing resources from your project or tearing down a deployment
Do NOT use for:
- Connecting to external tools/APIs via Gateway (OpenAPI specs, Lambda, MCP servers, credentials, policies) → use
agents-connect - Scaffolding a new project → use
agents-get-started - Deploying → use
agents-deploy
- 为你的Agent添加跨会话内存
- 从Web应用、移动应用或后端服务调用已部署的Agent
- 为私有资源(RDS、内部API)配置VPC网络
- 基于编排器/专用Agent模式构建多Agent系统
- 将现有Bedrock Agent迁移至AgentCore
- 添加浏览器工具,使Agent能够浏览网站
- 添加代码解释器,使Agent能够在沙箱中执行代码
- 从项目中移除资源或销毁部署
请勿用于以下场景:
- 通过Gateway连接外部工具/API(OpenAPI规范、Lambda、MCP服务器、凭证、策略)→ 请使用
agents-connect - 搭建新项目 → 请使用
agents-get-started - 部署 → 请使用
agents-deploy
Input
输入参数
$ARGUMENTS- A capability: "memory", "integrate", "vpc", "multi-agent", "migrate", "browser", "code-interpreter", "teardown"
- A description of what they want: "remember user preferences", "call from React app", "scrape a website", "run pandas in the agent", "delete my agent", "clean up resources"
- Empty — the skill will determine the workflow from context
$ARGUMENTS- 功能类型:"memory", "integrate", "vpc", "multi-agent", "migrate", "browser", "code-interpreter", "teardown"
- 需求描述:"记住用户偏好"、"从React应用调用"、"爬取网站"、"在Agent中运行pandas"、"删除我的Agent"、"清理资源"
- 空值——该技能会根据上下文确定工作流程
Process
操作流程
Step 0: Verify CLI version
步骤0:验证CLI版本
Run . This skill requires v0.9.0 or later.
agentcore --versionIf older: "Run to get the latest version."
agentcore update运行。该技能需要v0.9.0或更高版本。
agentcore --version如果版本较低:"运行以获取最新版本。"
agentcore updateStep 1: Read project context
步骤1:读取项目上下文
Read to understand the current project — framework, existing resources, agent configuration.
agentcore/agentcore.jsonIf is not found:
agentcore/agentcore.json- Check if the developer is in the wrong directory. Look for in parent directories (up to 3 levels). If found, tell them: "Found an AgentCore project at
agentcore/agentcore.json. Are you working in that project?"<path> - If no project exists anywhere nearby, ask what capability they wanted to add. Then offer two paths:
- "I can walk you through creating a project first and then adding CAPABILITY — want to do that?" (run the get-started flow inline, then continue with the build workflow)
- "If you already have a project elsewhere, into it and try again."
cd
Do not just say "go use agents-get-started" and stop — that loses the developer's context about what they actually wanted to do.
读取以了解当前项目——包括框架、现有资源、Agent配置。
agentcore/agentcore.json如果未找到:
agentcore/agentcore.json- 检查开发者是否处于错误目录。 在父目录中查找(最多3级)。如果找到,告知他们:"在
agentcore/agentcore.json路径下发现一个AgentCore项目。你是否正在该项目中工作?"<path> - 如果附近没有任何项目,询问他们想要添加的功能。然后提供两个选项:
- "我可以先引导你创建一个项目,然后再添加所需功能——是否要这样操作?"(先执行入门流程,然后继续功能扩展工作流程)
- "如果你已经在其他位置有项目,请进入该目录后重试。"
cd
不要只说"去使用agents-get-started"就结束对话——这会丢失开发者的实际需求上下文。
Step 2: Determine the workflow
步骤2:确定工作流程
Important disambiguation — before routing to a build reference, check if the prompt is actually a connect or debug concern:
- If the phrase mentions external APIs, Lambda functions, OpenAPI specs, gateways, credentials, MCP servers, or policies → this is , not build
agents-connect - If the developer says something is broken (wrong answers, errors, tool failures) → this is , not build
agents-debug - Build is for adding new capabilities to a working project, not fixing broken ones
Based on the developer's prompt and , load the appropriate reference:
$ARGUMENTS| Developer intent | Reference to load |
|---|---|
| Add memory, remember things, user preferences, cross-session | |
| Call agent from app, invoke from code, streaming, SDK client, agent URL, execute shell in session | |
| VPC, private network, RDS, internal API, subnet, security group | |
| Multi-agent, orchestrator, specialist, A2A, delegation, agent handoff | |
| Custom headers from caller to agent, header allowlist, tenant ID/correlation ID/trace propagation | |
| Migrate Bedrock Agent, import agent, move to AgentCore | |
| Browser tool, web navigation, form filling, scraping, Nova Act, Playwright, live view | |
| Code Interpreter, execute code, sandbox, run Python/JS/TS, data analysis in agent, pandas | |
| Delete agent, remove resource, tear down, clean up, destroy, start fresh | |
| Change model, switch model, use Haiku/Sonnet/Nova, different model | Inline — see "Changing the model" below |
If the developer asks about the difference between local dev and deployed (e.g., "why does my memory work after deploy but not locally?"), load alongside the specific workflow reference.
references/local-vs-deployed.mdRead the matching file into context and follow its Process section step by step — do not summarize.
If the intent is ambiguous, ask the developer which capability they want to add.
重要歧义消除——在跳转至功能扩展参考文档之前,检查请求是否实际上属于连接或调试问题:
- 如果请求中提及外部API、Lambda函数、OpenAPI规范、网关、凭证、MCP服务器或策略→ 这属于范畴,而非功能扩展
agents-connect - 如果开发者表示某些功能损坏(错误回答、报错、工具故障)→ 这属于范畴,而非功能扩展
agents-debug - 功能扩展是为正常运行的项目添加新功能,而非修复故障
根据开发者的请求和,加载对应的参考文档:
$ARGUMENTS| 开发者意图 | 加载的参考文档 |
|---|---|
| 添加内存、记忆内容、用户偏好、跨会话 | |
| 从应用调用Agent、从代码中调用、流式传输、SDK客户端、Agent URL、在会话中执行shell | |
| VPC、私有网络、RDS、内部API、子网、安全组 | |
| 多Agent、编排器、专用Agent、A2A、任务委派、Agent移交 | |
| 调用方向Agent传递自定义请求头、请求头白名单、租户ID/关联ID/链路追踪 | |
| 迁移Bedrock Agent、导入Agent、迁移至AgentCore | |
| 浏览器工具、网页导航、表单填写、爬取、Nova Act、Playwright、实时视图 | |
| 代码解释器、执行代码、沙箱、运行Python/JS/TS、Agent内数据分析、pandas | |
| 删除Agent、移除资源、销毁部署、清理、重置、重新开始 | |
| 更换模型、切换模型、使用Haiku/Sonnet/Nova、不同模型 | 内联说明——请查看下方"更换模型"部分 |
如果开发者询问本地开发与部署后的差异(例如:"为什么我的内存功能在部署后可用,但本地不可用?"),除了加载对应工作流程的参考文档外,还需加载。
references/local-vs-deployed.md将匹配的文档加载至上下文,并严格按照其流程部分逐步执行——请勿概括。
如果意图不明确,请询问开发者想要添加的功能类型。
Changing the model
更换模型
The model is configured in (scaffolded by ). To change it:
app/<AgentName>/model/load.pyagentcore create- Open
app/<AgentName>/model/load.py - Change the parameter in the
model_idconstructorBedrockModel()
python
undefined模型配置在文件中(由命令生成)。更换模型步骤如下:
app/<AgentName>/model/load.pyagentcore create- 打开
app/<AgentName>/model/load.py - 修改构造函数中的
BedrockModel()参数model_id
python
undefinedDefault (scaffolded by CLI)
Default (scaffolded by CLI)
return BedrockModel(model_id="global.anthropic.claude-sonnet-4-5-20250929-v1:0")
return BedrockModel(model_id="global.anthropic.claude-sonnet-4-5-20250929-v1:0")
Switch to Haiku for cost savings
Switch to Haiku for cost savings
return BedrockModel(model_id="us.anthropic.claude-3-5-haiku-20241022-v1:0")
return BedrockModel(model_id="us.anthropic.claude-3-5-haiku-20241022-v1:0")
Switch to Nova Lite
Switch to Nova Lite
return BedrockModel(model_id="amazon.nova-lite-v1:0")
Cross-region inference profile prefixes (`us.`, `eu.`, `apac.`, `global.`) control where inference runs. Use `global.` for maximum throughput, or a geographic prefix for data residency. Not all models support all prefixes — check the Bedrock inference profiles docs.
After changing the model:
- Verify the model is enabled in your region: AWS Console → Amazon Bedrock → Model access
- For cross-region profiles, enable in all destination regions
- If using `agents-harden`, update the IAM policy to scope to the new model ARN
- Run `agentcore dev` to test locally, then `agentcore deploy` to update the deployed agent
No `agentcore.json` change is needed — the model is configured in code, not in the project config.return BedrockModel(model_id="amazon.nova-lite-v1:0")
跨区域推理配置前缀(`us.`, `eu.`, `apac.`, `global.`)用于控制推理运行的位置。使用`global.`可获得最大吞吐量,使用地理前缀可满足数据驻留要求。并非所有模型都支持所有前缀——请查阅Bedrock推理配置文档。
更换模型后:
- 验证该模型在你的区域已启用:AWS控制台 → Amazon Bedrock → 模型访问权限
- 对于跨区域配置,请在所有目标区域启用该模型
- 如果使用`agents-harden`,请更新IAM策略以适配新模型的ARN
- 运行`agentcore dev`进行本地测试,然后运行`agentcore deploy`更新已部署的Agent
无需修改`agentcore.json`——模型配置在代码中,而非项目配置文件。Pre-flight: validate any --name
before generating the CLI command
--name预检查:生成CLI命令前验证--name
参数
--nameWhichever reference you load, most end up producing an command. The CLI fails late on invalid names — you'll see the error after walking through prompts, not before running the command. Validate up front:
agentcore add <resource> --name <something>| Resource | Max chars | Allowed | Starts with |
|---|---|---|---|
Agent ( | 48 | alphanumeric + | letter |
| Memory, gateway, gateway-target, credential, evaluator, online-eval, policy, policy-engine | 48 | alphanumeric + | letter |
Count the characters before constructing the command. If the name is over the limit or contains hyphens, dots, or spaces, push back: " is N characters / uses , which the CLI rejects. How about ?" Never run the command with an invalid name hoping the CLI message will be clear.
<name>-<suggestion>Note: (the project name) has a stricter 23-char limit and does not allow underscores. That's covered in ; if you see the developer re-running create, flag the 23-char limit specifically.
agentcore create --nameagents-get-started无论加载哪个参考文档,大多数场景最终都会生成命令。CLI会在后续步骤才报错(而非运行命令前),因此需要提前验证:
agentcore add <resource> --name <something>| 资源类型 | 最大字符数 | 允许字符 | 起始要求 |
|---|---|---|---|
Agent( | 48 | 字母数字 + | 字母 |
| Memory、gateway、gateway-target、credential、evaluator、online-eval、policy、policy-engine | 48 | 字母数字 + | 字母 |
在构造命令前计算字符数。如果名称超过限制或包含连字符、点号或空格,请提示:"包含N个字符/使用了,CLI会拒绝该名称。改用怎么样?" 切勿使用无效名称运行命令,寄希望于CLI给出清晰的错误提示。
<name>-<suggestion>注意:(项目名称)有更严格的23字符限制,且不允许使用下划线。这部分内容在中说明;如果发现开发者重新运行create命令,请特别提醒23字符限制。
agentcore create --nameagents-get-startedOutput
输出结果
Depends on the workflow — see the loaded reference for specific outputs.
输出结果取决于工作流程——请查看加载的参考文档获取具体输出。
Quality criteria
质量标准
- The correct reference was loaded based on the developer's intent
- All output follows the loaded reference's quality criteria
- Cross-references to other skills (agents-connect, agents-deploy) are included where relevant
- 根据开发者的意图加载了正确的参考文档
- 所有输出符合加载的参考文档的质量标准
- 在相关场景中包含了对其他技能(agents-connect、agents-deploy)的交叉引用