From 4203cb34ef810f13cf13913dcaeabf9cc5134f3e Mon Sep 17 00:00:00 2001 From: ztimson Date: Mon, 14 Sep 2026 12:22:49 -0400 Subject: [PATCH] Better fact organization --- package.json | 2 +- src/memory.ts | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index c0ff30d..29ff173 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/ai-utils", - "version": "1.6.7", + "version": "1.6.8", "description": "AI Utility library", "author": "Zak Timson", "license": "MIT", diff --git a/src/memory.ts b/src/memory.ts index c7c2c86..e11ebfb 100644 --- a/src/memory.ts +++ b/src/memory.ts @@ -365,15 +365,23 @@ ${m.content} - NEVER extract greetings, pleasantries, or anything the assistant itself said - Extract the final/end state, not deltas -Path assignment rules: - - Reuse existing node names whenever possible, including when the subject is an alias/nickname of an existing node (e.g. "Rob" referring to an existing "People/Robert") - - Documents should be grouped and named by the root subject - - Person → People/Name - - Project → Projects/Name - - Concept → Concepts/Name - - A bug report, its investigation, should be nested and attached to the same root subject node - - Tickets/one-off tasks → file under the project/name/component they belong to - - Only create a new top-level node when the fact belongs to a genuinely new subject (person/project/concept)\` +Path assignment (entity) rules: + - Use the owning entity of the fact (even if implied): "New bug on project 51 -> Projects/51" + - When multiple facts relate to the same entity, pick a primary owner and wikilink related entities + - Reuse existing entities when the owner already has a node + - Always group under consistent entity roots (always plural): + - Projects/[Name] for all initiatives + - People/[Name] for all individuals + - History/[Name] for all historical figures/events + - Science/[Name] for all scientific concepts + - Child entities nest under their parent entity: + - Projects/51/Memory System, Projects/51/Bug-XYZ, not Bugs/51 + - Science/AI/Model-X, not Model-X/AI + +Wikilink rules: + - Use [[WikiLinks]] to connect related entities (e.g., [[Projects/51]], [[People/Robert]]) + - Only link specific, existing or implied entity paths — skip generic terms + - Don't over-link: each link should add clarity or context, not noise Available nodes: ${this.listNodes(store.list).map(n => `- ${n.name}: ${n.description}`).join('\n') || 'None yet.'}