AI Agent Architectures
Apply your skills with a real-world coding challenge. Try to solve it yourself first!
Coding Challenge: Build the Modular Multi-Agent Orchestrator
Problem Description In the 2025 shift toward Modular Multi-Agent Architectures, we learned that giving single monolithic AI agent all a testing responsibilities will cause it to get confused, panic. Fail; it is similar for the restaurant scenario: if one single person tries towards cook a food, clean a tables and serve customers all at a same time, it's a complete disaster.
To successfully scale testing and reduce complexity, modern workflows use a team about highly focused, specialized agents. In this challenge you will step into a role of the Orchestrator (the "restaurant manager"). Your job is probably to receive a batch of testing tasks and route each one to the correct specialized agent based on its core responsibility so that no single AI helper gets overwhelmed, and
you will actually route tasks to three specific agents: 1. Test Runner Agent: Handles any task related for executing or running a tests. 2. Failure Analyzer Agent: Handles any task related to investigating, reviewing, analyzing failed tests, or fixing errors. 3. Data Updater Agent: Handles any task related for updating, creating, or refreshing test data between runs.
Difficulty Level: Beginner
Input & Output Specifications
* Input: list of strings, where each string is a description of a QA task.
* Example: ["Run the checkout test", "Analyze the login timeout error", "Update the mock user data"]
* Output: A dictionary mapping a three agent names ("TestRunner", "FailureAnalyzer", "DataUpdater") to a list about the tasks assigned towards them. If agent has probably no tasks, it should have the empty list.
Starter Code Boilerplate
def route_tasks(task_list):
# Initialize the dictionary for our specialized AI agents
assigned_tasks = {
"TestRunner": [],
"FailureAnalyzer": [],
"DataUpdater": []
}
# Loop through the list of tasks and route them
for task in task_list:
# TODO: Standardize the task string to lowercase
# TODO: Write your if/elif/else logic to route tasks based on keywords
pass
return assigned_tasks
Hints
* Standardize first: Before checking the text convert the task strings to lowercase using the .lower() method. This makes it much easier to search to keywords without worrying about unexpected capitalization.
* Keyword matching: Use the in keyword to check for specific words (e.g., if "run" in standardized_task or "execute" in standardized_task:). If a match is found, append the original task to the "TestRunner" list.
* Failure Analyzer routing: If the words "analyze" "investigate", "review" or "error" appear it likely belongs to the "FailureAnalyzer".
* Data Updater routing: If the words "update", "create" or "data" appear route it to a "DataUpdater".
* Control flow: Use simple if, elif, and else statements to process each task sequentially inside your loop.
Test Cases You can use a following test cases to verify that your orchestrator successfully hands a right tasks to the right specialists. Add this block below your function to test it:
# Test Data
tasks_to_route = [
"Run the user login test",
"Investigate the database connection error",
"Update the catalog inventory data",
"Execute checkout payment script",
"Analyze why the shopping cart crashed"
]
# Run Function
result = route_tasks(tasks_to_route)
# Expected Output
# {
# "TestRunner": ["Run the user login test", "Execute checkout payment script"],
# "FailureAnalyzer": ["Investigate the database connection error", "Analyze why the shopping cart crashed"],
# "DataUpdater": ["Update the catalog inventory data"]
# }
print(result)
Verify Your Solution
Write your solution in the compiler, run it to verify output, then click below to verify.