agent-planner-mcp 0.3.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENT_GUIDE.md ADDED
@@ -0,0 +1,257 @@
1
+ # AgentPlanner Quick Reference for AI Agents
2
+
3
+ This guide is optimized for AI agents using AgentPlanner MCP tools.
4
+
5
+ ## Core Workflow
6
+
7
+ ```
8
+ 1. suggest_next_tasks(plan_id) → Find ready tasks (dependency-aware)
9
+ 2. get_task_context(node_id, depth=2) → Load progressive context
10
+ 3. Work on tasks (quick_status to track)
11
+ 4. quick_log your progress
12
+ 5. add_learning when you discover something important
13
+ 6. recall_knowledge before making decisions (check cross-plan history)
14
+ ```
15
+
16
+ ## Essential Tools
17
+
18
+ ### Before Starting Work
19
+ ```javascript
20
+ get_context({ plan_id: "..." })
21
+ ```
22
+ Returns: statistics, blocked tasks, in-progress tasks, ready tasks, knowledge
23
+
24
+ ### Update Task Status
25
+ ```javascript
26
+ quick_status({
27
+ task_id: "...",
28
+ plan_id: "...",
29
+ status: "in_progress" // or "completed" or "blocked"
30
+ })
31
+ ```
32
+
33
+ ### Log Progress
34
+ ```javascript
35
+ quick_log({
36
+ task_id: "...",
37
+ plan_id: "...",
38
+ message: "What I did or learned"
39
+ })
40
+ ```
41
+
42
+ ### Check What Needs Attention
43
+ ```javascript
44
+ get_my_tasks({}) // Gets blocked and in-progress across all plans
45
+ check_goals_health({}) // Health dashboard for all goals
46
+ ```
47
+
48
+ ### Claim a Task Before Working
49
+ ```javascript
50
+ claim_task({ task_id: "...", plan_id: "...", ttl_minutes: 30 })
51
+ // When done or abandoning:
52
+ release_task({ task_id: "...", plan_id: "..." })
53
+ ```
54
+
55
+ ## Temporal Knowledge Graph
56
+
57
+ AgentPlanner includes a temporal knowledge graph for persistent, cross-plan knowledge. Five tools for reading and writing knowledge:
58
+
59
+ ### add_learning - Record Knowledge
60
+ Writes to the temporal knowledge graph. Use after research, decisions, and discoveries.
61
+ ```javascript
62
+ add_learning({
63
+ content: "Detailed description of what you learned or decided", // required
64
+ title: "Short title",
65
+ entry_type: "decision", // decision | learning | context | constraint
66
+ plan_id: "...", // optional: link to plan
67
+ node_id: "..." // optional: link to task
68
+ })
69
+ ```
70
+
71
+ ### recall_knowledge - Search Cross-Plan Knowledge
72
+ Searches temporal knowledge graph across ALL plans.
73
+ ```javascript
74
+ recall_knowledge({
75
+ query: "what auth pattern did we choose?", // required
76
+ max_results: 10
77
+ })
78
+ ```
79
+
80
+ ### find_entities - Search Entity Nodes
81
+ Returns entities (technologies, people, patterns) with their relationships from the knowledge graph.
82
+ ```javascript
83
+ find_entities({
84
+ query: "FalkorDB", // required
85
+ max_results: 10
86
+ })
87
+ ```
88
+
89
+ ### check_contradictions - Detect Outdated Facts
90
+ Returns current and superseded facts. Use before making decisions to avoid acting on stale information.
91
+ ```javascript
92
+ check_contradictions({
93
+ query: "deployment strategy", // required
94
+ max_results: 10
95
+ })
96
+ ```
97
+
98
+ ### get_recent_episodes - Temporal History
99
+ Returns recent knowledge episodes in chronological order. Useful for understanding what happened recently.
100
+ ```javascript
101
+ get_recent_episodes({
102
+ max_episodes: 10
103
+ })
104
+ ```
105
+
106
+ ### Knowledge Entry Types
107
+
108
+ | Type | When to Use |
109
+ |------|-------------|
110
+ | `decision` | A choice was made - capture the WHY |
111
+ | `learning` | Something useful discovered |
112
+ | `context` | Background info others need |
113
+ | `constraint` | Rules/limitations to respect |
114
+
115
+ ## Dependencies & Impact Analysis
116
+
117
+ ### suggest_next_tasks - Find Ready Work
118
+ Returns tasks where all upstream blockers are completed, prioritized by RPI chain position and downstream impact.
119
+ ```javascript
120
+ suggest_next_tasks({ plan_id: "..." })
121
+ ```
122
+
123
+ ### get_task_context - Progressive Context Loading
124
+ ```javascript
125
+ get_task_context({
126
+ node_id: "...",
127
+ depth: 2, // 1=task only, 2=+siblings+deps, 3=+knowledge, 4=+plan+goals
128
+ token_budget: 0 // 0=unlimited, or max tokens to stay within context window
129
+ })
130
+ ```
131
+
132
+ ### create_dependency - Link Tasks
133
+ ```javascript
134
+ create_dependency({
135
+ plan_id: "...",
136
+ source_node_id: "...", // this node...
137
+ target_node_id: "...", // ...blocks this node
138
+ dependency_type: "blocks" // blocks | requires | relates_to
139
+ })
140
+ ```
141
+
142
+ ### analyze_impact - What-If Analysis
143
+ ```javascript
144
+ analyze_impact({
145
+ plan_id: "...",
146
+ node_id: "...",
147
+ scenario: "block" // delay | block | remove
148
+ })
149
+ ```
150
+
151
+ ## RPI Chains (Research -> Plan -> Implement)
152
+
153
+ For complex tasks, decompose into a 3-step chain with blocking dependencies:
154
+
155
+ ```javascript
156
+ create_rpi_chain({
157
+ plan_id: "...",
158
+ parent_id: "...", // phase to add chain under
159
+ title: "Auth Service",
160
+ research_description: "Research auth patterns for microservices"
161
+ })
162
+ ```
163
+
164
+ Creates 3 tasks:
165
+ - **Research** (R) - Investigate, log findings
166
+ - **Plan** (P) - Design approach, mark `plan_ready` for human review
167
+ - **Implement** (I) - Build it (automatically gets compacted research context)
168
+
169
+ Task modes: `research`, `plan`, `implement`, `free`
170
+
171
+ ## Task Status Values
172
+
173
+ | Status | When to Use |
174
+ |--------|-------------|
175
+ | `not_started` | Default - work hasn't begun |
176
+ | `in_progress` | You're actively working on it |
177
+ | `completed` | Done and verified |
178
+ | `blocked` | Can't proceed - **always add a note explaining why** |
179
+ | `plan_ready` | Plan phase complete - waiting for human review |
180
+
181
+ ## Creating Plans
182
+
183
+ ### Quick (Most Common)
184
+ ```javascript
185
+ quick_plan({
186
+ title: "Plan Name",
187
+ tasks: ["Task 1", "Task 2", "Task 3"]
188
+ })
189
+ ```
190
+
191
+ ### From Markdown
192
+ ```javascript
193
+ import_plan_markdown({
194
+ markdown: `
195
+ # Plan Title
196
+
197
+ ## Phase 1
198
+ - Task A
199
+ - Task B
200
+
201
+ ## Phase 2
202
+ - Task C
203
+ `
204
+ })
205
+ ```
206
+
207
+ ## Linking Plans to Goals
208
+
209
+ ```javascript
210
+ list_goals({})
211
+ link_plan_to_goal({ goal_id: "...", plan_id: "..." })
212
+ ```
213
+
214
+ ## When Stuck
215
+
216
+ ```javascript
217
+ quick_status({
218
+ task_id: "...",
219
+ plan_id: "...",
220
+ status: "blocked",
221
+ note: "Need X from human - waiting for access credentials"
222
+ })
223
+ ```
224
+
225
+ Then move to another task - a human will see the blocker.
226
+
227
+ ## Autonomous Goal-Driven Loop (Quick Reference)
228
+
229
+ For periodic/cron-driven agents, follow this 5-phase pattern:
230
+
231
+ ```
232
+ Phase 1: ORIENT → check_goals_health()
233
+ Phase 2: PLAN → get_goal() → recall_knowledge() → quick_plan({..., goal_id})
234
+ Phase 3: DECOMPOSE→ create_rpi_chain() for complex tasks
235
+ Phase 4: EXECUTE → suggest_next_tasks() → claim_task() → work → quick_log() → quick_status("completed")
236
+ Phase 5: REPORT → quick_log({..., log_type: "completion"})
237
+ ```
238
+
239
+ Key rules:
240
+ - **Always claim before working** — `claim_task()` prevents agent collisions
241
+ - **Always link plans to goals** — enables health tracking
242
+ - **Log decisions and learnings** — `add_learning()` persists cross-plan
243
+ - **Check contradictions first** — `check_contradictions()` before acting on old knowledge
244
+
245
+ ## Best Practices
246
+
247
+ 1. **Use `get_task_context` instead of `get_context`** - progressive depth gives you exactly what you need
248
+ 2. **Check dependencies before starting** - use `suggest_next_tasks` to find what's ready
249
+ 3. **Log as you work** - helps humans and future agents follow
250
+ 4. **Record important findings** - use `add_learning` after research, decisions, and discoveries
251
+ 5. **Search before deciding** - check `recall_knowledge` for existing decisions across all plans
252
+ 6. **Check for contradictions** - use `check_contradictions` before acting on remembered facts
253
+ 7. **Mark blockers clearly** - use `status: "blocked"` with explanation
254
+
255
+ ---
256
+
257
+ **Remember**: AgentPlanner is your persistent memory and coordination tool. Use it to track what you're doing, remember what you learned, coordinate with humans, and help future agents understand context.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Talking Agents Oy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.