🤖 Hello World Agent
Amazon Nova Pro via Bedrock
Concept
The simplest Strands agent — no tools, so the agentic loop runs exactly once. The model answers directly from Bedrock. Explain that without tools there's no reason to loop: the model just generates a reply. Amazon Nova Pro on Bedrock was chosen because it's a capable foundational model with a simple API available on AWS.
Theory & Concepts
In this Hello World demo, you can see the absolute baseline of an agentic loop. When you type a prompt in the browser, it is sent via a POST request to the /ask route in app.py. From there, it passes to hello_agent.py, where the Strands Agent is instantiated with the Amazon Nova Pro model.
Because we haven't provided any tools to the agent, there is no loop of reasoning and acting. The agent behaves just like a standard LLM call: it reads your prompt, uses Nova Pro's internal knowledge to formulate a response, and returns the generated text directly to the browser as a JSON payload.
Understanding this single-turn interaction—browser to backend to Bedrock and back—is the foundation. It shows you the raw capability of the model before we give it the ability to take actions via tools.
Request flow
Code flow
Backend
hello_agent.pyfrom strands import Agent
from strands.models.bedrock import BedrockModel
from config import MODEL_ID, agent_text
def ask(prompt: str) -> str:
"""Send a prompt to a plain, tool-less agent and return its reply."""
# No tools: the agentic loop runs exactly once — the model answers directly.
agent = Agent(model=BedrockModel(model_id=MODEL_ID), callback_handler=None)
return agent_text(agent(prompt))
API route
app.py@bp.route("/ask", methods=["POST"])
def ask_route():
"""Answer a prompt with a plain, tool-less agent (Module 1).
Request body (JSON): {"message": "<prompt>"}
Response (JSON): {"result": "<agent reply>"}
"""
data = request.get_json(force=True)
message = (data.get("message") or "").strip()
if not message:
return jsonify({"error": "A prompt is required."}), 400
try:
return jsonify({"result": ask(message)})
except Exception as e:
return jsonify({"error": str(e)}), 500