## Diagram: Prompt Template for Maze Navigation Problem
### Overview
The image displays a structured "Prompt Template" designed to instruct an AI agent on solving a maze navigation problem. The template is organized into four distinct, color-coded sections, each with a specific role in defining the task, providing examples, offering reasoning guidance, and presenting the problem facts. The overall purpose is to guide an agent to find the shortest path for "Bob" to rescue "Alice" in a maze of connected rooms with locked doors and keys.
### Components/Axes
The diagram is segmented into four primary rectangular boxes, each with a vertical label on its left or right side.
1. **Task Description (Left, Pink Box):**
* **Label:** "Task Description" (vertical text on the left).
* **Content:** Defines the agent's role, the core task, the structure of the maze description, valid actions, key constraints, and the required output format.
2. **Examples (Bottom-Left, Green Box):**
* **Label:** "Examples" (vertical text on the left).
* **Content:** Provides a complete example input (FACTS) and the corresponding correct output (a Python list of action tuples).
3. **Reasoning Guidance (Top-Right, Light Blue Box):**
* **Label:** "Reasoning Guidance" (vertical text on the right).
* **Content:** Lists a step-by-step procedure for the agent to follow to complete the task, including strategies for handling complexity.
4. **Problem Facts (Bottom-Right, Yellow Box):**
* **Label:** "Problem Facts" (vertical text on the right).
* **Content:** Presents the specific maze configuration for the current problem, including room connections, door states, key locations, and the start/end points.
### Detailed Analysis / Content Details
**1. Task Description Box Content:**
* **Agent Role:** "You are a problem solving agent that thinks carefully step by step based on provided facts and follows instructions closely."
* **TASK:** "Help Bob navigate through a maze of connected rooms to rescue Alice. Bob starts in a specified room and needs to find the optimal path to reach Alice's location, following the maze's rules about room connections and door locks."
* **MAZE DESCRIPTION CONTAINS:**
1. Room connections (open or locked/closed doors).
2. Door information (open or locked).
3. Key information (location and which doors they unlock).
4. Starting location (Bob's start).
5. Target location (Alice's location).
* **Valid actions:** `start`, `move_to`, `pick_up_key`, `use_key`, `unlock_and_open_door_to`, `rescue`.
* **Action & parameter syntax:**
* Room IDs: Column-Row (e.g., 'A1').
* Key IDs: positive integers (e.g., '1').
* `start`/`move_to`: room ID.
* `pick_up_key`/`use_key`: key ID.
* `unlock_and_open_door_to`: room ID.
* `rescue`: 'Alice'.
* **KEY CONSTRAINTS:**
1. Each move must be between adjacent and connected rooms.
2. Keys must be picked up before use.
3. Locked doors require use of their specific key to unlock.
4. Optimal path minimizes actions/distance.
5. `use_key` action always comes right before `unlock_and_open_door_to`.
6. If the response is missing any intermediate action it is invalid.
* **IMPORTANT:** Use only provided IDs.
* **OUTPUT FORMAT REQUIREMENT:** "Your solution must be formatted as a Python list of tuples representing each action in chronological order."
* Example format: `[('start', 'A1'), ('move_to', 'B1'), ('pick_up_key', '3'), ('use_key', '3'), ('unlock_and_open_door_to', 'C1'), ('rescue', 'Alice')]`
**2. Examples Box Content:**
* **INPUT (FACTS):**
* Room C4 and C3 are connected by an open door.
* Room C3 and D3 are connected by an open door.
* Room D5 and E5 are connected by an open door.
* Room A2 and A1 are connected by an open door.
* Room A3 and B3 are connected by an open door.
* Room A1 and B1 are connected by an open door.
* Room A4 and A3 are connected by an open door.
* Room E5 and E4 are connected by an open door.
* Room D4 and D3 are connected by an open door.
* Room A5 and B5 are connected by an open door.
* Room D4 and E4 are connected by an open door.
* Bob is in room D5.
* Alice is in room C4.
* **OUTPUT:**
`[('start', 'D5'), ('move_to', 'E5'), ('move_to', 'E4'), ('move_to', 'D4'), ('move_to', 'D3'), ('move_to', 'C3'), ('move_to', 'C4'), ('rescue', 'Alice')]`
**3. Reasoning Guidance Box Content:**
* **TO COMPLETE THIS TASK FOLLOW THESE STEPS:**
1. Find the shortest path from Bob to Alice.
2. Identify any locked doors on this path.
3. For each locked door, find its required key.
4. Plan key collection order to ensure you have each key before reaching its door.
5. Track all actions while following the rules.
6. Avoid unnecessary steps that increase the total path length.
* **IF THE PATH SEEMS COMPLEX:**
* Break it into smaller segments.
* Solve each segment separately.
* Combine the solutions while maintaining optimality.
* **Remember** to think step by step and verify each move.
* **Proceed** to provide your solution as a list of tuples in chronological order.
**4. Problem Facts Box Content (The Current Problem):**
* **FACTS:**
* Room A6 and A5 are connected by an open door.
* Room A6 and B6 are connected by an open door.
* Room B6 and C6 are connected by an open door.
* Room C6 and D6 are connected by an open door.
* Room C5 and C4 are connected by an open door.
* Room C4 and D4 are connected by an open door.
* Room D6 and D5 are connected by a closed and locked door.
* The locked door between D6 and D5 requires key 10.
* Key 10 is in room A5.
* Room D6 and E6 are connected by an open door.
* Room D5 and D4 are connected by an open door.
* Room E6 and F6 are connected by an open door.
* Room A4 and A3 are connected by an open door.
* Bob is in room F6.
* Alice is in room C5.
* **YOUR SOLUTION:** [This section is blank, intended for the agent's output.]
### Key Observations
* **Structured Input:** The template enforces a strict separation between the general task rules (Task Description), illustrative examples, problem-solving heuristics (Reasoning Guidance), and the specific problem instance (Problem Facts).
* **Critical Constraint:** The `use_key` action must immediately precede the `unlock_and_open_door_to` action for the same key/door pair.
* **Optimality Requirement:** The solution must be the shortest path, minimizing both actions and distance.
* **Output Rigor:** The solution must be a complete, chronological list of action tuples with no missing intermediate steps.
* **Problem Specifics:** In the given problem, Bob starts at F6 and Alice is at C5. The primary obstacle is a locked door between D6 and D5, which requires Key 10 located in room A5. The agent must plan a route from F6 to A5 to collect the key, then to the D6-D5 door to unlock it, and finally to C5.
### Interpretation
This prompt template is a sophisticated framework for testing or deploying an AI agent's planning and reasoning capabilities in a constrained, symbolic environment. It moves beyond a simple problem statement by embedding:
1. **Meta-Cognition:** The "Reasoning Guidance" section explicitly instructs the agent on *how* to think (break down problems, verify steps), promoting robust chain-of-thought reasoning.
2. **Few-Shot Learning:** The "Examples" section provides a clear demonstration of the expected input-output mapping, reducing ambiguity in the output format.
3. **Formalized Action Space:** By defining precise action syntax and constraints, it creates a verifiable and deterministic environment for the agent's operations.
4. **Hierarchical Problem Decomposition:** The structure encourages the agent to first understand the general rules, then see an example, then adopt a solving strategy, and finally apply all of this to the specific facts. This mirrors effective human problem-solving pedagogy.
The template's design suggests it is intended for evaluating or training AI systems on tasks requiring spatial reasoning, sequential planning, and strict adherence to procedural rules. The inclusion of locked doors and keys adds a layer of dependency management, making the problem non-trivial and requiring look-ahead planning.