Skip to content

feat: Add custom orchestration with Strands agents demonstrated with taubench dataset#152

Merged
manoj-selvakumar5 merged 20 commits intostrands-agents:mainfrom
baishch:main
Sep 30, 2025
Merged

feat: Add custom orchestration with Strands agents demonstrated with taubench dataset#152
manoj-selvakumar5 merged 20 commits intostrands-agents:mainfrom
baishch:main

Conversation

@baishch
Copy link
Copy Markdown
Contributor

@baishch baishch commented Sep 11, 2025

This PR introduces advanced multi-agent orchestration patterns using AWS Strands framework with the taubench airline booking dataset.

What's Added

Orchestration Patterns

  • REWOO: Planner → Worker → Solver pattern for structured planning and deterministic execution
  • REWOO-ReAct Hybrid: Combines planning reliability with execution flexibility
  • Reflexion: Draft → Revisor pattern for iterative self-improvement

Implementation Details

  • 3 ready-to-run Jupyter notebooks demonstrating each pattern
  • Integration with 14 taubench airline domain tools (booking, search, updates)
  • Uses tasks_singleturn.json dataset with flight booking scenarios
  • AWS Bedrock Claude 3 Sonnet model integration

Documentation & Setup

  • Comprehensive README with project structure visualization
  • Step-by-step usage instructions with question ID configuration
  • requirements.txt for easy dependency management
  • Tool conversion utilities for Strands compatibility

Testing

Each notebook is self-contained and can be executed independently to compare orchestration approaches on the same airline domain tasks.

Issue #, if available:
NA

Description of changes:

  • Implement 3 orchestration patterns: REWOO, REWOO-ReAct hybrid, Reflexion
  • Add comprehensive documentation with project structure and usage instructions
  • Include requirements.txt for easy setup
  • All patterns use taubench airline domain with 14 flight booking tools
  • Ready-to-run Jupyter notebooks for each orchestration approach

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…taubench dataset

- Implement 3 orchestration patterns: REWOO, REWOO-ReAct hybrid, Reflexion
- Add comprehensive documentation with project structure and usage instructions
- Include requirements.txt for easy setup
- All patterns use taubench airline domain with 14 flight booking tools
- Ready-to-run Jupyter notebooks for each orchestration approach
…example styles along with architecture diagram
@manoj-selvakumar5
Copy link
Copy Markdown
Collaborator

Hi @baishch thank you for contributing. These notebooks looks to be great starting point for demonstrating different orchestration patterns with Strands Agents. I went through the README and ran the reAct_singleTurn.ipynb notebook, and I noticed a few areas where we could improve clarity and consistency. Could you please review and address?

  • Noticed several unused imports (e.g., GraphBuilder). Consider removing them for clarity.
  • The current imports use from mabench.environments.airline.tools., but these don’t include @tool decorators for Strands compatibility. Should these instead be imported from tools_strands.?
  • Missing ReAct reasoning loop demo - The notebook doesn’t clearly demonstrate the ReAct loop (Think → Act → Observe). Suggest adding explicit output/logging to show reasoning steps, tool calls, and final synthesis.
  • The notebook ends with “Congratulations! You’ve successfully created and tested a ReAct agent implementation.”
  • However, the last cell output isn’t very clear. Instead of showing the ReAct loop (reasoning steps, tool calls, synthesized response), the agent only seems to ask a follow-up question. Could you clarify what this output is meant to represent? It would be helpful to annotate the results or add context so developers understand what’s expected versus what’s actually happening.
  • Copy-paste errors: References “Reflexion implementation” in a ReAct notebook.
  • Mentions “three-agent pipeline” even though this is a single-agent system.
  • The notebook states “autonomous tool execution,” but the agent appears to only ask questions without executing tools. Could you clarify or update?
  • Let’s standardize on “Strands Agents,” “Strands Agents SDK,” or “Strands Agent” for individual instances. Currently I see mixed usage (“Strands,” “Strands framework”).
  • Please update references from AWS Bedrock → Amazon Bedrock
  • Architecture diagram in the notebook doesn’t seem to render correctly. Could you check the image path or embedding method?
  • I only had a chance to check the ReAct notebook in detail. The comments above capture the issues I found there. Could you please also review the other notebooks ?

@baishch
Copy link
Copy Markdown
Contributor Author

baishch commented Sep 19, 2025

Hi @baishch thank you for contributing. These notebooks looks to be great starting point for demonstrating different orchestration patterns with Strands Agents. I went through the README and ran the reAct_singleTurn.ipynb notebook, and I noticed a few areas where we could improve clarity and consistency. Could you please review and address?

  • Noticed several unused imports (e.g., GraphBuilder). Consider removing them for clarity.
    Thank you for catching that i will remove them
  • The current imports use from mabench.environments.airline.tools., but these don’t include @tool decorators for Strands compatibility. Should these instead be imported from tools_strands.?
    **Original mabench doesnot but the readme has steps to run scripts which would convert them to strands tools.

Running Tools Modification Script

To prepare tool files for use with the Strands framework, you need to run the modifyToolsStrands.py script which adds the necessary imports, decorators, and data loading code:

This script will:

  1. Add from strands import tool import if not present
  2. Add from mabench.environments.airline.data import load_data import if needed
  3. Add @tool decorator to tool functions if not present**
  4. Replace data = get_data() calls with data = load_data()
  • Missing ReAct reasoning loop demo - The notebook doesn’t clearly demonstrate the ReAct loop (Think → Act → Observe). Suggest adding explicit output/logging to show reasoning steps, tool calls, and final synthesis.
    The default orchestration of an agent using LLM is ReAct. LLM implicitly think, takes action observes and repeats. I have intentionally not put explicit think and observe steps. The whole goal is to show that how the default react based strands agent would behave. This is our baseline and we will anchor on this and build to create advanced orchestration. Also a great new blog that echoes my point :
    https://aws.amazon.com/blogs/opensource/strands-agents-and-the-model-driven-approach/#:~:text=The%20agent%20loop,thinking%20and%20acting.
  • The notebook ends with “Congratulations! You’ve successfully created and tested a ReAct agent implementation.”
  • However, the last cell output isn’t very clear. Instead of showing the ReAct loop (reasoning steps, tool calls, synthesized response), the agent only seems to ask a follow-up question. Could you clarify what this output is meant to represent? It would be helpful to annotate the results or add context so developers understand what’s expected versus what’s actually happening.
    I believe there is something missing when you set up the code. For ex when i run the same code with question idx 0 i get this output:
    My user id is mia_li_3668. I want to fly from New York to Seattle on May 20 (one way). I do not want to fly before 11am EST. I want to fly in economy. I prefer direct flights but one stopover is also fine. If there are multiple options, I prefer the one with the lowest price. I have 3 baggages. I do not want insurance. I want to use my two certificates to pay. If only one certificate can be used, I prefer using the larger one, and pay the rest with my 7447 card.

I'll help you find flights from New York to Seattle on May 20th. Let me first get your user details and then search for available flights.
Tool #1: get_user_details
Now let me check what airports are available in New York:
Tool #2: list_all_airports
I can see you have airports in the New York area: JFK (New York), EWR (Newark), and LGA (LaGuardia). Let me search for direct flights first from JFK to Seattle on May 20th, 2024:
Tool #3: search_direct_flight
The direct flights from JFK depart before 11am EST, so let me check EWR (Newark):
Tool #4: search_direct_flight
Let me check LGA (LaGuardia):
Tool #5: search_direct_flight
Now let me search for one-stop flights from JFK that depart after 11am EST:
Tool #6: search_onestop_flight
Let me also check one-stop flights from EWR:
Tool #7: search_onestop_flight
Let me also check LGA for one-stop flights:
Tool #8: search_onestop_flight
Based on my search results, here are the available flight options for your criteria (departing after 11am EST on May 20th, economy class):

From Newark (EWR) - Best Option:

  • HAT213 (EWR→DFW) departing 12:00pm EST, arriving 3:30pm local
  • HAT099 (DFW→SEA) departing 4:00pm local, arriving 8:00pm local
  • Total Price: $279 ($106 + $173)

From LaGuardia (LGA):

  • HAT219 (LGA→PHX) departing 2:00pm EST, arriving 6:30pm local
  • HAT045 (PHX→SEA) departing 11:00pm local, arriving 2:00am+1 local
  • Total Price: $284 ($188 + $196) - Note: This has a very late connection

Additional EWR Option:

  • HAT231 (EWR→DFW) departing 4:00pm EST, arriving 7:30pm local
  • HAT067 (DFW→SEA) departing 11:00pm local, arriving 3:00am+1 local
  • Total Price: $320 ($171 + $149) - Note: This also has a late arrival

The Newark (EWR) option with HAT213→HAT099 is the best choice as it:

  • Departs after 11am (12:00pm)
  • Has the lowest price at $279
  • Arrives at a reasonable time (8:00pm)
  • Has economy seats available

Now let me calculate the baggage costs. As a Gold member, you get 3 free checked bags per passenger in economy, so all 3 of your bags would be free.

Let me also calculate the total cost with your certificates. You have:

  • Certificate: $250 (certificate_7504069)
  • Certificate: $100 (certificate_4856383)

However, the system only allows one certificate per reservation. Since you prefer using the larger one, I'll use the $250 certificate, and the remaining $29 ($279 - $250) would be paid with your credit card ending in 7447.

Booking Summary:

  • Flights: HAT213 (EWR→DFW) + HAT099 (DFW→SEA) on May 20, 2024
  • Passenger: Mia Li (yourself)
  • Cabin: Economy
  • Baggage: 3 checked bags (all free with Gold membership)
  • Insurance: No
  • Payment: $250 certificate + $29 on credit card ending in 7447
  • Total Cost: $279

Would you like me to proceed with booking this reservation? Please confirm by saying "yes" if you agree with these details. REACT execution time 30.67269802093506

  • Copy-paste errors: References “Reflexion implementation” in a ReAct notebook.
    Thank you for noticing that i will correct it and check in other notebooks as well.
  • Mentions “three-agent pipeline” even though this is a single-agent system.
    Yes thats wrong , I will correct it
  • The notebook states “autonomous tool execution,” but the agent appears to only ask questions without executing tools. Could you clarify or update?
    You will have to follwo the readme to setup the dataset. I think since the dataset is not setup , it never calls the tools when you run.
  • Let’s standardize on “Strands Agents,” “Strands Agents SDK,” or “Strands Agent” for individual instances. Currently I see mixed usage (“Strands,” “Strands framework”).
    Ok. Makes sense
  • Please update references from AWS Bedrock → Amazon Bedrock
    Yes sure.
  • Architecture diagram in the notebook doesn’t seem to render correctly. Could you check the image path or embedding method?
    Yah the path was wrong , corrected it.
  • I only had a chance to check the ReAct notebook in detail. The comments above capture the issues I found there. Could you please also review the other notebooks ?
    Sure.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 23, 2025

Latest scan for commit: ede9fa5 | Updated: 2025-09-30 02:56:52 UTC

✅ Security Scan Report (PR Files Only)

Scanned Files

  • 02-samples/15-custom-orchestration-airline-assistant/README.md
  • 02-samples/15-custom-orchestration-airline-assistant/data/ma-bench/README.md
  • 02-samples/15-custom-orchestration-airline-assistant/data/ma-bench/mabench/bench_types.py
  • 02-samples/15-custom-orchestration-airline-assistant/data/ma-bench/mabench/environments/airline/__init__.py
  • 02-samples/15-custom-orchestration-airline-assistant/data/ma-bench/mabench/environments/airline/data/__init__.py
  • 02-samples/15-custom-orchestration-airline-assistant/data/ma-bench/mabench/environments/airline/data/flights.json
  • 02-samples/15-custom-orchestration-airline-assistant/data/ma-bench/mabench/environments/airline/data/reservations.json
  • 02-samples/15-custom-orchestration-airline-assistant/data/ma-bench/mabench/environments/airline/data/users.json
  • 02-samples/15-custom-orchestration-airline-assistant/data/ma-bench/mabench/environments/airline/env.py
  • 02-samples/15-custom-orchestration-airline-assistant/data/ma-bench/mabench/environments/airline/rules.py
  • ... and 72 more files

Security Scan Results

Critical High Medium Low Info
0 0 0 0 0

Threshold: High

No security issues detected in your changes. Great job!

This scan only covers files changed in this PR.

@manoj-selvakumar5 manoj-selvakumar5 merged commit 8943255 into strands-agents:main Sep 30, 2025
hertaehyun pushed a commit to hertaehyun/16-genai_powered_financial_advisor_tools that referenced this pull request Nov 4, 2025
…taubench dataset (strands-agents#152)

* feat: Add custom orchestration with Strands agents demonstrated with taubench dataset

- Implement 3 orchestration patterns: REWOO, REWOO-ReAct hybrid, Reflexion
- Add comprehensive documentation with project structure and usage instructions
- Include requirements.txt for easy setup
- All patterns use taubench airline domain with 14 flight booking tools
- Ready-to-run Jupyter notebooks for each orchestration approach

* adding detailed documentation for every notebook following existing example styles along with architecture diagram

* adding visrtual env creation, adding git repo name for cloning

* Consistently named Strands as Strands Agents, Bedrock and Amazon Bedrock, keep only necessary imports, fix image path for proper rendering

* adding example query and response for all orchestrations

* formatting issues

* formatting issues in rewoo-react

* 2 replacement tools that user needs to replace after setting up the tools

* added the data ready to be used , removed code to download data, made necessary corrections in readme, images now render

* adjusting the image format

* taking care of security issues

* removing unused folders and files from data folder

* more cleanup from data

* adding some description on th edataset so that readers know the kind of data it is

* changing it to 15th sample

* correcting readme

* fixing the data issue and removed unused imports

* fixing sec issue from calculate.py

* remove saving response to output folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants