@adverant/nexus-memory-skill 2.2.2 → 2.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.
@@ -140,12 +140,12 @@ PAYLOAD=$(jq -n \
140
140
  rerank: true
141
141
  }')
142
142
 
143
- # Try enhanced endpoint first
144
- # The Gateway exposes this at /api/retrieve/enhanced (routes through smartRouter)
145
- ENDPOINT="$NEXUS_API_URL/api/retrieve/enhanced"
146
- log "Recalling from $ENDPOINT"
143
+ # Use the UNIFIED /api/memory endpoint for all memory operations
144
+ # This single endpoint handles both store (with content) and recall (with query)
145
+ ENDPOINT="$NEXUS_API_URL/api/memory"
146
+ log "Recalling from unified endpoint: $ENDPOINT"
147
147
 
148
- # Search GraphRAG for relevant memories via enhanced retrieval endpoint
148
+ # Search GraphRAG for relevant memories via unified memory endpoint
149
149
  # Use short timeout to not block conversation
150
150
  RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$ENDPOINT" \
151
151
  -H "Content-Type: application/json" \
@@ -160,37 +160,6 @@ RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$ENDPOINT" \
160
160
  HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
161
161
  BODY=$(echo "$RESPONSE" | sed '$d')
162
162
 
163
- log "Response code: $HTTP_CODE"
164
-
165
- # If enhanced fails, fallback to basic endpoint
166
- if [[ "$HTTP_CODE" != "200" ]]; then
167
- log "Enhanced recall failed (HTTP $HTTP_CODE), trying basic endpoint..."
168
-
169
- BASIC_PAYLOAD=$(jq -n \
170
- --arg query "$QUERY" \
171
- --argjson limit "$RECALL_LIMIT" \
172
- --arg project "$PROJECT_NAME" \
173
- '{
174
- query: $query,
175
- limit: $limit,
176
- filters: {
177
- project: $project
178
- }
179
- }')
180
-
181
- RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$NEXUS_API_URL/api/memory/recall" \
182
- -H "Content-Type: application/json" \
183
- -H "Authorization: Bearer $NEXUS_API_KEY" \
184
- -H "X-Company-ID: $COMPANY_ID" \
185
- -H "X-App-ID: $APP_ID" \
186
- -H "X-User-ID: ${USER:-unknown}" \
187
- -d "$BASIC_PAYLOAD" \
188
- --max-time 5 2>&1)
189
-
190
- HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
191
- BODY=$(echo "$RESPONSE" | sed '$d')
192
- fi
193
-
194
163
  # Check for errors (silently fail - don't block conversation)
195
164
  if [[ "$HTTP_CODE" != "200" ]]; then
196
165
  log "Failed to recall memories (HTTP $HTTP_CODE), continuing without context"
@@ -229,10 +229,11 @@ PAYLOAD=$(jq -n \
229
229
  fast_mode: true
230
230
  }')
231
231
 
232
- # Use unified memory recall endpoint (most reliable, returns all memory types)
233
- # The /api/memory/recall endpoint returns: unified_memories, document_context, episodic_context, entities, facts
234
- ENDPOINT="$NEXUS_API_URL/api/memory/recall"
235
- log "Recalling from $ENDPOINT"
232
+ # Use the UNIFIED /api/memory endpoint for all memory operations
233
+ # This single endpoint handles both store (with content) and recall (with query)
234
+ # Returns: unified_memories, document_context, episodic_context, entities, facts
235
+ ENDPOINT="$NEXUS_API_URL/api/memory"
236
+ log "Recalling from unified endpoint: $ENDPOINT"
236
237
 
237
238
  # Make request with optimized settings
238
239
  RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$ENDPOINT" \
@@ -339,15 +339,17 @@ PAYLOAD=$(jq -n \
339
339
  }
340
340
  }')
341
341
 
342
- log "Storing memory to $NEXUS_API_URL/api/memory/store"
342
+ # Use the UNIFIED /api/memory endpoint for all memory operations
343
+ # This single endpoint handles both store (with content) and recall (with query)
344
+ log "Storing memory to unified endpoint: $NEXUS_API_URL/api/memory"
343
345
 
344
- # Store to GraphRAG via API Gateway
346
+ # Store to GraphRAG via UNIFIED memory endpoint
345
347
  # Authorization: Bearer token for API authentication
346
348
  # Headers: X-Company-ID, X-App-ID, X-User-ID (required for tenant context)
347
349
  # Run async (background) with timeout
348
350
  if [[ "$VERBOSE" == "1" ]]; then
349
351
  # Sync mode with output for debugging
350
- RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$NEXUS_API_URL/api/memory/store" \
352
+ RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$NEXUS_API_URL/api/memory" \
351
353
  -H "Content-Type: application/json" \
352
354
  -H "Authorization: Bearer $NEXUS_API_KEY" \
353
355
  -H "X-Company-ID: $COMPANY_ID" \
@@ -364,14 +366,14 @@ if [[ "$VERBOSE" == "1" ]]; then
364
366
 
365
367
  if [[ "$HTTP_CODE" == "200" ]] || [[ "$HTTP_CODE" == "201" ]]; then
366
368
  # Extract and save memory ID for causal chaining
367
- MEMORY_ID=$(echo "$BODY" | jq -r '.data.memoryId // .memoryId // empty' 2>/dev/null)
369
+ MEMORY_ID=$(echo "$BODY" | jq -r '.memoryId // .data.memoryId // empty' 2>/dev/null)
368
370
  if [[ -n "$MEMORY_ID" ]]; then
369
371
  save_memory_id "$MEMORY_ID"
370
372
  log "Saved memory ID for causal chain: $MEMORY_ID"
371
373
  fi
372
374
 
373
375
  # Log entity extraction results if available
374
- ENTITIES=$(echo "$BODY" | jq -r '.data.entities_extracted // empty' 2>/dev/null)
376
+ ENTITIES=$(echo "$BODY" | jq -r '.entities // .data.entities_extracted // empty' 2>/dev/null)
375
377
  if [[ -n "$ENTITIES" ]] && [[ "$ENTITIES" != "null" ]]; then
376
378
  log "Entities extracted: $ENTITIES"
377
379
  fi
@@ -381,7 +383,7 @@ if [[ "$VERBOSE" == "1" ]]; then
381
383
  else
382
384
  # Async mode with memory ID tracking for normal operation
383
385
  (
384
- RESPONSE=$(curl -s -X POST "$NEXUS_API_URL/api/memory/store" \
386
+ RESPONSE=$(curl -s -X POST "$NEXUS_API_URL/api/memory" \
385
387
  -H "Content-Type: application/json" \
386
388
  -H "Authorization: Bearer $NEXUS_API_KEY" \
387
389
  -H "X-Company-ID: $COMPANY_ID" \
@@ -391,7 +393,7 @@ else
391
393
  --max-time 5 2>/dev/null)
392
394
 
393
395
  # Extract and save memory ID for causal chaining
394
- MEMORY_ID=$(echo "$RESPONSE" | jq -r '.data.memoryId // .memoryId // empty' 2>/dev/null)
396
+ MEMORY_ID=$(echo "$RESPONSE" | jq -r '.memoryId // .data.memoryId // empty' 2>/dev/null)
395
397
  if [[ -n "$MEMORY_ID" ]]; then
396
398
  mkdir -p "$STATE_DIR"
397
399
  echo "$MEMORY_ID" > "$LAST_MEMORY_FILE"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adverant/nexus-memory-skill",
3
- "version": "2.2.2",
3
+ "version": "2.3.0",
4
4
  "description": "Claude Code skill for persistent memory via Nexus GraphRAG - store and recall memories across all sessions and projects",
5
5
  "main": "SKILL.md",
6
6
  "type": "module",