@pentatonic-ai/openclaw-memory-plugin 0.4.7 → 0.4.8

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/index.js CHANGED
@@ -237,7 +237,6 @@ export default {
237
237
  id: "pentatonic-memory",
238
238
  name: "Pentatonic Memory",
239
239
  description: "Persistent, searchable memory with multi-signal retrieval and HyDE query expansion",
240
- kind: "context-engine",
241
240
 
242
241
  register(api) {
243
242
  const config = api.config || {};
@@ -245,89 +244,43 @@ export default {
245
244
  const baseUrl = config.memory_url || "http://localhost:3333";
246
245
  const log = (msg) => process.stderr.write(`[pentatonic-memory] ${msg}\n`);
247
246
 
248
- // --- Setup tool (always registered) ---
247
+ // --- Always register tools ---
249
248
 
250
- api.registerTool({
251
- name: "pentatonic_memory_setup",
252
- description: `Guide the user through setting up Pentatonic Memory.
253
-
254
- Two modes:
255
- 1. "local" — fully private, Docker-based (PostgreSQL + pgvector + Ollama). No cloud.
256
- 2. "hosted" — Pentatonic TES cloud. Team-wide shared memory, analytics, higher-dimensional embeddings.
249
+ if (hosted) {
250
+ // Hosted mode tools
251
+ log("Hosted mode routing through TES");
257
252
 
258
- Call this to get instructions for the user's chosen mode.`,
259
- parameters: {
260
- type: "object",
261
- properties: {
262
- mode: { type: "string", enum: ["local", "hosted"], description: "Which mode the user wants" },
253
+ api.registerTool({
254
+ name: "memory_search",
255
+ description: "Search memories for relevant context. Use when you need to recall past conversations, decisions, or knowledge.",
256
+ parameters: {
257
+ type: "object",
258
+ properties: {
259
+ query: { type: "string", description: "What to search for" },
260
+ limit: { type: "number", description: "Max results (default 5)" },
261
+ },
262
+ required: ["query"],
263
263
  },
264
- required: ["mode"],
265
- },
266
- async execute({ mode }) {
267
- if (mode === "local") {
268
- return `## Local Memory Setup
269
-
270
- Run in terminal:
271
- \`\`\`
272
- npx @pentatonic-ai/ai-agent-sdk memory
273
- \`\`\`
274
-
275
- This starts PostgreSQL + pgvector, Ollama, and the memory server via Docker.
276
-
277
- Then add to openclaw.json:
278
- \`\`\`json
279
- {
280
- "plugins": {
281
- "slots": { "contextEngine": "pentatonic-memory" },
282
- "entries": {
283
- "pentatonic-memory": {
284
- "enabled": true,
285
- "config": { "memory_url": "http://localhost:3333" }
286
- }
287
- }
288
- }
289
- }
290
- \`\`\`
291
-
292
- Restart OpenClaw to activate.`;
293
- }
294
- return `## Hosted TES Setup
295
-
296
- Run in terminal:
297
- \`\`\`
298
- npx @pentatonic-ai/ai-agent-sdk init
299
- \`\`\`
300
-
301
- This creates a TES account and generates API credentials.
302
-
303
- Then add to openclaw.json:
304
- \`\`\`json
305
- {
306
- "plugins": {
307
- "slots": { "contextEngine": "pentatonic-memory" },
308
- "entries": {
309
- "pentatonic-memory": {
310
- "enabled": true,
311
- "config": {
312
- "tes_endpoint": "https://your-company.api.pentatonic.com",
313
- "tes_client_id": "your-company",
314
- "tes_api_key": "tes_your-company_xxxxx"
315
- }
316
- }
317
- }
318
- }
319
- }
320
- \`\`\`
321
-
322
- Restart OpenClaw to activate.`;
323
- },
324
- });
325
-
326
- // --- Mode-specific registration ---
264
+ async execute({ query, limit }) {
265
+ return formatResults(await hostedSearch(config, query, limit || 5, 0.3));
266
+ },
267
+ });
327
268
 
328
- if (hosted) {
329
- log("Hosted mode — routing through TES");
269
+ api.registerTool({
270
+ name: "memory_store",
271
+ description: "Explicitly store something important. Use for decisions, solutions, or facts worth remembering.",
272
+ parameters: {
273
+ type: "object",
274
+ properties: { content: { type: "string", description: "What to remember" } },
275
+ required: ["content"],
276
+ },
277
+ async execute({ content }) {
278
+ const result = await hostedStore(config, content, { source: "openclaw-tool" });
279
+ return result ? "Memory stored." : "Failed to store memory.";
280
+ },
281
+ });
330
282
 
283
+ // Register context engine for hosted
331
284
  api.registerContextEngine("pentatonic-memory", () =>
332
285
  createHostedContextEngine(config, {
333
286
  searchLimit: config.search_limit || 5,
@@ -336,9 +289,14 @@ Restart OpenClaw to activate.`;
336
289
  })
337
290
  );
338
291
 
292
+ log("Plugin registered (hosted)");
293
+ } else {
294
+ // Local mode tools — always point at baseUrl
295
+ log(`Local mode — ${baseUrl}`);
296
+
339
297
  api.registerTool({
340
298
  name: "memory_search",
341
- description: "Search memories for relevant context.",
299
+ description: "Search memories for relevant context. Use when you need to recall past conversations, decisions, or knowledge.",
342
300
  parameters: {
343
301
  type: "object",
344
302
  properties: {
@@ -348,78 +306,41 @@ Restart OpenClaw to activate.`;
348
306
  required: ["query"],
349
307
  },
350
308
  async execute({ query, limit }) {
351
- return formatResults(await hostedSearch(config, query, limit || 5, 0.3));
309
+ return formatResults(await localSearch(baseUrl, query, limit || 5, 0.3));
352
310
  },
353
311
  });
354
312
 
355
313
  api.registerTool({
356
314
  name: "memory_store",
357
- description: "Explicitly store something important.",
315
+ description: "Explicitly store something important. Use for decisions, solutions, or facts worth remembering.",
358
316
  parameters: {
359
317
  type: "object",
360
318
  properties: { content: { type: "string", description: "What to remember" } },
361
319
  required: ["content"],
362
320
  },
363
321
  async execute({ content }) {
364
- const result = await hostedStore(config, content, { source: "openclaw-tool" });
365
- return result ? "Memory stored." : "Failed to store memory.";
322
+ const result = await localStore(baseUrl, content, { source: "openclaw-tool" });
323
+ return result ? `Stored: ${result.id}` : "Failed to store memory.";
366
324
  },
367
325
  });
368
- } else {
369
- // Local mode — HTTP to memory server
370
- const isConfigured = config.memory_url || config.database_url;
371
-
372
- if (isConfigured) {
373
- log(`Local mode — ${baseUrl}`);
374
-
375
- // Check if server is reachable on startup
376
- localHealth(baseUrl).then((ok) => {
377
- if (!ok) log(`Warning: memory server not reachable at ${baseUrl}. Is Docker running?`);
378
- });
379
-
380
- api.registerContextEngine("pentatonic-memory", () =>
381
- createLocalContextEngine(baseUrl, {
382
- searchLimit: config.search_limit || 5,
383
- minScore: config.min_score || 0.3,
384
- logger: log,
385
- })
386
- );
387
-
388
- api.registerTool({
389
- name: "memory_search",
390
- description: "Search memories for relevant context.",
391
- parameters: {
392
- type: "object",
393
- properties: {
394
- query: { type: "string", description: "What to search for" },
395
- limit: { type: "number", description: "Max results (default 5)" },
396
- },
397
- required: ["query"],
398
- },
399
- async execute({ query, limit }) {
400
- return formatResults(await localSearch(baseUrl, query, limit || 5, 0.3));
401
- },
402
- });
403
-
404
- api.registerTool({
405
- name: "memory_store",
406
- description: "Explicitly store something important.",
407
- parameters: {
408
- type: "object",
409
- properties: { content: { type: "string", description: "What to remember" } },
410
- required: ["content"],
411
- },
412
- async execute({ content }) {
413
- const result = await localStore(baseUrl, content, { source: "openclaw-tool" });
414
- return result ? `Stored: ${result.id}` : "Failed to store memory.";
415
- },
416
- });
417
- } else {
418
- log("No config — setup tool available. Tell OpenClaw: 'set up pentatonic memory'");
419
- }
420
- }
421
326
 
422
- const mode = hosted ? "hosted" : (config.memory_url || config.database_url) ? "local" : "unconfigured";
423
- log(`Plugin registered (${mode})`);
327
+ // Auto-detect: check if local memory server is running, register context engine if so
328
+ localHealth(baseUrl).then((ok) => {
329
+ if (ok) {
330
+ api.registerContextEngine("pentatonic-memory", () =>
331
+ createLocalContextEngine(baseUrl, {
332
+ searchLimit: config.search_limit || 5,
333
+ minScore: config.min_score || 0.3,
334
+ logger: log,
335
+ })
336
+ );
337
+ log("Memory server detected — context engine registered");
338
+ } else {
339
+ log(`Memory server not reachable at ${baseUrl} — tools available, no auto-ingest/assemble`);
340
+ }
341
+ });
342
+
343
+ log("Plugin registered (local)");
344
+ }
424
345
  },
425
346
  };
@@ -3,7 +3,7 @@
3
3
  "name": "Pentatonic Memory",
4
4
  "description": "Persistent, searchable memory with multi-signal retrieval and HyDE query expansion. Local (Docker + Ollama) or hosted (Pentatonic TES).",
5
5
  "version": "0.4.4",
6
- "kind": "context-engine",
6
+ "kind": "tool",
7
7
  "configSchema": {
8
8
  "type": "object",
9
9
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pentatonic-ai/openclaw-memory-plugin",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Pentatonic Memory plugin for OpenClaw — persistent, searchable memory with multi-signal retrieval and HyDE query expansion",
5
5
  "type": "module",
6
6
  "main": "index.js",