memoryai-mcp 0.5.0 → 0.7.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.
Files changed (2) hide show
  1. package/dist/index.js +10 -1
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
10
10
  import { z } from "zod";
11
11
  const API_URL = process.env.HM_ENDPOINT || "http://localhost:8420";
12
12
  const API_KEY = process.env.HM_API_KEY || "";
13
+ const REQUEST_TIMEOUT_MS = 30_000; // P2 #6: 30s default timeout for API requests
13
14
  // --- HTTP helper ---
14
15
  async function api(method, path, body) {
15
16
  const resp = await fetch(`${API_URL}${path}`, {
@@ -19,6 +20,7 @@ async function api(method, path, body) {
19
20
  "Content-Type": "application/json",
20
21
  },
21
22
  body: body ? JSON.stringify(body) : undefined,
23
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
22
24
  });
23
25
  if (!resp.ok) {
24
26
  const text = await resp.text();
@@ -41,6 +43,8 @@ server.tool("memory_store", "Store information in persistent memory. Use when yo
41
43
  source: z.string().optional().describe("Source context (e.g. file path, conversation)"),
42
44
  tags: z.array(z.string()).optional().describe("Categories: preferences, architecture, bugs, patterns, decisions"),
43
45
  priority: z.enum(["hot", "warm", "cold"]).optional().describe("Memory priority (default: warm)"),
46
+ memory_type: z.enum(["fact", "decision", "preference", "error", "goal", "episodic", "identity"]).optional().describe("Memory type. 'preference', 'decision', 'identity' are DNA-protected — never decay, 1.5x recall boost. Default: fact"),
47
+ retention: z.enum(["auto", "forever", "6m", "1y"]).optional().describe("Retention policy. 'forever' = never deleted. Default: auto"),
44
48
  content_type: z.enum(["conversation", "code", "decision", "preference", "architecture", "lesson_learned", "todo", "entity", "pattern", "environment", "bug_fix", "action_log"]).optional().describe("Content type — helps with filtering and recall accuracy"),
45
49
  metadata: z.record(z.string(), z.unknown()).optional().describe("Additional metadata (JSONB)"),
46
50
  zone: z.enum(["critical", "important", "standard", "ephemeral"]).optional().describe("Memory zone (default: standard). critical=never evict, ephemeral=auto-expire"),
@@ -52,17 +56,22 @@ server.tool("memory_store", "Store information in persistent memory. Use when yo
52
56
  source: args.source,
53
57
  tags: args.tags || [],
54
58
  priority: args.priority || "warm",
59
+ memory_type: args.memory_type || "fact",
60
+ retention: args.retention || "auto",
55
61
  content_type: args.content_type,
56
62
  metadata: args.metadata,
57
63
  zone: args.zone || "standard",
58
64
  importance: args.importance ?? 0.5,
59
65
  }));
60
- let msg = `Stored (id=${r.id})`;
66
+ let msg = `Stored (id=${r.id}, type=${args.memory_type || "fact"})`;
61
67
  if (r.deduplicated) {
62
68
  msg += " [deduplicated]";
63
69
  if (r.similar_chunk_id)
64
70
  msg += ` (similar to #${r.similar_chunk_id}, ${((r.similarity || 0) * 100).toFixed(1)}% match)`;
65
71
  }
72
+ if (r.temporal_invalidated?.length) {
73
+ msg += ` — invalidated ${r.temporal_invalidated.length} outdated fact(s)`;
74
+ }
66
75
  return ok(msg);
67
76
  }
68
77
  catch (e) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "memoryai-mcp",
3
- "version": "0.5.0",
4
- "description": "MCP server for MemoryAI — a brain for your AI agent",
3
+ "version": "0.7.0",
4
+ "description": "MCP server for MemoryAI v0.7 Brain with 11 biological behaviors. DNA-protected memories (preference/decision/identity), Hebbian learning, Sleep consolidation.",
5
5
  "homepage": "https://memoryai.dev",
6
6
  "repository": {
7
7
  "type": "git",
@@ -37,8 +37,8 @@
37
37
  "@modelcontextprotocol/sdk": "^1.12.0"
38
38
  },
39
39
  "devDependencies": {
40
- "typescript": "^5.5.0",
40
+ "@types/node": "^22.19.15",
41
41
  "tsx": "^4.0.0",
42
- "@types/node": "^22.0.0"
42
+ "typescript": "^5.5.0"
43
43
  }
44
- }
44
+ }