knowmind 0.3.8 → 0.3.9

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
@@ -1,5 +1,27 @@
1
1
  # Knowmind CLI — Änderungen
2
2
 
3
+ ## 0.3.9 (2026-10-10)
4
+
5
+ **`knowmind sync` hält umbenannte Dateien zusammen**
6
+
7
+ - Benennen Sie eine Datei um, bleibt sie dasselbe Dokument, statt als zweites
8
+ daneben zu erscheinen. `knowmind sync` erkennt sie, wenn die Datei unter dem
9
+ alten Namen nicht mehr da ist: am `name:` im Kopf der Datei, fehlt dieser, am
10
+ gleichen Inhalt.
11
+ - Jeder Upload über `knowmind sync` nennt seine Quelldatei, als Kennung des
12
+ Ordners und Pfad darin; der vollständige Pfad auf Ihrem Rechner geht nicht
13
+ hinaus. Knowmind ordnet eine neue Fassung damit auch dann der alten zu, wenn
14
+ sich der Titel des Dokuments geändert hat. Zwei Ordner mit gleichnamigen
15
+ Dateien bleiben getrennt.
16
+ - Die mitgelieferte Werkzeugliste trägt den Stand des Servers vom 10. Oktober.
17
+ Neu sind zwei Werkzeuge: `knowmind_list_inferred` listet Beziehungen, die
18
+ auf die Entscheidung eines Menschen warten; mit `knowmind_review_inferred`
19
+ bestätigen Sie eine solche Beziehung, lehnen sie ab oder nehmen eine Ablehnung
20
+ zurück.
21
+ `knowmind_link` und `knowmind_link_entities` verlangen jetzt einen Beleg
22
+ (`evidence`).
23
+ - Verbesserungen der Stabilität.
24
+
3
25
  ## 0.3.8 (2026-10-08)
4
26
 
5
27
  - Die mitgelieferte Werkzeugliste trägt den Stand des Servers vom 8. Oktober:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knowmind",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "mcpName": "io.github.Schubeler-Consulting/knowmind",
5
5
  "description": "Knowmind — das Agentengehirn aus Deutschland: CLI + MCP-Server (Langzeitgedächtnis & Wissensgraph für Ihre KI, Server in Deutschland).",
6
6
  "type": "module",
package/src/client.js CHANGED
@@ -118,6 +118,9 @@ export async function uploadDocument(title, content, opts = {}) {
118
118
  // documentId, geht sie als replaceDocumentId mit — der Server ersetzt damit
119
119
  // genau diese Alt-Version, titelunabhaengig (verhindert Titel-Dubletten).
120
120
  if (opts.replaceDocumentId) body.replaceDocumentId = opts.replaceDocumentId;
121
+ // Quelldatei relativ zum Ordner: Der Server findet darüber die Fassung
122
+ // derselben Datei, auch wenn sich der Titel geändert hat.
123
+ if (opts.sourcePath) body.sourcePath = opts.sourcePath;
121
124
 
122
125
  const r = await fetch(`${apiUrl}/api/documents`, {
123
126
  method: "POST",
package/src/sync.js CHANGED
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import { readFileSync, readdirSync, statSync, writeFileSync, existsSync } from "node:fs";
14
14
  import { join, relative, basename, extname } from "node:path";
15
- import { createHash } from "node:crypto";
15
+ import { createHash, randomUUID } from "node:crypto";
16
16
  import { uploadDocument } from "./client.js";
17
17
 
18
18
  const DEFAULT_EXTENSIONS = [".md", ".markdown", ".txt"];
@@ -62,6 +62,35 @@ function saveManifest(path, manifest) {
62
62
  writeFileSync(path, JSON.stringify(manifest, null, 2));
63
63
  }
64
64
 
65
+ /** `name:` aus dem Frontmatter — die stabile Kennung einer Memory-Datei, unabhängig vom Dateinamen. */
66
+ export function frontmatterName(content) {
67
+ const m = /^---\r?\n([\s\S]*?)\r?\n---/.exec(content);
68
+ if (!m) return null;
69
+ const z = /^name:\s*(.+?)\s*$/m.exec(m[1]);
70
+ return z ? z[1].replace(/^["']|["']$/g, "") : null;
71
+ }
72
+
73
+ /**
74
+ * Vorgänger einer Datei, deren Pfad das Manifest nicht kennt: ein Eintrag,
75
+ * dessen Datei es nicht mehr gibt und der dieselbe Sache ist — gleicher
76
+ * Frontmatter-Name oder, ohne Namen, gleicher Inhalt. So bleibt eine
77
+ * umbenannte Datei dasselbe Dokument (B3, 10.10.2026: fünf Paare aus
78
+ * Bindestrich gegen Unterstrich).
79
+ */
80
+ export function vorgaengerFinden(manifest, rel, name, hash, gibtEs) {
81
+ for (const [alt, eintrag] of Object.entries(manifest.files)) {
82
+ if (alt === rel || !eintrag?.documentId || gibtEs(alt)) continue;
83
+ if (name ? eintrag.name === name : eintrag.sha256 === hash) return alt;
84
+ }
85
+ return null;
86
+ }
87
+
88
+ /** Quellpfad am Server: Ordnerkennung aus dem Manifest plus relativer Pfad. */
89
+ export function quellpfad(manifest, rel) {
90
+ if (!manifest.quelle) manifest.quelle = randomUUID();
91
+ return `${manifest.quelle}/${rel}`;
92
+ }
93
+
65
94
  function deriveTitle(content, filePath) {
66
95
  const m = content.match(/^#\s+(.+)$/m);
67
96
  if (m) return m[1].trim();
@@ -77,6 +106,10 @@ export async function syncDirectory(dir, options = {}) {
77
106
  const exts = options.extensions ?? DEFAULT_EXTENSIONS;
78
107
  const manifestPath = join(dir, MANIFEST_NAME);
79
108
  const manifest = loadManifest(manifestPath);
109
+ // Eigene Kennung je Ordner: Der Quellpfad am Server ist `<Kennung>/<Pfad>`,
110
+ // damit zwei Ordner mit je einer README.md im selben Arbeitsbereich
111
+ // getrennt bleiben. Der lokale Pfad selbst geht nicht hinaus.
112
+ if (!manifest.quelle) manifest.quelle = randomUUID();
80
113
 
81
114
  const files = [...walk(dir, exts)].sort();
82
115
  const total = files.length;
@@ -94,10 +127,21 @@ export async function syncDirectory(dir, options = {}) {
94
127
  if (basename(file) === MANIFEST_NAME) continue;
95
128
  const content = readFileSync(file, "utf-8");
96
129
  const hash = sha256(content);
97
- const known = manifest.files[rel];
130
+ const name = frontmatterName(content);
131
+ let known = manifest.files[rel];
132
+ let umbenanntVon = null;
133
+ if (!known) {
134
+ umbenanntVon = vorgaengerFinden(manifest, rel, name, hash, (r) => existsSync(join(dir, r)));
135
+ if (umbenanntVon) known = { ...manifest.files[umbenanntVon], sha256: null };
136
+ }
98
137
 
99
138
  if (known && known.sha256 === hash) {
100
139
  skipped += 1;
140
+ // Name nachtragen (das Manifest wird am Ende gespeichert), damit eine
141
+ // spätere Umbenennung erkannt wird.
142
+ if (name && known.name !== name) {
143
+ known.name = name;
144
+ }
101
145
  if (options.verbose) console.log(` skip ${rel}`);
102
146
  continue;
103
147
  }
@@ -106,6 +150,7 @@ export async function syncDirectory(dir, options = {}) {
106
150
  try {
107
151
  const result = await uploadDocument(title, content, {
108
152
  replaceDocumentId: known?.documentId ?? undefined,
153
+ sourcePath: quellpfad(manifest, rel),
109
154
  });
110
155
  uploaded += 1;
111
156
  // Server antwortet bei sha-identischem Inhalt mit unchanged:true
@@ -116,13 +161,15 @@ export async function syncDirectory(dir, options = {}) {
116
161
  documentId: result.id ?? null,
117
162
  lastSync: new Date().toISOString(),
118
163
  duplicate: isDuplicate,
164
+ ...(name ? { name } : {}),
119
165
  };
166
+ if (umbenanntVon) delete manifest.files[umbenanntVon];
120
167
  // Manifest nach JEDEM erfolgreichen Upload speichern (2026-06-10):
121
168
  // Der Stop-Hook killt den Sync nach 120 s — mit 10er-Batches gingen
122
169
  // Manifest-Stände verloren und identischer Inhalt wurde endlos
123
170
  // re-POSTet (Ursache der Ingest-500-Schleife 26.–27.05.).
124
171
  saveManifest(manifestPath, manifest);
125
- const flag = isDuplicate ? "dup " : "new ";
172
+ const flag = umbenanntVon ? "ren " : isDuplicate ? "dup " : "new ";
126
173
  process.stdout.write(` [${scanned}/${total}] ${flag} ${rel}\n`);
127
174
  } catch (e) {
128
175
  failed += 1;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "_hinweis": "Rückfall für tools/list, wenn die Discovery nicht erreichbar ist. Erzeugt aus https://knowmind.de/api/mcp/v1. Abgleich: npm run tools:abgleich",
3
- "stand": "2026-10-08",
3
+ "stand": "2026-10-10",
4
4
  "quelle": "https://knowmind.de/api/mcp/v1",
5
5
  "protocolVersion": "2025-06-18",
6
6
  "tools": [
@@ -363,7 +363,7 @@
363
363
  "idempotentHint": true,
364
364
  "openWorldHint": false
365
365
  },
366
- "description": "Create a typed relation between two memory nodes (a knowledge-graph edge). THIS IS HOW THE GRAPH IS BUILT: after storing memories, connect them - a corpus without edges answers only what a single note already says. Subject and object classes must match the predicate; the inverse edge is materialized automatically, and derived edges (RUNS_ON, WORKS_FOR_CLIENT, HOST_SERVES_CLIENT, DEPENDS_ON_SUPPLIER) are computed by the server - never set them by hand. Get both node IDs via knowmind_recall first, and call knowmind_schema for the full catalogue with explanations. Allowed rel_type values: ABOUT (Contract|Document|FileResource → Topic), ASSIGNED_TO (ActionRecord|Task → Agent|Organization|Person|SoftwareAgent), CLIENT_OF (Agent|Organization|Person|SoftwareAgent → Organization), CONTACT_PERSON_FOR (Person → Organization), COVERED_BY (Topic → Contract|Document|FileResource), DELIVERED_AS (Application → Product), DELIVERED_BY (Product → Application), DEPENDS_ON (Application → Application), DEPLOYED_TO (Application → Container), DEVELOPED_BY (Application → Agent|Organization|Person|SoftwareAgent), DEVELOPS (Agent|Organization|Person|SoftwareAgent → Application), ENABLES (Application → Application), FOR_CLIENT (Project → Agent|Organization|Person|SoftwareAgent), HAS_ASSIGNED_TASK (Agent|Organization|Person|SoftwareAgent → ActionRecord|Task), HAS_CHILD (Person → Person), HAS_CLIENT (Organization → Agent|Organization|Person|SoftwareAgent), HAS_CONTACT_PERSON (Organization → Person), HAS_EMPLOYEE (Organization → Person), HAS_OPERATED_APPLICATION (Agent|Organization|Person|SoftwareAgent → Application), HAS_PARENT (Person → Person), HAS_PREDECESSOR (ActionRecord|Project|Task → ActionRecord|Project|Task), HAS_PROJECT (Agent|Organization|Person|SoftwareAgent → Project), HAS_ROLE (Person → Role), HAS_SIBLING (Person → Person), HAS_SKILL (Agent|Organization|Person|SoftwareAgent → Skill), HAS_SUCCESSOR (ActionRecord|Project|Task → ActionRecord|Project|Task), HOSTED_ON (Container → Host), HOSTS (Host → Container), HOSTS_APPLICATION (Container → Application), INFRASTRUCTURE_PROVIDED_BY (Host → Organization), INTEGRATES_WITH (Application → Application), IS_LED_BY (Organization → Person), KNOWS (Person → Person), LEADS (Person → Organization), OPERATED_FOR (Application → Agent|Organization|Person|SoftwareAgent), PAID_BY (Agent|Organization|Person|SoftwareAgent → Agent|Organization|Person|SoftwareAgent), PARTNER_OF (Organization → Organization), PAYS (Agent|Organization|Person|SoftwareAgent → Agent|Organization|Person|SoftwareAgent), PRODUCED_BY (Contract|Document|FileResource → Project), PRODUCES (Project → Contract|Document|FileResource), PROVIDES_INFRASTRUCTURE (Organization → Host), ROLE_OF (Role → Person), SERVED_UNDER (Application → Domain), SERVES (Domain → Application), SKILL_OF (Skill → Agent|Organization|Person|SoftwareAgent), SPOUSE_OF (Person → Person), SUPPLIED_BY (Agent|Organization|Person|SoftwareAgent → Organization), SUPPLIES (Organization → Agent|Organization|Person|SoftwareAgent), SUPPLIES_TECHNOLOGY (Organization → Technology), SUPPORTED_BY (Contract|Document|FileResource → Contract|Document|FileResource), SUPPORTS (Contract|Document|FileResource → Contract|Document|FileResource), TECHNOLOGY_SUPPLIED_BY (Technology → Organization), TECHNOLOGY_USED_BY (Technology → Application), USES_TECHNOLOGY (Application → Technology), WORKED_ON_BY (Project → Agent|Organization|Person|SoftwareAgent), WORKS_FOR (Person → Organization), WORKS_ON (Agent|Organization|Person|SoftwareAgent → Project). Requires write scope.",
366
+ "description": "Create a typed relation between two memory nodes (a knowledge-graph edge). THIS IS HOW THE GRAPH IS BUILT: after storing memories, connect them - a corpus without edges answers only what a single note already says. The server checks the edge against the ontology's shapes before writing it: the subject and object must belong to the classes the predicate requires (for entries without a class the check only warns), entity names must carry no role or suffix, and the edge must name its evidence - the id of the entry that states the relation. A rejected edge returns the violated rule. The inverse edge is materialized automatically, and derived edges (RUNS_ON, WORKS_FOR_CLIENT, HOST_SERVES_CLIENT, DEPENDS_ON_SUPPLIER) are computed by the server - never set them by hand. Get both node IDs via knowmind_recall first, and call knowmind_schema for the full catalogue with explanations. Allowed rel_type values: ABOUT (Contract|Document|FileResource → Topic), ASSIGNED_TO (ActionRecord|Task → Agent|Organization|Person|SoftwareAgent), CLIENT_OF (Agent|Organization|Person|SoftwareAgent → Organization), CONTACT_PERSON_FOR (Person → Organization), COVERED_BY (Topic → Contract|Document|FileResource), DELIVERED_AS (Application → Product), DELIVERED_BY (Product → Application), DEPENDS_ON (Application → Application), DEPLOYED_TO (Application → Container), DEVELOPED_BY (Application → Agent|Organization|Person|SoftwareAgent), DEVELOPS (Agent|Organization|Person|SoftwareAgent → Application), ENABLES (Application → Application), FOR_CLIENT (Project → Agent|Organization|Person|SoftwareAgent), HAS_ASSIGNED_TASK (Agent|Organization|Person|SoftwareAgent → ActionRecord|Task), HAS_CHILD (Person → Person), HAS_CLIENT (Organization → Agent|Organization|Person|SoftwareAgent), HAS_CONTACT_PERSON (Organization → Person), HAS_EMPLOYEE (Organization → Person), HAS_OPERATED_APPLICATION (Agent|Organization|Person|SoftwareAgent → Application), HAS_PARENT (Person → Person), HAS_PREDECESSOR (ActionRecord|Project|Task → ActionRecord|Project|Task), HAS_PROJECT (Agent|Organization|Person|SoftwareAgent → Project), HAS_ROLE (Person → Role), HAS_SIBLING (Person → Person), HAS_SKILL (Agent|Organization|Person|SoftwareAgent → Skill), HAS_SUCCESSOR (ActionRecord|Project|Task → ActionRecord|Project|Task), HOSTED_ON (Container → Host), HOSTS (Host → Container), HOSTS_APPLICATION (Container → Application), INFRASTRUCTURE_PROVIDED_BY (Host → Organization), INTEGRATES_WITH (Application → Application), IS_LED_BY (Organization → Person), KNOWS (Person → Person), LEADS (Person → Organization), OPERATED_FOR (Application → Agent|Organization|Person|SoftwareAgent), PAID_BY (Agent|Organization|Person|SoftwareAgent → Agent|Organization|Person|SoftwareAgent), PARTNER_OF (Organization → Organization), PAYS (Agent|Organization|Person|SoftwareAgent → Agent|Organization|Person|SoftwareAgent), PRODUCED_BY (Contract|Document|FileResource → Project), PRODUCES (Project → Contract|Document|FileResource), PROVIDES_INFRASTRUCTURE (Organization → Host), ROLE_OF (Role → Person), SERVED_UNDER (Application → Domain), SERVES (Domain → Application), SKILL_OF (Skill → Agent|Organization|Person|SoftwareAgent), SPOUSE_OF (Person → Person), SUPPLIED_BY (Agent|Organization|Person|SoftwareAgent → Organization), SUPPLIES (Organization → Agent|Organization|Person|SoftwareAgent), SUPPLIES_TECHNOLOGY (Organization → Technology), SUPPORTED_BY (Contract|Document|FileResource → Contract|Document|FileResource), SUPPORTS (Contract|Document|FileResource → Contract|Document|FileResource), TECHNOLOGY_SUPPLIED_BY (Technology → Organization), TECHNOLOGY_USED_BY (Technology → Application), USES_TECHNOLOGY (Application → Technology), WORKED_ON_BY (Project → Agent|Organization|Person|SoftwareAgent), WORKS_FOR (Person → Organization), WORKS_ON (Agent|Organization|Person|SoftwareAgent → Project). Requires write scope.",
367
367
  "inputSchema": {
368
368
  "type": "object",
369
369
  "properties": {
@@ -382,12 +382,17 @@
382
382
  "confidence": {
383
383
  "type": "number",
384
384
  "description": "Edge confidence in [0..1]; 1.0 for a fact stated verbatim, 0.7 for a clear paraphrase. Below that, do not create the edge."
385
+ },
386
+ "evidence": {
387
+ "type": "string",
388
+ "description": "Memory ID of the entry that states this relation (often from_id or a note found via knowmind_recall). Required: an edge without evidence is rejected."
385
389
  }
386
390
  },
387
391
  "required": [
388
392
  "from_id",
389
393
  "to_id",
390
- "rel_type"
394
+ "rel_type",
395
+ "evidence"
391
396
  ]
392
397
  }
393
398
  },
@@ -462,6 +467,81 @@
462
467
  ]
463
468
  }
464
469
  },
470
+ {
471
+ "name": "knowmind_list_inferred",
472
+ "annotations": {
473
+ "title": "List inferred relations",
474
+ "readOnlyHint": true,
475
+ "destructiveHint": false,
476
+ "idempotentHint": true,
477
+ "openWorldHint": false
478
+ },
479
+ "description": "List relations that wait for a human decision, each with its review state (open, confirmed, rejected) and its reason: inferred_from_text (knowmind inferred it from a text) or starts_from_document (it starts from a document although its kind needs a person, organisation or similar). Per relation also the two connected entries, where it came from (source), the entry that supports it (evidence), and the counts per state. Open relations do not feed the derivation rules until someone confirms them. Use to review what the graph learned on its own; record a decision with knowmind_review_inferred. Read scope suffices.",
480
+ "inputSchema": {
481
+ "type": "object",
482
+ "properties": {
483
+ "status": {
484
+ "type": "string",
485
+ "enum": [
486
+ "open",
487
+ "confirmed",
488
+ "rejected"
489
+ ],
490
+ "description": "Only relations in this state. Omit for all."
491
+ },
492
+ "limit": {
493
+ "type": "integer",
494
+ "minimum": 1,
495
+ "maximum": 200,
496
+ "default": 50,
497
+ "description": "Number of relations to return (1-200, default 50)."
498
+ },
499
+ "offset": {
500
+ "type": "integer",
501
+ "minimum": 0,
502
+ "default": 0,
503
+ "description": "Relations to skip, for paging."
504
+ }
505
+ }
506
+ }
507
+ },
508
+ {
509
+ "name": "knowmind_review_inferred",
510
+ "annotations": {
511
+ "title": "Review inferred relation",
512
+ "readOnlyHint": false,
513
+ "destructiveHint": false,
514
+ "idempotentHint": false,
515
+ "openWorldHint": false
516
+ },
517
+ "description": "Record a human decision on one inferred relation from knowmind_list_inferred. confirm: the relation counts as checked and feeds the derivation rules from now on. reject: the relation, its reverse relation and every relation derived from it get valid_to=now; nothing is deleted. undo: takes a rejection back and restores the reverse and derived relations. Pass the edge_id from the list and, if there is one, the id of the entry that supports the decision as evidence. Returns the state before and after and the number of reverse and derived relations affected. Requires write scope.",
518
+ "inputSchema": {
519
+ "type": "object",
520
+ "properties": {
521
+ "edge_id": {
522
+ "type": "string",
523
+ "description": "edge_id of the relation, as returned by knowmind_list_inferred."
524
+ },
525
+ "decision": {
526
+ "type": "string",
527
+ "enum": [
528
+ "confirm",
529
+ "reject",
530
+ "undo"
531
+ ],
532
+ "description": "confirm, reject, or undo a rejection."
533
+ },
534
+ "evidence": {
535
+ "type": "string",
536
+ "description": "Id of the entry that supports the decision. Optional."
537
+ }
538
+ },
539
+ "required": [
540
+ "edge_id",
541
+ "decision"
542
+ ]
543
+ }
544
+ },
465
545
  {
466
546
  "name": "knowmind_recall",
467
547
  "annotations": {
@@ -577,7 +657,7 @@
577
657
  "idempotentHint": true,
578
658
  "openWorldHint": false
579
659
  },
580
- "description": "DEPRECATED, removed on 2027-03-31: use knowmind_link_entities. This name keeps answering unchanged until then. Create a typed relation between two memory nodes (a knowledge-graph edge). THIS IS HOW THE GRAPH IS BUILT: after storing memories, connect them - a corpus without edges answers only what a single note already says. Subject and object classes must match the predicate; the inverse edge is materialized automatically, and derived edges (RUNS_ON, WORKS_FOR_CLIENT, HOST_SERVES_CLIENT, DEPENDS_ON_SUPPLIER) are computed by the server - never set them by hand. Get both node IDs via knowmind_recall first, and call knowmind_schema for the full catalogue with explanations. Allowed rel_type values: ABOUT (Contract|Document|FileResource → Topic), ASSIGNED_TO (ActionRecord|Task → Agent|Organization|Person|SoftwareAgent), CLIENT_OF (Agent|Organization|Person|SoftwareAgent → Organization), CONTACT_PERSON_FOR (Person → Organization), COVERED_BY (Topic → Contract|Document|FileResource), DELIVERED_AS (Application → Product), DELIVERED_BY (Product → Application), DEPENDS_ON (Application → Application), DEPLOYED_TO (Application → Container), DEVELOPED_BY (Application → Agent|Organization|Person|SoftwareAgent), DEVELOPS (Agent|Organization|Person|SoftwareAgent → Application), ENABLES (Application → Application), FOR_CLIENT (Project → Agent|Organization|Person|SoftwareAgent), HAS_ASSIGNED_TASK (Agent|Organization|Person|SoftwareAgent → ActionRecord|Task), HAS_CHILD (Person → Person), HAS_CLIENT (Organization → Agent|Organization|Person|SoftwareAgent), HAS_CONTACT_PERSON (Organization → Person), HAS_EMPLOYEE (Organization → Person), HAS_OPERATED_APPLICATION (Agent|Organization|Person|SoftwareAgent → Application), HAS_PARENT (Person → Person), HAS_PREDECESSOR (ActionRecord|Project|Task → ActionRecord|Project|Task), HAS_PROJECT (Agent|Organization|Person|SoftwareAgent → Project), HAS_ROLE (Person → Role), HAS_SIBLING (Person → Person), HAS_SKILL (Agent|Organization|Person|SoftwareAgent → Skill), HAS_SUCCESSOR (ActionRecord|Project|Task → ActionRecord|Project|Task), HOSTED_ON (Container → Host), HOSTS (Host → Container), HOSTS_APPLICATION (Container → Application), INFRASTRUCTURE_PROVIDED_BY (Host → Organization), INTEGRATES_WITH (Application → Application), IS_LED_BY (Organization → Person), KNOWS (Person → Person), LEADS (Person → Organization), OPERATED_FOR (Application → Agent|Organization|Person|SoftwareAgent), PAID_BY (Agent|Organization|Person|SoftwareAgent → Agent|Organization|Person|SoftwareAgent), PARTNER_OF (Organization → Organization), PAYS (Agent|Organization|Person|SoftwareAgent → Agent|Organization|Person|SoftwareAgent), PRODUCED_BY (Contract|Document|FileResource → Project), PRODUCES (Project → Contract|Document|FileResource), PROVIDES_INFRASTRUCTURE (Organization → Host), ROLE_OF (Role → Person), SERVED_UNDER (Application → Domain), SERVES (Domain → Application), SKILL_OF (Skill → Agent|Organization|Person|SoftwareAgent), SPOUSE_OF (Person → Person), SUPPLIED_BY (Agent|Organization|Person|SoftwareAgent → Organization), SUPPLIES (Organization → Agent|Organization|Person|SoftwareAgent), SUPPLIES_TECHNOLOGY (Organization → Technology), SUPPORTED_BY (Contract|Document|FileResource → Contract|Document|FileResource), SUPPORTS (Contract|Document|FileResource → Contract|Document|FileResource), TECHNOLOGY_SUPPLIED_BY (Technology → Organization), TECHNOLOGY_USED_BY (Technology → Application), USES_TECHNOLOGY (Application → Technology), WORKED_ON_BY (Project → Agent|Organization|Person|SoftwareAgent), WORKS_FOR (Person → Organization), WORKS_ON (Agent|Organization|Person|SoftwareAgent → Project). Requires write scope.",
660
+ "description": "DEPRECATED, removed on 2027-03-31: use knowmind_link_entities. This name keeps answering unchanged until then. Create a typed relation between two memory nodes (a knowledge-graph edge). THIS IS HOW THE GRAPH IS BUILT: after storing memories, connect them - a corpus without edges answers only what a single note already says. The server checks the edge against the ontology's shapes before writing it: the subject and object must belong to the classes the predicate requires (for entries without a class the check only warns), entity names must carry no role or suffix, and the edge must name its evidence - the id of the entry that states the relation. A rejected edge returns the violated rule. The inverse edge is materialized automatically, and derived edges (RUNS_ON, WORKS_FOR_CLIENT, HOST_SERVES_CLIENT, DEPENDS_ON_SUPPLIER) are computed by the server - never set them by hand. Get both node IDs via knowmind_recall first, and call knowmind_schema for the full catalogue with explanations. Allowed rel_type values: ABOUT (Contract|Document|FileResource → Topic), ASSIGNED_TO (ActionRecord|Task → Agent|Organization|Person|SoftwareAgent), CLIENT_OF (Agent|Organization|Person|SoftwareAgent → Organization), CONTACT_PERSON_FOR (Person → Organization), COVERED_BY (Topic → Contract|Document|FileResource), DELIVERED_AS (Application → Product), DELIVERED_BY (Product → Application), DEPENDS_ON (Application → Application), DEPLOYED_TO (Application → Container), DEVELOPED_BY (Application → Agent|Organization|Person|SoftwareAgent), DEVELOPS (Agent|Organization|Person|SoftwareAgent → Application), ENABLES (Application → Application), FOR_CLIENT (Project → Agent|Organization|Person|SoftwareAgent), HAS_ASSIGNED_TASK (Agent|Organization|Person|SoftwareAgent → ActionRecord|Task), HAS_CHILD (Person → Person), HAS_CLIENT (Organization → Agent|Organization|Person|SoftwareAgent), HAS_CONTACT_PERSON (Organization → Person), HAS_EMPLOYEE (Organization → Person), HAS_OPERATED_APPLICATION (Agent|Organization|Person|SoftwareAgent → Application), HAS_PARENT (Person → Person), HAS_PREDECESSOR (ActionRecord|Project|Task → ActionRecord|Project|Task), HAS_PROJECT (Agent|Organization|Person|SoftwareAgent → Project), HAS_ROLE (Person → Role), HAS_SIBLING (Person → Person), HAS_SKILL (Agent|Organization|Person|SoftwareAgent → Skill), HAS_SUCCESSOR (ActionRecord|Project|Task → ActionRecord|Project|Task), HOSTED_ON (Container → Host), HOSTS (Host → Container), HOSTS_APPLICATION (Container → Application), INFRASTRUCTURE_PROVIDED_BY (Host → Organization), INTEGRATES_WITH (Application → Application), IS_LED_BY (Organization → Person), KNOWS (Person → Person), LEADS (Person → Organization), OPERATED_FOR (Application → Agent|Organization|Person|SoftwareAgent), PAID_BY (Agent|Organization|Person|SoftwareAgent → Agent|Organization|Person|SoftwareAgent), PARTNER_OF (Organization → Organization), PAYS (Agent|Organization|Person|SoftwareAgent → Agent|Organization|Person|SoftwareAgent), PRODUCED_BY (Contract|Document|FileResource → Project), PRODUCES (Project → Contract|Document|FileResource), PROVIDES_INFRASTRUCTURE (Organization → Host), ROLE_OF (Role → Person), SERVED_UNDER (Application → Domain), SERVES (Domain → Application), SKILL_OF (Skill → Agent|Organization|Person|SoftwareAgent), SPOUSE_OF (Person → Person), SUPPLIED_BY (Agent|Organization|Person|SoftwareAgent → Organization), SUPPLIES (Organization → Agent|Organization|Person|SoftwareAgent), SUPPLIES_TECHNOLOGY (Organization → Technology), SUPPORTED_BY (Contract|Document|FileResource → Contract|Document|FileResource), SUPPORTS (Contract|Document|FileResource → Contract|Document|FileResource), TECHNOLOGY_SUPPLIED_BY (Technology → Organization), TECHNOLOGY_USED_BY (Technology → Application), USES_TECHNOLOGY (Application → Technology), WORKED_ON_BY (Project → Agent|Organization|Person|SoftwareAgent), WORKS_FOR (Person → Organization), WORKS_ON (Agent|Organization|Person|SoftwareAgent → Project). Requires write scope.",
581
661
  "inputSchema": {
582
662
  "type": "object",
583
663
  "properties": {
@@ -596,12 +676,17 @@
596
676
  "confidence": {
597
677
  "type": "number",
598
678
  "description": "Edge confidence in [0..1]; 1.0 for a fact stated verbatim, 0.7 for a clear paraphrase. Below that, do not create the edge."
679
+ },
680
+ "evidence": {
681
+ "type": "string",
682
+ "description": "Memory ID of the entry that states this relation (often from_id or a note found via knowmind_recall). Required: an edge without evidence is rejected."
599
683
  }
600
684
  },
601
685
  "required": [
602
686
  "from_id",
603
687
  "to_id",
604
- "rel_type"
688
+ "rel_type",
689
+ "evidence"
605
690
  ]
606
691
  }
607
692
  },