• Documentation
  • Pricing
© 2026 Serverless, Inc. All rights reserved.

Framework

  • Overview
  • Documentation
  • Plugins360
  • Pricing

Learn

  • Blog
  • GuidesUpdated
  • Examples240
  • Courses

Resources

  • Support
  • Security
  • Trust Center
  • Status

Community

  • Slack
  • GitHub47k
  • Forum
  • Meetups

Company

  • About
  • Careers
  • Contact
  • Partners

Legal

  • Terms of Service
  • Privacy Policy
  • Trademark
  • DMCA
Serverless Framework Logo

Serverless Framework

Intro
SetupUpgrading To V4ConceptsTutorialAWS CredentialsLicense Keys
DeployingPackagingBuildingTestingDev ModeServicesFunctions
OverviewHTTP (API Gateway v2)REST (API Gateway v1)ActiveMQApplication Load BalancerAlexa SkillAlexa Smart HomeCloudWatch EventCloudWatch LogCloudFrontCognito User PoolEventBridge EventIoTIoT Fleet ProvisioningKafkaKinesis & DynamoDBMSKRabbitMQS3ScheduleSNSSQSWebsocket
LayersManaged InstancesWeb Apps (Lambda Web Functions)Sandboxes (Lambda MicroVMs)MCP ServersAlertsVersion PruningDomainsIAM Function PermissionsParameters
OverviewSelf-reference serverless.ymlServerless CoreEnvironment VariablesCLI OptionsExternal YAML/JSON FilesJavascript propertiesGitDoppler
OverviewS3 ObjectsSSM Parameter Store & Secrets ManagerCloudFormation Stack Outputs
OverviewVaultTerraform State Output
ResourcesComposing ServicesDeployment BucketStateAgent SkillsPython support
OverviewRuntimeGatewayMemoryBrowserCode InterpreterDev Mode
API Gateway Proxy
OverviewGeneral ConfigurationAuthenticationAPI KeysData SourcesResolversPipeline FunctionsSubstitutionsCachingDelta SyncCustom DomainWAFCLI Commands
Deploying SAM/CFN TemplatesWorkflow Tips
OverviewCreating PluginsCLI OutputCustom CommandsCustom VariablesExtending the Configuration schemaExtending and overriding configuration
OverviewDashboardAxiom
Overviewagent docsagent inspectagent setupagent skills installagent skills list / readdeploydeploy functiondeploy listdevdiffinfoinvokeinvoke localloginlogin awslogin aws ssologsmetricspackageplugin installplugin uninstallprintprunereconcileremoverollbackrollback functionusage
OverviewConcepts
OverviewMetricsTracesTroubleshoot
OverviewNode.jsPython
OutputsProviders
OverviewBranch DeploymentsPreview DeploymentsCustom ScriptsTestingPrivate PackagesNotificationsMono ReposDeploy in your own CI/CDBest PracticesTroubleshootingFAQ
OverviewSetupToolsAWS Integration
Serverless.yml Reference
Examples and TutorialsConfiguration Validation
  1. Usage
  2. AI Agents
  3. Overview

AI agents on Amazon Bedrock AgentCore

The Serverless Framework deploys AI agents to Amazon Bedrock AgentCore from the top-level ai block in serverless.yml, alongside your Lambda functions. Use it to host an agent built with any framework (LangGraph, Strands Agents, CrewAI or your own code) and to give it tools, memory, a cloud browser and a code sandbox.

Deploy a minimal agent

This service deploys one Python agent with direct code deployment, so Docker isn't needed. The agent answers every request with the prompt it received; replace the function body with your agent framework's call.

# serverless.yml
service: my-agent

provider:
  name: aws
  region: us-east-1

ai:
  agents:
    assistant:
      handler: agent.py
      runtime: python3.14

The handler file uses the Amazon Bedrock AgentCore Python SDK:

# agent.py
from bedrock_agentcore.runtime import BedrockAgentCoreApp

app = BedrockAgentCoreApp()


@app.entrypoint
def invoke(payload, context):
    return {"result": f"You said: {payload.get('prompt', '')}"}


if __name__ == "__main__":
    app.run()

List the dependencies in requirements.txt; the Framework installs them as Linux ARM64 wheels into the deployment package:

bedrock-agentcore

Deploy the service, then send the agent a prompt:

serverless deploy
serverless invoke --agent assistant --data '{"prompt": "Hello"}'
{"result": "You said: Hello"}

To remove the agent and every resource the service created, run serverless remove.

Agent pages

  • AgentCore Runtime agents: deploy an agent from a Dockerfile, from source, from a pre-built image or as Python code, and configure its network, authorization, endpoints and IAM role.
  • AgentCore Gateway tools: expose Lambda functions, OpenAPI and Smithy APIs and MCP servers to agents as MCP tools.
  • AgentCore Memory: store conversation events and extract long-term memories with memory strategies.
  • AgentCore Browser: let an agent browse websites with the AWS-managed browser or a custom browser with session recording.
  • AgentCore Code Interpreter: let an agent run Python, JavaScript and TypeScript in an isolated sandbox.
  • Dev Mode for AgentCore agents: run an agent on your machine against its deployed resources, with hot reload and an interactive chat.

The ai block

Each key under ai defines one kind of AgentCore resource; the key names under it are your names for the resources.

KeyWhat it definesPage
ai.agentsAgentCore Runtime agentsAgentCore Runtime agents
ai.toolsTools: Lambda functions, OpenAPI, Smithy and MCP targetsAgentCore Gateway tools
ai.gatewaysGateways that group tools and set their authorizationAgentCore Gateway tools
ai.memoryMemory resources that agents share by nameAgentCore Memory
ai.browsersCustom browsersAgentCore Browser
ai.codeInterpretersCustom code interpretersAgentCore Code Interpreter

The serverless.yml reference lists every key of the ai block in one place.

Examples

The Amazon Bedrock AgentCore examples cover JavaScript and Python agents built with LangGraph and Strands Agents: container and code deployment, streaming, memory, gateway tools, browser, code interpreter and an MCP server runtime.

Edit this page
Prev Python supportNextRuntime

Contents

  • AI agents on Amazon Bedrock AgentCore
  • Deploy a minimal agent
  • Agent pages
  • The ai block
  • Examples

Related

GuidesPluginsExamplesSlack CommunitySupport