In recent years, AI agents have become key to building intelligent applications. An agent goes beyond a model that responds to a prompt: it is a system capable of reasoning, planning actions, invoking external tools and learning from its own results.
Building AI agents has traditionally required defining detailed and rigid workflows, which limits their scalability and adaptability. With the evolution of language models, today it is possible to let the model itself guide much of the process, reducing complexity for developers and enabling far more flexible and autonomous behaviors.
This is where Strands Agents comes in, the open source SDK released by AWS. Designed to leverage the capabilities of the most advanced models, Strands lets developers create agents simply: you just define a prompt and a list of tools in code. From there, the agent loop — a cycle of reasoning, tool use and response generation — orchestrates the agent’s intelligent behavior, which can be tested locally and deployed to the cloud.
Initial installation
To get started, we install the required libraries:
pip install strands-agents strands-agents-tools
Strands Agents uses Amazon Bedrock as its model provider by default, specifically Claude Sonnet 4. As a result, we need valid AWS credentials with permissions to invoke models in Bedrock.
A first basic agent
The following example creates an agent that responds using only the LLM:
from strands import Agent
# Crear agente
agent = Agent()
# Preguntar algo al agente
message = """
¿Qué hora es en Lima, Perú?
"""
agent(message)
The result will be the response generated directly by the model, with no access to external tools:
No tengo acceso a información en tiempo real, por lo que no puedo decirte la hora exacta actual en Lima, Perú.
Sin embargo, puedo darte información útil:
- **Zona horaria**: Lima está en UTC-5 (Hora Estándar de Perú)
- **Diferencias horarias comunes**:
- 2 horas menos que Argentina/Chile
- Misma hora que Colombia/Ecuador
- 1 hora más que México (centro)
- 5 horas menos que España
Para conocer la hora exacta actual en Lima, te recomiendo:
- Buscar "hora en Lima" en Google
- Usar aplicaciones de reloj mundial
- Consultar sitios web como timeanddate.com
Adding tools
To make it more interesting, we can give it access to the current_time tool, included in the strands-tools package:
from strands import Agent
from strands_tools import current_time
# Crear agente con acceso a herramientas
agent = Agent(tools=[current_time])
# Pregunta al agente
message = """
¿Qué hora es en Lima, Perú?
"""
agent(message)
Now the agent, in addition to the model, uses the tool to look up the current time in Lima and answers accurately:
Tool #1: current_time
La hora actual en Lima, Perú es **10:03:24 AM** (29 de septiembre de 2025).
Lima se encuentra en la zona horaria UTC-5 (también conocida como America/Lima), y actualmente
no observa el horario de verano, por lo que mantiene la misma diferencia horaria durante todo el año.
Creating our own tool
The real power of Strands Agents lies in defining our own tools. Suppose we want to look up the official exchange rate published by SUNAT.
If we do not add a tool, the model will respond with approximate data or clarify that it does not have access to that information:
Tengo disponibles funciones para cálculos matemáticos y obtener la hora actual,
pero no para consultar APIs de tipo de cambio en tiempo real.
To solve this, we define a Python function with the @tool decorator:
from strands import Agent, tool
from strands_tools import calculator, current_time
import requests
from datetime import datetime
@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()
# Formato esperado: 29/09/2025|3.494|3.502|
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])
# Realiza una pregunta al agente con las herramientas disponibles
message = """
¿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?
"""
agent(message)
With this, the agent invokes the SUNAT API, retrieves the exchange rate and combines it with the calculator to respond correctly:
Tool #1: tipo_cambio_sunat
Ahora calculemos cuántos soles serían 100 dólares al tipo de cambio de venta:
Tool #2: calculator
## Tipo de cambio SUNAT - 29/09/2025
**Tipo de cambio del día:**
- Compra: S/ 3.494 por dólar
- Venta: S/ 3.502 por dólar
**Conversión de tus 100 dólares:**
- Al tipo de cambio de venta: 100 USD = S/ 350.20
Conclusion
Strands Agents makes it easier to build AI agents on AWS by abstracting away the complexity of the agent loop and letting developers focus on what matters: creating tools that connect the LLM to real data and services.
- With just a few lines of code we go from an agent that answers from general knowledge to one that accesses up-to-date, reliable information.
- Thanks to native integration with Amazon Bedrock, we can build production-grade agents while delegating the model infrastructure to the AWS managed service.
- The most powerful part: we extend the agent’s capabilities by creating tools that respond to the needs of each business.
This is only the beginning. The next step is to orchestrate multiple agents, deploy them on serverless architectures and enable more advanced generative AI automation scenarios. If you want to explore how to take your agent to production in a scalable way, check out our guide on Amazon Bedrock AgentCore.
How we apply this at Caleidos
In real projects, tools like tipo_cambio_sunat multiply and become the backbone of an agent that is genuinely useful to the business: inventory lookups in SAP, tax ID (RUC) validation in SUNAT, policy searches in an insurance core, CRM integration. Each tool adds a concrete, measurable capability.
Caleidos designs, builds and operates these agents as part of our Agentic AI on AWS service, including architecture, custom tools, quality evaluation and 24×7 operation with Caleidos Lens©. And if you are interested in the standard-protocol side, get to know Model Context Protocol (MCP) and how it lets you reuse tools across agents.
Want to talk through your use case? Let’s talk →