@danielmarbach/mnemonic-mcp 0.14.0 → 0.16.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,35 @@ All notable changes to `mnemonic` will be documented in this file.
4
4
 
5
5
  The format is loosely based on Keep a Changelog and uses semver-style version headings.
6
6
 
7
+ ## [0.16.0] - Unreleased
8
+
9
+ ### Added
10
+
11
+ - Bounded 1-hop relationship expansion layer (`src/relationships.ts`): `recall`, `project_memory_summary`, and `get` now surface direct related notes as compact previews, scored by same-project priority, anchor status, recency, and confidence.
12
+ - `recall` automatically attaches relationship previews to top results (top 1 by default, top 3 when result count is small). Previews appear in both text and structured output.
13
+ - `project_memory_summary` orientation entries (`primaryEntry` and `suggestedNext`) include bounded relationship previews, including the fallback primaryEntry when no anchor notes exist.
14
+ - `get` accepts an optional `includeRelationships` parameter; when true, each returned note includes a bounded 1-hop relationship preview in both text and structured output.
15
+
16
+ ### Changed
17
+
18
+ - `RecallResult.results` entries now include an optional `relationships` field (`RelationshipPreview`).
19
+ - `GetResult.notes` entries now include an optional `relationships` field (`RelationshipPreview`).
20
+ - `OrientationNote` now includes an optional `relationships` field (`RelationshipPreview`).
21
+ - `discover_tags` now defaults to note-oriented tag suggestions using title/content/query context, returning bounded `recommendedTags`; broader inventory output is now explicit via `mode: "browse"`.
22
+
23
+ ## [0.15.0] - 2026-03-23
24
+
25
+ ### Added
26
+
27
+ - Projection layer: compact, deterministic derived representations of notes used as embedding input instead of raw title+content. Projections extract title, lifecycle, tags, summary, and headings (h1–h3) into a structured format capped at 1200 characters, improving embedding quality by removing prose noise and markdown formatting.
28
+ - `project_memory_summary` now uses projection summaries for related global note previews when available, falling back to content extraction. Previews are capped at 100 characters for consistent output.
29
+
30
+ ### Changed
31
+
32
+ - All embedding operations (`remember`, `update`, `embedMissingNotes`, `consolidate`) now use `embedTextForNote()` which builds projections on demand and falls back to raw title+content if projection fails. Embeddings are never blocked by projection errors.
33
+ - Projections are stored in `vaultPath/projections/` as JSON files alongside embeddings, gitignored and never synced. Each projection includes `noteId`, `title`, `summary`, `headings`, `tags`, `lifecycle`, `updatedAt` (staleness anchor), `projectionText` (what's embedded), and `generatedAt`.
34
+ - Staleness detection is timestamp-based: a projection is stale when `projection.updatedAt !== note.updatedAt`. No hashing required.
35
+
7
36
  ## [0.14.0] - 2026-03-22
8
37
 
9
38
  ### Added
package/README.md CHANGED
@@ -259,11 +259,13 @@ Two vault types store notes:
259
259
 
260
260
  ```
261
261
  ~/mnemonic-vault/
262
- .gitignore ← auto-created, gitignores embeddings/
262
+ .gitignore ← auto-created, gitignores embeddings/ and projections/
263
263
  notes/
264
264
  setup-notes-a1b2c3.md
265
265
  embeddings/ ← local only, never committed
266
266
  setup-notes-a1b2c3.json
267
+ projections/ ← local only, never committed
268
+ setup-notes-a1b2c3.json
267
269
  ```
268
270
 
269
271
  **Project vault** — project-specific memories committed into the project repo:
@@ -271,11 +273,13 @@ Two vault types store notes:
271
273
  ```
272
274
  <git-root>/
273
275
  .mnemonic/
274
- .gitignore ← auto-created, gitignores embeddings/
276
+ .gitignore ← auto-created, gitignores embeddings/ and projections/
275
277
  notes/
276
278
  auth-bug-fix-d4e5f6.md
277
279
  embeddings/ ← local only, never committed
278
280
  auth-bug-fix-d4e5f6.json
281
+ projections/ ← local only, never committed
282
+ auth-bug-fix-d4e5f6.json
279
283
  ```
280
284
 
281
285
  ### Routing
@@ -339,10 +343,21 @@ We fixed the JWT expiry issue by switching to RS256 and...
339
343
 
340
344
  Content is markdown-linted on `remember`/`update`: fixable issues are auto-corrected before save; non-fixable issues are rejected.
341
345
 
342
- ### Embeddings and migrations
346
+ ### Embeddings and projections
343
347
 
344
348
  Embeddings are generated by Ollama's `/api/embed` with truncation enabled, stored as local JSON alongside notes, and gitignored. `sync` backfills missing embeddings on every run; `sync { force: true }` rebuilds all.
345
349
 
350
+ **Projections** improve embedding quality by extracting structured representations instead of embedding raw markdown. Each note has a projection stored in `projections/<noteId>.json` (also gitignored) containing:
351
+
352
+ - `projectionText`: compact embedding input (max 1200 chars) with title, lifecycle, tags, summary, and h1–h3 headings
353
+ - `summary`: extracted from the first non-heading paragraph, first bullet list, or first 200 chars of body
354
+ - `headings`: up to 8 deduplicated h1–h3 headings (plain text, in order)
355
+ - `updatedAt`: staleness anchor matching the note's updatedAt timestamp
356
+
357
+ Projections are built lazily on first embed and rebuilt when `note.updatedAt !== projection.updatedAt`. No global rebuild needed — staleness is timestamp-based. If projection generation fails, the system falls back to raw `title + content` so embeds never block.
358
+
359
+ ### Migrations
360
+
346
361
  Each vault has its own `config.json` with a `schemaVersion`, so main and project vaults migrate independently:
347
362
 
348
363
  - `list_migrations` reports schema version and pending migrations per vault.
@@ -414,10 +429,10 @@ Imported notes are written to the main vault with `lifecycle: permanent` and `sc
414
429
  |-----------------------------|--------------------------------------------------------------------------|
415
430
  | `consolidate` | Merge multiple notes into one with relationship to sources |
416
431
  | `detect_project` | Resolve `cwd` to stable project id via git remote URL |
417
- | `discover_tags` | List existing tags with usage counts and examples for consistent terminology |
432
+ | `discover_tags` | Suggest canonical tags for a note using title/content/query context; `mode: "browse"` opts into broader inventory output |
418
433
  | `execute_migration` | Execute a named migration (supports dry-run) |
419
434
  | `forget` | Delete note + embedding, git commit + push, cleanup relationships |
420
- | `get` | Fetch one or more notes by exact id |
435
+ | `get` | Fetch one or more notes by exact id; `includeRelationships: true` adds bounded 1-hop previews |
421
436
  | `get_project_identity` | Show effective project identity and remote override |
422
437
  | `get_project_memory_policy` | Show saved write scope, consolidation mode, and protected-branch settings |
423
438
  | `list` | List notes filtered by scope/tags/storage |