mindgraph-mcp 0.19.0 → 0.21.0

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.
Files changed (4) hide show
  1. package/README.md +38 -3
  2. package/dist/cli.js +1385 -247
  3. package/dist/index.js +1142 -197
  4. package/package.json +2 -2
package/README.md CHANGED
@@ -174,7 +174,7 @@ and never block the coding session.
174
174
 
175
175
  ## What You Get
176
176
 
177
- **9 tools** covering the full knowledge-graph workflow (**11** in the coding
177
+ **11 tools** covering the full knowledge-graph workflow (**13** in the coding
178
178
  profile):
179
179
 
180
180
  | Tool | Purpose |
@@ -183,7 +183,9 @@ profile):
183
183
  | `mindgraph_reason` | Claims with evidence, open questions, hypotheses, theories, anomalies |
184
184
  | `mindgraph_commit` | Goals, projects, decisions, options, milestones, and dated decision-context linkage |
185
185
  | `mindgraph_plan` | Plans, tasks, procedures, governance policies, risk assessments, executions |
186
- | `mindgraph_retrieve` | Context retrieval with bounded graph expansion, search, min-cost traversal, document index. Since 0.16.0, read results return as a rendered, token-bounded text block (labels, uids, summaries, epistemic status tags, relationships) — pass `format: "json"` on any call for the raw server response |
186
+ | `mindgraph_retrieve` | Context retrieval with bounded graph expansion, search, min-cost traversal, document index. Read results return as compact rendered text (labels, uids, summaries, epistemic status tags, relationships, traversal depth/cost); set `max_output_chars` for a hard whole-item character budget, or pass `format: "json"` for the raw server response |
187
+ | `mindgraph_memory` | Read-only M0 memory workflow: inspect honest integration status, retrieve bounded topic context, or recover authoritative task-first resume/continuity context. Returns model-ready text plus a structured envelope with scope, hashes, trace, budget, freshness, and warnings |
188
+ | `mindgraph_remember` | Small-text fast path: `remember` stores one fact/preference/decision synchronously and it is BM25- and vector-searchable on return; a stable `custom_id` makes re-sends an upsert of the same memory. `forget` reversibly removes by uid or custom_id, with `dry_run` previewing the affected edge uids |
187
189
  | `mindgraph_series_query` | Bounded, read-only dense-measurement queries: list an entity's Series, inspect latest values, page a time window, or calculate calendar aggregates |
188
190
  | `mindgraph_ingest` | Chunk / document / session ingestion with LLM-powered extraction. `job_status` without an id renders the 20 most recent jobs (`format: "json"` for the full list) |
189
191
  | `mindgraph_synthesize` | Project-scoped cross-document synthesis — mine signals (rendered as sections since 0.17.0), spawn Article-generation jobs |
@@ -205,6 +207,7 @@ Plus **dynamically generated read tools**: when the tenant's active schema decla
205
207
 
206
208
  **Resources** (static + dynamic URIs):
207
209
 
210
+ - `mindgraph://memory/status` — M0 capabilities, adapter state, and explicit automatic-delivery/curator limitations
208
211
  - `mindgraph://stats`, `mindgraph://goals`, `mindgraph://questions`, `mindgraph://contradictions`, `mindgraph://decisions`
209
212
  - `mindgraph://node/{uid}` — a node with all its outgoing and incoming edges
210
213
  - `mindgraph://search/{query}` — BM25 search results
@@ -258,13 +261,31 @@ Once installed, start asking Claude about your knowledge graph naturally:
258
261
  > "Ingest this PDF and extract the main claims."
259
262
  > "Find entities mentioned across multiple project documents, then spin up a synthesis."
260
263
 
264
+ The portable memory workflow can also be invoked explicitly:
265
+
266
+ ```text
267
+ mindgraph_memory {"action":"status"}
268
+ mindgraph_memory {"action":"context","mode":"topic","query":"graph continuation"}
269
+ mindgraph_memory {"action":"context","mode":"resume","project_uid":"project-uid"}
270
+ ```
271
+
272
+ `mindgraph_memory` is intentionally read-only. Existing typed write tools remain
273
+ available for durable facts, corrections, decisions, work transitions, lessons,
274
+ and ingestion. Automatic lifecycle observation and curator mutation are not part
275
+ of M0, and a successful MCP read does not prove the host injected the context.
276
+
261
277
  The server auto-injects your agent identity on every write so you always know which nodes came from your MCP sessions — the same identity the session hooks use for durable-work leases, so work claimed in one harness resumes in the other.
262
278
 
263
279
  ## Architecture
264
280
 
265
281
  This MCP server is a thin wrapper over the [mindgraph](https://www.npmjs.com/package/mindgraph) TypeScript SDK. It exposes cognitive-layer abstractions (Reality, Epistemic, Intent, Action, Memory, Agent) as consolidated tools rather than one-tool-per-endpoint, which keeps the tool surface compact enough for high-quality tool selection by the model.
266
282
 
267
- Search strategy is **keyword-first**: `mindgraph_retrieve` defaults to `action: "context"`, which seeds bounded cheapest-first graph expansion from BM25/hybrid recall. Escalate to `semantic` or `hybrid` only when keywords fail. Set `graph_expansion_limit: 0` when direct-only retrieval is required.
283
+ The proposed application-independent memory contract and its staged delivery plan
284
+ live in [Memory Integration Profile V1](docs/MEMORY-INTEGRATION-PROFILE-V1.md). It
285
+ distinguishes portable MCP compatibility from integrations that provide automatic
286
+ lifecycle observation, context delivery, and managed curation.
287
+
288
+ Search strategy is **keyword-first**: `mindgraph_retrieve` defaults to `action: "context"`, which seeds bounded cheapest-first graph expansion from BM25/hybrid recall. Escalate to `semantic` or `hybrid` only when keywords fail. Set `graph_expansion_limit: 0` when direct-only retrieval is required. For model-facing reads, `max_output_chars` bounds the rendered response from 512 to 24,000 characters while preserving whole evidence items and reporting omissions; `format: "json"` deliberately bypasses that rendering contract.
268
289
 
269
290
  ## Development
270
291
 
@@ -280,3 +301,17 @@ npm run dev # tsup --watch
280
301
  ## License
281
302
 
282
303
  MIT
304
+
305
+ ### Engine failures and retries
306
+
307
+ Tool failures carry `isError: true`; `code`, `status`, and optional `retriable`
308
+ are preserved in both the JSON text and structured content. Lease-conflict fields
309
+ remain available to hooks. A failed retrieval is not an empty successful result.
310
+ Explicit `retriable: false` stops automatic retries, including index maintenance.
311
+ Other 503 responses retry only reviewed reads or atomically keyed work operations.
312
+
313
+ This adoption branch pins the TypeScript SDK to immutable source commit
314
+ `02bad10728836bf55129c08efabf71386432deee` so installs and CI exercise the same
315
+ retry implementation. Git installation builds the SDK through its `prepare` hook.
316
+ Replace this source pin and regenerate the lockfile only after a registry release
317
+ containing that implementation is verified; older SDK releases retry all 503s.