Skip to content

Add FMKB-via-AgentCore-Gateway sample deployed to AgentCore Runtime#717

Open
shraiyya wants to merge 1 commit into
aws-samples:mainfrom
shraiyya:fmkb-gateway-runtime-shreya
Open

Add FMKB-via-AgentCore-Gateway sample deployed to AgentCore Runtime#717
shraiyya wants to merge 1 commit into
aws-samples:mainfrom
shraiyya:fmkb-gateway-runtime-shreya

Conversation

@shraiyya

Copy link
Copy Markdown

Issue #, if available: N/A

Description of changes:

Adds a sibling to 01-end-to-end-example-with-ac-gateway. The 01 folder runs the Strands agent locally; this folder packages the same agent and deploys it to Bedrock AgentCore Runtime via the agentcore CLI (bedrock-agentcore-starter-toolkit).

The sample is split into two scripted sub-folders so each piece can be exercised independently:

  • 01-raw-mcp/ — provisions the gateway IAM role + AgentCore Gateway + KB target, exercises the gateway → KB plumbing via raw MCP+SigV4 (no agent in the loop), and tears it all down. Idempotent: re-running setup reuses the same resources by exact-name match instead of orphaning siblings.
  • 02-strands-agent/BedrockAgentCoreApp entrypoint deployed via agentcore configure && agentcore deploy. Ships the runtime trust policy and a least-privilege execution policy that grants bedrock-agentcore:InvokeGateway scoped to the gateway ARN. The system prompt locks the agent to KB-grounded answers (no model-knowledge fallback).

Tested end-to-end in us-west-2 against an existing FMKB knowledge base:

  • setup_gateway.py → gateway + target both READY; second run reuses the same IDs (no orphans)
  • Raw MCP Retrieve returns 5 hits, top score > 0.95
  • agentcore deploy succeeds; agentcore invoke returns substantive answers with KB citations on-topic, refuses cleanly off-topic
  • 4 concurrent invocations complete in parallel
  • cleanup.py + agentcore destroy --force --delete-ecr-repo leave zero orphans
  • IAM AccessAnalyzer validate-policy returns 0 findings on both policies

Dependencies pinned: botocore>=1.43.32 (first release that models the bedrock-knowledge-bases connector under CreateGatewayTarget).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Adds a sibling to 01-end-to-end-example-with-ac-gateway. The 01 folder
runs the Strands agent locally; this folder packages the same agent and
deploys it to AgentCore Runtime via the agentcore CLI
(bedrock-agentcore-starter-toolkit).

The sample is split into two scripted sub-folders so each piece can be
exercised independently:

- 01-raw-mcp/ provisions the gateway role + gateway + KB target,
  exercises the gateway -> KB plumbing without an agent in the loop, and
  tears it all down. Idempotent: re-running setup reuses the same
  resources by exact-name match instead of orphaning siblings.

- 02-strands-agent/ is the BedrockAgentCoreApp entrypoint, deployed via
  agentcore configure && agentcore deploy. Includes the runtime trust
  policy and a least-privilege execution policy that grants
  bedrock-agentcore:InvokeGateway scoped to the gateway ARN.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant