|
20 | 20 | logger = logging.getLogger(__name__) |
21 | 21 |
|
22 | 22 | schema = { |
23 | | - "description": "Hippocampal replay: save/restore working state across context compaction events.", |
| 23 | + "description": ( |
| 24 | + "Hippocampal-replay-style save/restore of working state across context " |
| 25 | + "compaction events. 'save' captures the current task, files being " |
| 26 | + "edited, key decisions, open questions, planned next steps, and active " |
| 27 | + "errors as a checkpoint row tied to the current epoch. 'restore' " |
| 28 | + "reconstructs context after compaction by combining the latest " |
| 29 | + "checkpoint with anchored + hot + directory-relevant memories. Use " |
| 30 | + "'save' before risking compaction; use 'restore' immediately after." |
| 31 | + ), |
24 | 32 | "inputSchema": { |
25 | 33 | "type": "object", |
| 34 | + "required": ["action"], |
26 | 35 | "properties": { |
27 | 36 | "action": { |
28 | 37 | "type": "string", |
| 38 | + "description": ( |
| 39 | + "'save' to write a new checkpoint capturing current state; " |
| 40 | + "'restore' to reconstruct context from the active checkpoint " |
| 41 | + "plus relevant memories." |
| 42 | + ), |
29 | 43 | "enum": ["save", "restore"], |
30 | | - "description": "save: create checkpoint. restore: reconstruct context.", |
| 44 | + "examples": ["save", "restore"], |
| 45 | + }, |
| 46 | + "directory": { |
| 47 | + "type": "string", |
| 48 | + "description": "Current working directory the work is happening in.", |
| 49 | + "examples": ["/Users/alice/code/cortex"], |
| 50 | + }, |
| 51 | + "current_task": { |
| 52 | + "type": "string", |
| 53 | + "description": "Brief description of the active task or goal.", |
| 54 | + "examples": [ |
| 55 | + "Fixing recall regression introduced by FlashRank cache change" |
| 56 | + ], |
31 | 57 | }, |
32 | | - "directory": {"type": "string", "description": "Current working directory"}, |
33 | | - "current_task": {"type": "string", "description": "What you're working on"}, |
34 | 58 | "files_being_edited": { |
35 | 59 | "type": "array", |
| 60 | + "description": "Absolute or repo-relative paths of files currently open for editing.", |
36 | 61 | "items": {"type": "string"}, |
37 | | - "description": "Files currently being modified", |
| 62 | + "default": [], |
| 63 | + "examples": [ |
| 64 | + ["mcp_server/core/pg_recall.py", "tests_py/core/test_pg_recall.py"] |
| 65 | + ], |
38 | 66 | }, |
39 | 67 | "key_decisions": { |
40 | 68 | "type": "array", |
| 69 | + "description": "Important decisions made during this session that the next session must respect.", |
41 | 70 | "items": {"type": "string"}, |
42 | | - "description": "Important decisions made this session", |
| 71 | + "default": [], |
| 72 | + "examples": [ |
| 73 | + ["Use HNSW m=16 not IVFFlat", "Defer rerank cache fix to ADR-0043"] |
| 74 | + ], |
43 | 75 | }, |
44 | 76 | "open_questions": { |
45 | 77 | "type": "array", |
| 78 | + "description": "Unresolved questions that block progress.", |
46 | 79 | "items": {"type": "string"}, |
47 | | - "description": "Unresolved questions", |
| 80 | + "default": [], |
| 81 | + "examples": [["Why does R@10 drop on multi-hop queries?"]], |
48 | 82 | }, |
49 | 83 | "next_steps": { |
50 | 84 | "type": "array", |
| 85 | + "description": "Planned next actions, in order.", |
51 | 86 | "items": {"type": "string"}, |
52 | | - "description": "Planned next actions", |
| 87 | + "default": [], |
| 88 | + "examples": [ |
| 89 | + ["Run benchmark on clean DB", "Compare WRRF weights vs paper"] |
| 90 | + ], |
53 | 91 | }, |
54 | 92 | "active_errors": { |
55 | 93 | "type": "array", |
| 94 | + "description": "Errors currently being debugged.", |
56 | 95 | "items": {"type": "string"}, |
57 | | - "description": "Errors currently being debugged", |
| 96 | + "default": [], |
| 97 | + "examples": [["psycopg.OperationalError: connection refused"]], |
58 | 98 | }, |
59 | 99 | "custom_context": { |
60 | 100 | "type": "string", |
61 | | - "description": "Any additional context to preserve", |
| 101 | + "description": "Free-form additional context worth preserving across compaction.", |
| 102 | + }, |
| 103 | + "session_id": { |
| 104 | + "type": "string", |
| 105 | + "description": "Session identifier this checkpoint belongs to. Defaults to 'default'.", |
| 106 | + "default": "default", |
| 107 | + "examples": ["dbaca0ec-b346-464a-84b9-afe97b91d27d"], |
62 | 108 | }, |
63 | | - "session_id": {"type": "string", "description": "Session identifier"}, |
64 | 109 | }, |
65 | | - "required": ["action"], |
66 | 110 | }, |
67 | 111 | } |
68 | 112 |
|
|
0 commit comments