deploy-agentcore
将Python代理部署到AWS Bedrock AgentCore。当部署到AWS、设置无服务器代理托管、配置AgentCore组件(运行时、网关、内存、身份、策略)或解决部署错误时使用。
📖 中文导读:将Python代理部署到AWS Bedrock AgentCore。当部署到AWS、设置无服务器代理托管、配置AgentCore组件(运行时、网关、内存、身份、策略)或解决部署错误时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: deploy-agentcore description: Deploy Python agents to AWS Bedrock AgentCore. Use when deploying agents to AWS, setting up serverless agent hosting, configuring AgentCore components (Runtime, Gateway, Memory, Identity, Policy), or troubleshooting deployment errors.
AWS Bedrock AgentCore is a serverless platform for AI agents at scale.Architecture
AgentCore has 6 modular components:
- Runtime - Serverless hosting (direct_code_deploy or container)
- Gateway - Tool access via MCP (Lambda, OpenAPI, Smithy targets)
- Memory - STM (session) and LTM (persistent) storage
- Identity - Auth via IAM, Cognito, AWS JWT, external OAuth
- Observability - CloudWatch + OpenTelemetry tracing
- Policy - Cedar-based governance and authorization
Entry Point Pattern
All agents use BedrockAgentCoreApp with @app.entrypoint decorator:
from bedrock_agentcore import BedrockAgentCoreApp
app = BedrockAgentCoreApp()
@app.entrypoint
def invoke(payload: dict) -> dict:
prompt = payload.get("prompt", "")
result = your_agent_logic(prompt)
return {"result": result}
if __name__ == "__main__":
app.run()
Key CLI Commands
All commands: uv run agentcore [command]
Runtime: configure, deploy, invoke, status, destroy, stop-session Gateway: gateway create-mcp-gateway, gateway create-mcp-gateway-target Memory: memory create, memory list, memory status Identity: identity setup-cognito, identity setup-aws-jwt Policy: policy create-policy-engine, policy create-policy
See references/cli-reference.md for full command list.
Rules
- Agent names: underscores only (
my_agentnotmy-agent) - Never hardcode API keys - use Secrets Manager
- Windows: prefix with
PYTHONIOENCODING=utf-8 - Memory mode order:
STM_AND_LTM(not LTM_AND_STM)
- Deploy a new agent
- Update existing deployment
- Add Google OAuth
- Create chat UI
- Set up Gateway (MCP tools)
- Configure Memory
- Set up Identity/Auth
- View logs/observability
- Troubleshoot errors
- Something else
Wait for response before proceeding.
| Response | Workflow | |----------|----------| | 1, "deploy", "new" | workflows/deploy-agent.md | | 2, "update", "redeploy" | workflows/update-deployment.md | | 3, "oauth", "google" | workflows/add-oauth.md | | 4, "ui", "chat", "streamlit" | workflows/create-chat-ui.md | | 5, "gateway", "mcp", "tools" | workflows/setup-gateway.md | | 6, "memory", "stm", "ltm" | workflows/setup-memory.md | | 7, "identity", "auth", "cognito", "jwt" | workflows/setup-identity.md | | 8, "logs", "observability", "cloudwatch" | workflows/view-logs.md | | 9, "error", "troubleshoot", "fix" | workflows/troubleshoot.md | | 10, other | Clarify, then select |After reading the workflow, follow it exactly.
All domain knowledge in `references/`:- architecture.md - All AgentCore components explained
- cli-reference.md - Complete CLI command reference
- prerequisites.md - AWS setup, Python, uv requirements
- memory-modes.md - Memory configuration details
- common-errors.md - Error messages and fixes
- iam-policies.md - IAM role configuration