nox-mem 3.9.0 → 3.9.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/README.md CHANGED
@@ -84,8 +84,8 @@ nox-mem stats
84
84
  |---|---|---|
85
85
  | `NOX_DB_PATH` | `~/.nox-mem/nox.db` | SQLite database path. A missing parent directory is created (mode 0700). Its directory is auto-added to the op-audit allowlist. |
86
86
  | `NOX_MEM_DIR` | — | **Not** the notes folder: nothing ingests or watches it. It only sets where pre-op snapshots go (`$NOX_MEM_DIR/.nox-snapshots`) and widens the op-audit allowlist. |
87
- | `NOX_MEM_SCOPE` | unset | One sentence naming what the memory covers; the MCP server puts it in its `instructions` so the agent knows when a search can help. Recommended, see [Key commands](#key-commands). Collapsed to one line, capped at 800 characters. |
88
- | `NOX_MEM_INSTRUCTIONS` | on | `off` makes the MCP server send no `instructions`. |
87
+ | `NOX_MEM_SCOPE` | unset | One sentence naming what the memory covers; the MCP server puts it in its `instructions` so the agent knows when a search can help. Without it the server sends no `instructions` (3.9.1+). Recommended, see [Key commands](#key-commands). Collapsed to one line, capped at 800 characters. |
88
+ | `NOX_MEM_INSTRUCTIONS` | unset | `off` sends no `instructions` even with a scope; `unscoped` sends the generic text when `NOX_MEM_SCOPE` is unset (it searches on unrelated changes too). Unset: instructions only when `NOX_MEM_SCOPE` is set. |
89
89
  | `NOX_ALLOW_PROD_INGEST` | — | `1` skips the large-database ingest guard (same as `--allow-prod`). See [Large databases](#large-databases-the-ingest-guard). |
90
90
 
91
91
  ### API server
@@ -270,9 +270,11 @@ answered 7% of them right. The server now sends MCP `instructions` (the one serv
270
270
  clients keep in context before the agent picks a tool) saying when to search. With a one-sentence
271
271
  scope in `NOX_MEM_SCOPE`, the same tasks were answered right 53% of the time, and the agent
272
272
  searched on 2% of control tasks that the memory could not help with. Without a scope the server
273
- sends a generic version: about as accurate (56%), but it also searched on a third of unrelated
274
- configuration changes. So set the scope: name the projects or systems your memory holds, in one
275
- sentence, as you would to a new colleague. `NOX_MEM_INSTRUCTIONS=off` sends no instructions.
273
+ sends no instructions (since 3.9.1): a generic version was about as accurate (56%), but it also
274
+ searched on a third of unrelated configuration changes, so it is only sent if you ask for it with
275
+ `NOX_MEM_INSTRUCTIONS=unscoped`. So set the scope: name the projects or systems your memory holds,
276
+ in one sentence, as you would to a new colleague. `NOX_MEM_INSTRUCTIONS=off` sends no instructions
277
+ even with a scope.
276
278
  These numbers are from one model, one client and one corpus; the instructions did not make the
277
279
  agent record decisions (`nox_mem_decision_set`) any more often.
278
280
 
@@ -14,6 +14,10 @@
14
14
  * - unscoped (NOX_MEM_SCOPE unset): pass rate 0.07 -> 0.56, +0.49 [0.35, 0.63], but it searched
15
15
  * on about one in three unrelated configuration changes (+31.7 pp).
16
16
  *
17
+ * Only the scoped text passed the evaluation's decision rule, so it is the only one sent by default:
18
+ * with no NOX_MEM_SCOPE the field is omitted (3.9.1; 3.9.0 sent the unscoped text). The unscoped
19
+ * text stays available on explicit request, NOX_MEM_INSTRUCTIONS=unscoped, with the cost above.
20
+ *
17
21
  * Edits to the wording are edits to a measured intervention: the tests pin both texts, and a
18
22
  * change should come with a new run.
19
23
  */
@@ -55,15 +59,20 @@ export function normaliseScope(raw) {
55
59
  return s;
56
60
  }
57
61
  /**
58
- * Build the `instructions` text. Returns undefined when disabled with NOX_MEM_INSTRUCTIONS=off,
59
- * so the caller can omit the field.
62
+ * Build the `instructions` text, or undefined so the caller omits the field:
63
+ * NOX_MEM_INSTRUCTIONS=off|0|false -> undefined, even with a scope
64
+ * NOX_MEM_SCOPE set -> scoped text (the one that passed)
65
+ * NOX_MEM_INSTRUCTIONS=unscoped -> unscoped text (searched on ~1 in 3 unrelated config changes)
66
+ * otherwise -> undefined
60
67
  */
61
68
  export function serverInstructions(env = process.env) {
62
69
  const mode = (env.NOX_MEM_INSTRUCTIONS || "").trim().toLowerCase();
63
70
  if (mode === "off" || mode === "0" || mode === "false")
64
71
  return undefined;
65
72
  const scope = normaliseScope(env.NOX_MEM_SCOPE);
66
- const intro = scope ? SCOPED_INTRO(scope) : UNSCOPED_INTRO;
67
- const when = scope ? SCOPED_WHEN : UNSCOPED_WHEN;
68
- return [intro, when, HOW, WRITE].join("\n\n");
73
+ if (scope)
74
+ return [SCOPED_INTRO(scope), SCOPED_WHEN, HOW, WRITE].join("\n\n");
75
+ if (mode === "unscoped")
76
+ return [UNSCOPED_INTRO, UNSCOPED_WHEN, HOW, WRITE].join("\n\n");
77
+ return undefined;
69
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nox-mem",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "description": "Pain-weighted hybrid memory engine: FTS5 + semantic search + knowledge graph, self-hosted on any Linux VPS.",
5
5
  "type": "module",
6
6
  "license": "MIT",