AI agents are quickly becoming the intelligence layer of modern applications, managing decisions, triggering tools, and producing real-time responses. But scaling them effectively demands a strong underlying framework.
There are strong agent development frameworks have been released:
- AWS Strands Agents
- Google Agent Development Kit (ADK)
- CrewAI
In addition, there are different types of agent patterns:
- Sequential
- Parallel
- Swarm
- With Feedback Loop
- Aggregator
- Autonomous
In this post, we’ll implement an end-to-end sequential agent app using AWS Strands, AWS Bedrock and AWS Nova, FastAPI, and a Streamlit UI.
Table of Contents
What is AWS Strands Agents?
- Strands agent is an
open-source frameworkto develop AI agentsto run anywhere:- VSCode, Terminal,
- Docker Container,
- AWS Bedrock AgentCore,
- AWS Lambda,
- AWS ECS (Elastic Container Service),
- AWS EKS (Elastic Kubernetes Service),
- Really good documentation to view/learn agents, tools, workflows, model providers, streaming, multi-agent etc.
Sequential Multi Agent Workflow App
Installing Libraries & Reaching LLM Model
- Please install AWS Strands Agents & Tools libraries:
pip install strands-agents
pip install strands-agents-tools strands-agents-builder
-
Enable AWS Bedrock model access in your region or US-West-2
AWS Bedrock > Bedrock Configuration > Model Access > AWS Nova-Pro, or Claude Opus 4.5
In this code, we'll use
AWS Nova-Pro, because it's served in different regions by AWS.After model access, give permission in your IAM to access AWS Bedrock services:
AmazonBedrockFullAccess-
2 Options to reach AWS Bedrock Model using your AWS account:
-
AWS Config: With
aws configure, to createconfigandcredentialsfiles - Getting variables using .env file: Add .env file:
-
AWS Config: With
AWS_ACCESS_KEY_ID= PASTE_YOUR_ACCESS_KEY_ID_HERE
AWS_SECRET_ACCESS_KEY=PASTE_YOUR_SECRET_ACCESS_KEY_HERE
Application Code
- We'll create 3 agents sequential workflow:
- Destination Researcher -> Travel Guide Generator -> Client Communicator
- Out of one the agent will be used as input of another agent.
- Tools can be attached to different agents.
GitHub Link: Project in GitHub
Agent App:
# agent.py
from fastapi import FastAPI, Request, HTTPException
from pydantic import BaseModel
from strands import Agent, tool
from strands.models import BedrockModel
from strands_tools import calculator, current_time, python_repl
MODEL = "us.amazon.nova-pro-v1:0"
bedrock_model = BedrockModel(
model_id=MODEL,
temperature=0.7,
top_p=0.9,
)
researcher_agent = Agent(
model=bedrock_model,
system_prompt=(
"You are a Destination Researcher. Your primary goal is to gather detailed, high-level information for the city or "
"location mentioned by the user. Do NOT create a day-to-day itinerary. "
"Focus on these categories: "
"1. **Most Attractive Places/Landmarks** (Top 5 must-sees). "
"2. **Key Historical Facts** (3-4 fascinating historical points). "
"3. **Best Areas to Stay** (3 distinct neighborhood suggestions with descriptions). "
"4. **Best Local Foods** and 3 specific restaurant/street food suggestions. "
"5. **3-5 Suggested Web Pages** for further reading (e.g., official tourism, reputable travel blogs)."
"Report all this raw information clearly and in separate, labeled sections."
),
tools=[calculator, current_time]
)
travel_guide_agent = Agent(
model=bedrock_model,
system_prompt=(
"You are a Senior Travel Guide Generator. You will receive raw destination data from a Researcher. "
"Your goal is to synthesize this data into a structured, engaging, and comprehensive travel guide."
"Organize the information exactly into the following sections: 'Must-See Attractions', 'Historical Highlights', 'Where to Stay', and 'Culinary Delights'. "
"Do NOT create a 5-day itinerary. Simply structure the gathered facts into a beautiful guide format. "
"Use Python/Calculator only if complex data aggregation is needed (unlikely for this task, but keep available)."
),
tools=[python_repl, calculator]
)
writer_agent = Agent(
model=bedrock_model,
system_prompt=(
"You are the Client Relations Manager. You will receive a structured travel guide. "
"Your goal is to write a professional and clear final response to the client. "
"Include the full structured guide and prominently feature the 'Suggested Web Pages' section at the end. "
"Frame the guide as a 'Get Started' resource for their trip research. "
"Keep the tone encouraging and client-focused."
),
tools=[]
)
app = FastAPI()
class QueryRequest(BaseModel):
query: str
@app.post("/ask")
async def ask(request: QueryRequest):
"""
Executes a sequential travel guide workflow: Destination Researcher -> Travel Guide Generator -> Client Communicator
"""
query = request.query
try:
# Step 1: Researcher (Gathers raw facts)
research_output = researcher_agent(query, stream=False)
# Step 2: Travel Guide Generator (Structures the facts)
planner_prompt = (
f"Generate a comprehensive travel guide based on the user's request: '{query}' "
f"and the following raw information (DO NOT create an itinerary): {research_output}"
)
guide_output = travel_guide_agent(planner_prompt, stream=False)
# Step 3: Writer (Formats the final response)
writer_prompt = (
f"User Inquiry: {query}\n\n"
f"Synthesized Travel Guide Content: {guide_output}\n\n"
"Please write the final client response (complete guide, not like email):"
)
final_response = writer_agent(writer_prompt, stream=False)
return {
"workflow_steps": {
"raw_research_data": str(research_output),
"structured_guide_content": str(guide_output)
},
"response": str(final_response)
}
except Exception as e:
raise HTTPException(status_code=500, detail=f"Workflow processing failed: {e}")
if __name__ == "__main__":
import uvicorn
uvicorn.run("agent:app", host="0.0.0.0", port=8000)
Run app.py:
uvicorn agent:app --host 0.0.0.0 --port 8000
Streamlit UI:
# app.py
import streamlit as st
import requests
import json
st.set_page_config(page_title="AWS Strands Workflow", layout="centered")
st.title("AWS Strands Agent")
# initialize chat history
if "messages" not in st.session_state:
st.session_state.messages = []
user_query = st.chat_input("Ask for system file tool commands or anything...")
if user_query:
st.session_state.messages.append({"role": "user", "content": user_query})
try:
response = requests.post("http://localhost:8000/ask", json={"query": user_query})
response.raise_for_status()
response_json = response.json()
assistant_text = response_json["response"]
except Exception as e:
assistant_text = f"Error: {str(e)}"
st.session_state.messages.append({"role": "assistant", "content": assistant_text})
# display all messages in order
for msg in st.session_state.messages:
st.chat_message(msg["role"]).markdown(msg["content"])
Run app.py:
streamlit run app.py
or
python3 -m streamlit run app.py
Sample Prompt / Output
Prompt: I want to go to Maldives, give me information about Maldives?
Welcome to your comprehensive travel guide for the Maldives! We're excited to help you begin your journey to this stunning paradise. Below, you'll find everything you need to know about the must-see attractions, historical highlights, where to stay, and culinary delights that await you in the Maldives.
### Must-See Attractions
1. **Male' National Mosque** - The largest mosque in the Maldives, renowned for its breathtaking architecture and tranquil ambiance.
2. **HP Reef** - A world-class dive site celebrated for its rich marine biodiversity and vibrant coral reefs.
3. **Kurumba Beach** - A stunning beach with pristine white sands and crystal-clear waters, perfect for relaxation and various water sports.
4. **Sultan Park** - A serene park in Male' featuring a replica of the Islamic Centre and a peaceful pond, offering a glimpse into the local culture.
5. **Sea Turtle Excursion** - Numerous islands provide opportunities to observe sea turtles in their natural habitat, a must-do for wildlife enthusiasts.
### Historical Highlights
1. **Buddhist History** - Before embracing Islam in the 12th century, the Maldives were a Buddhist nation, reflecting a rich cultural heritage.
2. **Sultanate Era** - The Maldives were governed by a sultanate for centuries, a period that shaped the nation's history and traditions.
3. **Independence from the UK** - The Maldives achieved independence from the United Kingdom on July 26, 1965, marking a significant milestone in its history.
4. **Tsunami of 2004** - The 2004 Indian Ocean tsunami had a profound impact on the Maldives, leading to extensive reconstruction and resilience efforts.
### Where to Stay
1. **Male'** - The vibrant capital city, offering a deep dive into local culture and convenient access to major attractions.
2. **North Male' Atoll** - Renowned for its luxurious resorts and exceptional diving opportunities, ideal for a lavish getaway.
3. **Vaavu Atoll** - A serene and less crowded atoll, perfect for travelers seeking a more intimate and authentic Maldivian experience.
### Culinary Delights
1. **Garudhiya** - A traditional fish soup, often enjoyed during special occasions and celebrations.
2. **Mas Huni** - A popular breakfast dish made from tuna, coconut, and onions, reflecting the Maldivian love for seafood.
3. **Heka** - A delightful Maldivian snack made from rice flour and coconut, offering a taste of local flavors.
### Suggested Web Pages
To further enhance your trip research, we recommend visiting the following websites:
- [Visit Maldives Official Tourism Website](https://visitmaldives.com/)
- [Lonely Planet - Maldives Travel Guide](https://www.lonelyplanet.com/maldives)
- [TripAdvisor - Maldives](https://www.tripadvisor.com/Tourism-g293955-Maldives-Vacations.html)
- [National Geographic - Maldives](https://www.nationalgeographic.com/travel/destination/maldives)
We hope this guide helps you get started on planning your dream trip to the Maldives. If you have any more questions or need further assistance, please feel free to reach out. Safe travels and enjoy your adventure!
Conclusion
In this post, we mentioned:
- how to access AWS Bedrock Foundation Models (Nova-Pro),
- how to implement sequential multi agents workflow with Nova-Pro, Fast API, Streamlit UI.
If you found the tutorial interesting, I’d love to hear your thoughts in the blog post comments. Feel free to share your reactions or leave a comment. I truly value your input and engagement 😉
For other posts 👉 https://dev.to/omerberatsezer 🧐
References
Your comments 🤔
- Which tools are you using to develop AI Agents (e.g.
AWS Strands, Google ADK, CrewAI, Langchain, etc.)? Please mention in the comment your experience, your interest? - Which agent patterns (
sequential, parallel, swarm, feedback loop, aggregator, autonomous, etc.) are best suited for which use cases?
Top comments (1)
With multi-agent frameworks like
AWS Strands, Google ADK, and CrewAI,we can build many different agent patterns, such assequential, parallel, swarm-based, feedback-loop, aggregator, and fully autonomous setups. Each pattern fits different use cases. We should explore these patterns, understand where they work best, and start implementing them in our projects.