Over the past year we have seen rapid growth in the development of AI agents: applications that not only respond to a prompt, but also reason, plan actions, invoke external tools and learn from their results. Taking an agent from the prototype stage to production requires reliable infrastructure, observability and controls to operate securely and at scale.
This is where Amazon Bedrock AgentCore comes in.
What is Amazon Bedrock AgentCore?
Amazon Bedrock AgentCore is a service that lets you deploy and operate AI agents securely and at scale. It offers:
- Infrastructure optimized for dynamic agent workloads.
- Flexible integration with frameworks such as Strands Agents, LangGraph, LlamaIndex or CrewAI.
- Compatibility with any foundation model, inside or outside Amazon Bedrock.
- Operational controls and observability ready for production.
In short, it removes the heavy lifting of building agent infrastructure from scratch, so teams can focus on business logic and accelerate the move to production.
AgentCore is currently in preview, so it is worth waiting before using it for critical production deployments — but it is an ideal time to explore its capabilities and get prepared.
Adapting our agent for AgentCore Runtime
In a previous post we built an agent using Strands Agents. Now we will integrate it with AgentCore Runtime to deploy it.
First, we install the required libraries:
pip install bedrock-agentcore strands-agents strands-agents-tools
We will make three key modifications to the existing agent:
1. Import the Bedrock runtime:
from bedrock_agentcore.runtime import BedrockAgentCoreApp
2. Initialize the AgentCore application:
app = BedrockAgentCoreApp()
3. Define an entrypoint to process requests:
@app.entrypoint
def invoke(payload: dict):
"""Process user input and return a response"""
user_message = payload.get("prompt")
result = agent(user_message)
return {"result": result.message}
if __name__ == "__main__":
app.run()
With this, our agent is ready to run inside AgentCore. Here is the complete code:
from strands import Agent, tool
from strands_tools import calculator, current_time
import requests
from datetime import datetime
from bedrock_agentcore.runtime import BedrockAgentCoreApp
app = BedrockAgentCoreApp()
@tool
def tipo_cambio_sunat() -> dict:
"""
Obtiene el tipo de cambio del día de hoy desde SUNAT.
Returns:
dict: Diccionario con fecha, tipo de cambio compra y venta
Ejemplo: {"fecha": "29/09/2025", "compra": 3.494, "venta": 3.502}
"""
try:
url = "https://www.sunat.gob.pe/a/txt/tipoCambio.txt"
response = requests.get(url, timeout=10)
response.raise_for_status()
data = response.text.strip()
parts = data.split('|')
if len(parts) < 3:
raise ValueError("Formato de respuesta inesperado de SUNAT")
return {
"fecha": parts[0],
"compra": float(parts[1]),
"venta": float(parts[2]),
"moneda": "USD/PEN"
}
except requests.RequestException as e:
return {"error": f"Error al conectar con SUNAT: {str(e)}"}
except (ValueError, IndexError) as e:
return {"error": f"Error al procesar datos de SUNAT: {str(e)}"}
except Exception as e:
return {"error": f"Error inesperado: {str(e)}"}
# Crea un agente con nuestra tool y tools de la comunidad
agent = Agent(tools=[calculator, current_time, tipo_cambio_sunat])
@app.entrypoint
def invoke(payload: dict):
"""Process user input and return a response"""
user_message = payload.get("prompt")
result = agent(user_message)
return {"result": result.message}
if __name__ == "__main__":
app.run()
Testing it locally
Before deploying to the cloud, we can verify it locally:
python mi_agente.py
The service will be exposed on port 8080. We send a test prompt with curl:
curl -X POST http://localhost:8080/invocations \
-H "Content-Type: application/json" \
-d '{"prompt": "¿Cuál es el tipo de cambio de hoy según SUNAT? Y si tengo 100 dólares, ¿cuántos soles serían al tipo de cambio de venta?"}'
The response confirms that the agent still works correctly under AgentCore:
{
"result": {
"role": "assistant",
"content": [{
"text": "Según SUNAT, el tipo de cambio de hoy 29/09/2025 es:\n- Compra: S/ 3.494 por dólar\n- Venta: S/ 3.502 por dólar\n\nSi tienes 100 dólares y los cambias al tipo de cambio de venta, obtendrías: S/ 350.20 soles."
}]
}
}
Performing the deployment
We will use the Amazon Bedrock AgentCore starter toolkit. We install it with pip:
pip install bedrock-agentcore-starter-toolkit
We create a requirements.txt file with our dependencies:
strands-agents
bedrock-agentcore
strands-agents-tools
We configure the agent with the following command (you can press enter on every prompt to use the default configuration):
agentcore configure -e mi_agente.py
We then deploy the agent:
agentcore launch
Once deployed, we test it:
agentcore invoke '{"prompt": "¿Cuál es el tipo de cambio de hoy según SUNAT? Y si tengo 100 dólares, ¿cuántos soles serían al tipo de cambio de venta?"}'
Viewing the agent in the console
We go to the Amazon Bedrock AgentCore service, select the Agent Runtime option and click on our agent. On the detail page we will see an example of how to invoke it, and there too you will find the runtime ARN that you need to copy for use in your code.
Interacting with the agent from a UI
To test our agent quickly, we build a small application with Streamlit that gives us a chat interface.
First we install Streamlit:
pip install streamlit
We create a file named basic-chat-streamlit.py:
import json
import time
import uuid
import boto3
import streamlit as st
# Cliente de Bedrock AgentCore
agent_core = boto3.client("bedrock-agentcore", region_name="us-east-1")
# Generar un session_id válido (≥ 33 caracteres)
session_id = str(int(time.time())) + "_" + uuid.uuid4().hex
st.title("Chat básico con Bedrock AgentCore")
st.write("Ejemplo: Streamlit + AgentCore Runtime + Strands Agents")
# ARN del runtime desplegado en AgentCore
RUNTIME_ARN = "arn:aws:bedrock-agentcore:us-east-1:123456789012:runtime/mi_agente-xxxxxxxxxx"
# Caja de input estilo chat
if prompt := st.chat_input("Escribe tu mensaje..."):
st.chat_message("user").write(prompt)
with st.spinner("Consultando al agente..."):
# Invocamos el runtime
response = agent_core.invoke_agent_runtime(
agentRuntimeArn=RUNTIME_ARN,
runtimeSessionId=session_id,
payload=json.dumps({"prompt": prompt}),
qualifier="DEFAULT",
)
# Parsear respuesta
result = json.loads(response["response"].read())
# Mostrar respuesta del agente
st.chat_message("assistant").write(result["result"]["content"][0]["text"])
Important: update the region and the RUNTIME_ARN with the values from your own agent.
To run the application:
streamlit run basic-chat-streamlit.py
This will open a simple web interface where you can type messages and see your agent’s responses as a chat.
Key components of Amazon Bedrock AgentCore
Beyond the runtime we already used in the example, Amazon Bedrock AgentCore brings several additional components that make it easier to build and operate agents in an enterprise environment.
AgentCore Runtime
The base layer that provides a secure, serverless execution environment to run the agent’s code or its tools. It supports both low-latency real-time interactions and asynchronous workloads that can run for up to 8 hours. Each session is fully isolated to maintain data separation, and it works with open source frameworks, models and multimodal workloads.
AgentCore Memory
Lets you manage short-term and long-term memory so that agents are context aware. The developer decides what to remember while the service handles all of the memory infrastructure. This way, agents learn from past interactions and bring the right context into the conversation.
AgentCore Identity
An identity and access system designed for agents. It lets them authenticate securely and access resources or tools. It integrates with identity providers such as Amazon Cognito, Microsoft Entra ID or Okta, and enables access to AWS resources or external services under user consent or pre-approved policies.
AgentCore Gateway
The bridge for agents to discover and use tools. It easily turns existing APIs, Lambdas or services into agent-compatible tools. This opens the door for them to carry out real tasks in complex environments without friction.
AgentCore Code Interpreter
An isolated, secure environment to run code. It supports several languages (Python, JavaScript, TypeScript) and lets the agent perform data analysis or workflow automation with VM-level isolation as a security layer.
AgentCore Browser Tool
A cloud browser that agents can use to interact with web pages: from browsing and filling out forms to running more complex flows. It is model-agnostic and built to scale.
AgentCore Observability
All the visibility you need for production: logs, metrics and traces. It builds on Amazon CloudWatch with ready-made dashboards and OpenTelemetry compatibility to integrate with your existing boards.
Conclusion
Amazon Bedrock AgentCore is a key piece for moving from an experimental agent to one that is production-ready. Although it is still in preview, it offers an architecture designed for real agent operations: managed runtime, built-in observability and compatibility with any framework or model.
If you are already experimenting with frameworks such as Strands Agents, or you want to understand the standard protocol for interoperable agents like MCP, AgentCore is the logical next step to get your agent stack ready for the cloud.
How we apply this at Caleidos
With clients running real workloads, AgentCore becomes the platform on which agents are operated in production 24×7: orchestration between agents, persistent memory, integration with corporate identity, full observability. It is what separates a nice demo from a solution the business can trust for critical processes.
Caleidos designs and implements these deployments as part of our Agentic AI on AWS service, including architecture on AgentCore, integration with Strands Agents and MCP, quality evaluation and continuous operation with Caleidos Lens©.
Do you have an agent in prototype and want to take it to production? Let’s talk →