@nhatnguyen9317/memory-mcp-server 1.2.0 → 1.3.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/dist/utils.js CHANGED
@@ -33,11 +33,6 @@ export function toFtsQuery(raw) {
33
33
  const terms = ftsTerms(raw);
34
34
  return terms.length ? terms.join(" ") : '""';
35
35
  }
36
- /** Like toFtsQuery but matches ANY term — used for fuzzy recall by title. */
37
- export function toFtsOrQuery(raw) {
38
- const terms = ftsTerms(raw);
39
- return terms.length ? terms.join(" OR ") : '""';
40
- }
41
36
  function ftsTerms(raw) {
42
37
  return raw
43
38
  .trim()
@@ -45,6 +40,29 @@ function ftsTerms(raw) {
45
40
  .filter(Boolean)
46
41
  .map((t) => `"${t.replace(/"/g, '""')}"*`);
47
42
  }
43
+ /**
44
+ * Term preparation for auto-recall only. Drops noise tokens (<=2 chars,
45
+ * the main source of one-word junk matches) and caps the count so long
46
+ * titles stay cheap. memory_search keeps raw ftsTerms behavior — an
47
+ * explicit query is the caller's intent.
48
+ */
49
+ export function toRecallTerms(raw) {
50
+ const tokens = raw.trim().split(/\s+/).filter(Boolean);
51
+ const significant = tokens.filter((token) => token.length > 2);
52
+ // Dedupe case-insensitively: a repeated word must not raise the
53
+ // match floor or double-count as two matched terms.
54
+ const seen = new Set();
55
+ const chosen = (significant.length > 0 ? significant : tokens)
56
+ .filter((token) => {
57
+ const key = token.toLowerCase();
58
+ if (seen.has(key))
59
+ return false;
60
+ seen.add(key);
61
+ return true;
62
+ })
63
+ .slice(0, 8);
64
+ return chosen.map((t) => `"${t.replace(/"/g, '""')}"*`);
65
+ }
48
66
  /** Serialize a value to text, truncating with a clear message if it exceeds CHARACTER_LIMIT. */
49
67
  export function toLimitedJson(value) {
50
68
  const text = JSON.stringify(value, null, 2);
package/package.json CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "name": "@nhatnguyen9317/memory-mcp-server",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
+ "keywords": [
5
+ "mcp",
6
+ "model-context-protocol",
7
+ "mcp-server",
8
+ "memory",
9
+ "agent-memory",
10
+ "long-term-memory",
11
+ "reasoning-trace",
12
+ "claude",
13
+ "codex",
14
+ "sqlite"
15
+ ],
4
16
  "description": "MCP server for persisting agent long-term memory and step-by-step reasoning traces in SQLite",
5
17
  "type": "module",
6
18
  "main": "dist/index.js",
@@ -25,7 +37,7 @@
25
37
  "start": "node dist/index.js",
26
38
  "dev": "tsx watch src/index.ts",
27
39
  "build": "tsc && node -e \"require('fs').chmodSync('dist/index.js','755')\"",
28
- "test": "npm run build && node --test dist/__tests__/*.test.js",
40
+ "test": "npm run build && MEMORY_TELEMETRY=on node --test dist/__tests__/*.test.js",
29
41
  "clean": "rm -rf dist"
30
42
  },
31
43
  "engines": {