|
| 1 | +## 💡 In Action: Context Restoration |
| 2 | + |
| 3 | +Here represents a real-world log of an AI Agent using **Code Trajectory MCP** to instantly recover context from a previous session without user explanation. |
| 4 | + |
| 5 | +**Scenario:** The user starts a fresh chat and asks to "track progress." The AI has zero prior knowledge of the project's current state. |
| 6 | + |
| 7 | +### 🔄 The Restoration Process |
| 8 | + |
| 9 | +#### 1\. Handshake & Init |
| 10 | + |
| 11 | +The AI identifies the project path and establishes a connection with the MCP. |
| 12 | + |
| 13 | +> **AI Thought:** *"I need to configure Code Trajectory and check the project status."* |
| 14 | +
|
| 15 | +```json |
| 16 | +// Tool Call: configure_project |
| 17 | +{ "path": "c:\\Users\\SynTaek\\...\\syntaek.log" } |
| 18 | + |
| 19 | +// Output |
| 20 | +"Already configured to track: .../syntaek.log" |
| 21 | +``` |
| 22 | + |
| 23 | +#### 2\. Memory Retrieval |
| 24 | + |
| 25 | +The AI calls `get_session_summary` to download the **"Trajectory"** of the previous work session. |
| 26 | + |
| 27 | +```json |
| 28 | +// Tool Call: get_session_summary |
| 29 | +// Output (Provided by MCP) |
| 30 | +{ |
| 31 | + "Time": "2025-12-04 01:16:59 to 02:11:09", |
| 32 | + "Files Modified": [ |
| 33 | + "crates/syntaek-core/src/lib.rs", |
| 34 | + "src/components/Terminal.tsx", |
| 35 | + "src/content/blog/2025-12-04-dev-log.mdx", |
| 36 | + ... (30+ files) |
| 37 | + ], |
| 38 | + "Commit Count": 5 |
| 39 | +} |
| 40 | +``` |
| 41 | + |
| 42 | +#### 3\. Cognition & Analysis |
| 43 | + |
| 44 | +The AI doesn't just see a list of files; it analyzes the trajectory data to reconstruct the **Development Flow**. |
| 45 | + |
| 46 | + * **Timeline Reconstruction:** 01:16 (Blog) -\> 01:39 (Command Palette) -\> 01:46 (Terminal) -\> 02:11 (WASM Integration). |
| 47 | + * **State Assessment:** It recognizes that the last task was consolidated as "Phase 2 Complete" and verifies there are no pending changes (**"Clean State"**). |
| 48 | + |
| 49 | +#### 4\. Result: Perfect Synchronization |
| 50 | + |
| 51 | +The AI reports back with specific details the user never explicitly mentioned in the current chat. |
| 52 | + |
| 53 | +> **AI Response:** |
| 54 | +> "Current status: **Phase 2 (Command Palette, Terminal, Rust WASM)** is complete. |
| 55 | +> The project is in a **stable state** with no pending changes since the last consolidation." |
0 commit comments