# Technical Document Extraction: LLM Agent Prompt and Trajectory Structure
This image is a technical diagram illustrating the structured components of a Large Language Model (LLM) prompt and the subsequent iterative trajectory for solving a software engineering task.
## 1. Component Isolation
The diagram is organized vertically into three primary segments:
* **Header (Prompt Configuration):** Three large, black-bordered blocks defining the initial context.
* **Main Trajectory (Iterative Loop):** A series of alternating blue and orange bars representing the interaction between the agent and the environment.
* **Footer (Output):** A final yellow block representing the resulting artifact.
---
## 2. Detailed Content Transcription
### Region 1: Prompt Configuration (Header)
These blocks establish the "System" and "User" context before the agent begins work.
| Block Title | Content / Bullet Points |
| :--- | :--- |
| **System Prompt** | • Describe environment and commands<br>• Specify response format |
| **Demonstration** | Full trajectory of a successful example |
| **Issue statement** | • Give reported issue description<br>• Instructions to resolve issue<br>• High-level strategy tips |
### Region 2: Iterative Trajectory (Main Chart)
This section depicts a ReAct-style (Reasoning and Acting) loop. The colors indicate the source of the information.
* **Blue Outlined Bars (Agent Output):** Labeled **"Thought & Action"**. These represent the model's internal reasoning and the command it chooses to execute.
* **Orange Outlined Bars (Environment Output):** Labeled **"Environment Response"**.
* The first two orange bars feature a diagonal grey-striped pattern and are labeled **"(collapsed)"**, indicating historical context that may be truncated or summarized.
* A vertical ellipsis (**⋮**) indicates that this loop repeats multiple times.
* The final orange bar is solid, labeled **"Environment Response"**, representing the most recent feedback.
* **Final Blue Bar:** Labeled **"Submit"**, indicating the agent has completed the task.
### Region 3: Resulting Artifact (Footer)
A yellow-shaded block representing the final output of the process.
| Label | Text Content (Code/Diff) |
| :--- | :--- |
| **Patch File** | `diff --git a/src/sqlfluff/rules/L060.py` <br> `b/src/sqlfluff/rules/L060.py` <br> `--- a/src/sqlfluff/rules/L060.py` <br> `+++ b/src/sqlfluff/rules/L060.py` |
---
## 3. Flow and Logic Analysis
1. **Initialization:** The process begins with a comprehensive **System Prompt**, a **Demonstration** (few-shot learning), and the specific **Issue statement**.
2. **The Loop:** The agent enters a cycle of **Thought & Action** (Blue) followed by an **Environment Response** (Orange).
* *Trend:* The diagram shows that earlier responses are "collapsed" to manage context window limits, while the most recent response remains fully visible.
3. **Termination:** Once the agent determines the issue is resolved, it issues a **Submit** command.
4. **Output:** The final result is a **Patch File**, specifically shown as a git diff targeting a Python file in the `sqlfluff` library (`L060.py`).
## 4. Technical Metadata
* **Language:** English (100%).
* **Visual Coding:**
* **Black Borders:** Static prompt instructions.
* **Blue Borders:** Agent-generated content.
* **Orange Borders:** System/Environment-generated feedback.
* **Yellow Background:** Final data product/artifact.