claude-recall 0.8.0 → 0.8.2
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 +30 -0
- package/dist/pubnub/memory-agent.js +35 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -363,6 +363,36 @@ ps aux | grep claude-recall
|
|
|
363
363
|
```
|
|
364
364
|
Should show the MCP server process running.
|
|
365
365
|
|
|
366
|
+
## PubNub: Fire-and-Forget Architecture
|
|
367
|
+
|
|
368
|
+
Claude Recall uses **PubNub** as a real-time message bus to enable truly autonomous memory operations with zero performance impact on Claude Code.
|
|
369
|
+
|
|
370
|
+
### What is PubNub?
|
|
371
|
+
|
|
372
|
+
PubNub is a real-time pub/sub messaging service that acts as a message bus between Claude Code and the Memory Agent. When Claude Code executes a tool (Write, Edit, Bash), a lightweight hook publishes an event to PubNub and returns immediately (<10ms). The Memory Agent, running as an independent daemon, subscribes to these events and processes them asynchronously.
|
|
373
|
+
|
|
374
|
+
**Simple flow:**
|
|
375
|
+
```
|
|
376
|
+
Claude Code → Hook (<10ms) → PubNub → Memory Agent (background)
|
|
377
|
+
↓
|
|
378
|
+
Continues immediately
|
|
379
|
+
(zero blocking!)
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Why This Matters
|
|
383
|
+
|
|
384
|
+
- **<10ms hook latency** - Hooks return instantly, no waiting
|
|
385
|
+
- **Zero performance impact** - Memory operations happen in background
|
|
386
|
+
- **True autonomy** - Agent runs independently, crashes don't affect Claude Code
|
|
387
|
+
- **Fault isolation** - If agent fails, Claude Code continues working
|
|
388
|
+
- **Real-time pub/sub** - Events flow asynchronously through message bus
|
|
389
|
+
|
|
390
|
+
### Demo Keys Included
|
|
391
|
+
|
|
392
|
+
Claude Recall includes **demo PubNub keys** that work out of the box - no signup or configuration required. Perfect for getting started immediately.
|
|
393
|
+
|
|
394
|
+
**For production use**, you can optionally use your own PubNub keys (free tier available). See [PubNub Integration Guide](docs/PUBNUB_INTEGRATION.md) for details.
|
|
395
|
+
|
|
366
396
|
## How It Works
|
|
367
397
|
|
|
368
398
|
Claude Recall implements an **intelligent learning loop** that ensures you never repeat yourself:
|
|
@@ -226,11 +226,44 @@ class MemoryAgent {
|
|
|
226
226
|
*/
|
|
227
227
|
analyzePrompt(content) {
|
|
228
228
|
const lower = content.toLowerCase();
|
|
229
|
+
// Detect request interruptions - these are high-priority corrections
|
|
230
|
+
const interruptionMatch = content.match(/request interrupted.*?\]\s*(.+)/i);
|
|
231
|
+
if (interruptionMatch && interruptionMatch[1]) {
|
|
232
|
+
const userMessage = interruptionMatch[1].trim();
|
|
233
|
+
return {
|
|
234
|
+
shouldStore: true,
|
|
235
|
+
type: 'correction',
|
|
236
|
+
content: `INTERRUPTION CORRECTION: ${userMessage}`,
|
|
237
|
+
metadata: {
|
|
238
|
+
priority: 'highest',
|
|
239
|
+
confidence: 0.95,
|
|
240
|
+
source: 'user-interruption',
|
|
241
|
+
interrupted: true
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
// Short correction patterns (for terse corrections like "no gpg needed!")
|
|
246
|
+
const shortCorrectionPatterns = [
|
|
247
|
+
/\bno (gpg|signing|hooks|verify|tests?|push|commit|tag)/i,
|
|
248
|
+
/\bskip (tests?|hooks|verify|gpg|signing)/i,
|
|
249
|
+
/\bdon'?t (use|need|want|run|execute|commit|push)/i,
|
|
250
|
+
/\buse \w+/i,
|
|
251
|
+
];
|
|
252
|
+
for (const pattern of shortCorrectionPatterns) {
|
|
253
|
+
if (pattern.test(content)) {
|
|
254
|
+
return {
|
|
255
|
+
shouldStore: true,
|
|
256
|
+
type: 'correction',
|
|
257
|
+
content: `CORRECTION: ${content.trim()}`,
|
|
258
|
+
metadata: { priority: 'high', confidence: 0.9, source: 'short-correction' },
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}
|
|
229
262
|
// Strong preference indicators
|
|
230
263
|
const preferenceWords = ['prefer', 'always', 'never', 'from now on', 'moving forward'];
|
|
231
264
|
const hasPreference = preferenceWords.some((w) => lower.includes(w));
|
|
232
|
-
// Correction indicators
|
|
233
|
-
const correctionWords = ['no,', 'actually', 'instead', 'correction', 'fix'];
|
|
265
|
+
// Correction indicators (relaxed to include "no " without comma)
|
|
266
|
+
const correctionWords = ['no,', 'no ', 'nope', 'actually', 'instead', 'correction', 'fix', 'wrong', 'incorrect', 'dont', "don't"];
|
|
234
267
|
const isCorrection = correctionWords.some((w) => lower.includes(w));
|
|
235
268
|
// Project-specific indicators
|
|
236
269
|
const projectWords = ['for this project', 'in this project', 'this uses', 'we use'];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-recall",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "Persistent memory for Claude Code with automatic capture, failure learning,
|
|
3
|
+
"version": "0.8.2",
|
|
4
|
+
"description": "Persistent memory for Claude Code with fire-and-forget PubNub architecture, automatic capture, failure learning, and project scoping via MCP server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"claude-recall": "dist/cli/claude-recall-cli.js"
|