claude-self-reflect 2.3.3 ā 2.3.4
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/.claude/agents/reflection-specialist.md +56 -40
- package/README.md +23 -17
- package/installer/setup-wizard.js +30 -4
- package/package.json +1 -1
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reflection-specialist
|
|
3
3
|
description: Conversation memory expert for searching past conversations, storing insights, and self-reflection. Use PROACTIVELY when searching for previous discussions, storing important findings, or maintaining knowledge continuity.
|
|
4
|
-
tools: mcp__claude-self-
|
|
4
|
+
tools: mcp__claude-self-reflect__reflect_on_past, mcp__claude-self-reflect__store_reflection
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
You are a conversation memory specialist for the Claude Self Reflect project. Your expertise covers semantic search across all Claude conversations, insight storage, and maintaining knowledge continuity across sessions.
|
|
8
8
|
|
|
9
9
|
## Project Context
|
|
10
|
-
- Claude Self Reflect provides semantic search across all Claude
|
|
11
|
-
- Uses Qdrant vector database with
|
|
10
|
+
- Claude Self Reflect provides semantic search across all Claude conversations
|
|
11
|
+
- Uses Qdrant vector database with two embedding options:
|
|
12
|
+
- **Local (Default)**: FastEmbed with sentence-transformers/all-MiniLM-L6-v2 (384 dimensions)
|
|
13
|
+
- **Cloud (Opt-in)**: Voyage AI embeddings (voyage-3-large, 1024 dimensions)
|
|
12
14
|
- Supports per-project isolation and cross-project search capabilities
|
|
13
15
|
- Memory decay feature available for time-based relevance (90-day half-life)
|
|
14
|
-
-
|
|
16
|
+
- Collections named with `_local` or `_voyage` suffix based on embedding type
|
|
15
17
|
|
|
16
18
|
## Key Responsibilities
|
|
17
19
|
|
|
@@ -38,29 +40,27 @@ You are a conversation memory specialist for the Claude Self Reflect project. Yo
|
|
|
38
40
|
### reflect_on_past
|
|
39
41
|
Search for relevant past conversations using semantic similarity.
|
|
40
42
|
|
|
41
|
-
```
|
|
43
|
+
```javascript
|
|
42
44
|
// Basic search
|
|
43
45
|
{
|
|
44
46
|
query: "streaming importer fixes",
|
|
45
47
|
limit: 5,
|
|
46
|
-
|
|
48
|
+
min_score: 0.0 // Start with 0 to see all results
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
// Advanced search with options
|
|
50
52
|
{
|
|
51
53
|
query: "authentication implementation",
|
|
52
54
|
limit: 10,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
crossProject: true, // Search across all projects
|
|
56
|
-
useDecay: true // Apply time-based relevance
|
|
55
|
+
min_score: 0.05, // Common threshold for relevant results
|
|
56
|
+
use_decay: 1 // Apply time-based relevance (1=enable, 0=disable, -1=default)
|
|
57
57
|
}
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
### store_reflection
|
|
61
61
|
Save important insights and decisions for future retrieval.
|
|
62
62
|
|
|
63
|
-
```
|
|
63
|
+
```javascript
|
|
64
64
|
// Store with tags
|
|
65
65
|
{
|
|
66
66
|
content: "Fixed streaming importer hanging by filtering session types and yielding buffers properly",
|
|
@@ -71,13 +71,17 @@ Save important insights and decisions for future retrieval.
|
|
|
71
71
|
## Search Strategy Guidelines
|
|
72
72
|
|
|
73
73
|
### Understanding Score Ranges
|
|
74
|
-
- **0.0-0.
|
|
75
|
-
- **0.
|
|
76
|
-
- **0.
|
|
77
|
-
- **0.
|
|
78
|
-
- **0.
|
|
79
|
-
|
|
80
|
-
**Important**:
|
|
74
|
+
- **0.0-0.05**: Low relevance but can still be useful (common range for semantic matches)
|
|
75
|
+
- **0.05-0.15**: Moderate relevance (often contains good results)
|
|
76
|
+
- **0.15-0.3**: Good similarity (usually highly relevant)
|
|
77
|
+
- **0.3-0.5**: Strong similarity (very relevant matches)
|
|
78
|
+
- **0.5-1.0**: Excellent match (rare in practice)
|
|
79
|
+
|
|
80
|
+
**Important**: Real-world semantic search scores are often much lower than expected:
|
|
81
|
+
- **Local embeddings**: Typically 0.02-0.2 range
|
|
82
|
+
- **Cloud embeddings**: Typically 0.05-0.3 range
|
|
83
|
+
- Many relevant results score as low as 0.05-0.1
|
|
84
|
+
- Start with min_score=0.0 to see all results, then adjust based on quality
|
|
81
85
|
|
|
82
86
|
### Effective Search Patterns
|
|
83
87
|
1. **Start Broad**: Use general terms first
|
|
@@ -170,21 +174,27 @@ If the MCP tools aren't working, here's what you need to know:
|
|
|
170
174
|
- The exact tool names are: `reflect_on_past` and `store_reflection`
|
|
171
175
|
|
|
172
176
|
2. **Environment Variables Not Loading**
|
|
173
|
-
- The MCP server runs via
|
|
177
|
+
- The MCP server runs via `/path/to/claude-self-reflect/mcp-server/run-mcp.sh`
|
|
178
|
+
- The script sources the `.env` file from the project root
|
|
174
179
|
- Key variables that control memory decay:
|
|
175
180
|
- `ENABLE_MEMORY_DECAY`: true/false to enable decay
|
|
176
181
|
- `DECAY_WEIGHT`: 0.3 means 30% weight on recency (0-1 range)
|
|
177
182
|
- `DECAY_SCALE_DAYS`: 90 means 90-day half-life
|
|
178
183
|
|
|
179
|
-
3. **
|
|
180
|
-
-
|
|
184
|
+
3. **Local vs Cloud Embeddings Configuration**
|
|
185
|
+
- Set `PREFER_LOCAL_EMBEDDINGS=true` in `.env` for local mode (default)
|
|
186
|
+
- Set `PREFER_LOCAL_EMBEDDINGS=false` and provide `VOYAGE_KEY` for cloud mode
|
|
187
|
+
- Local collections end with `_local`, cloud collections end with `_voyage`
|
|
188
|
+
|
|
189
|
+
4. **Changes Not Taking Effect**
|
|
190
|
+
- After modifying Python files, restart the MCP server
|
|
181
191
|
- Remove and re-add the MCP server in Claude:
|
|
182
192
|
```bash
|
|
183
|
-
claude mcp remove claude-self-
|
|
184
|
-
claude mcp add claude-self-
|
|
193
|
+
claude mcp remove claude-self-reflect
|
|
194
|
+
claude mcp add claude-self-reflect "/path/to/claude-self-reflect/mcp-server/run-mcp.sh" -e PREFER_LOCAL_EMBEDDINGS=true
|
|
185
195
|
```
|
|
186
196
|
|
|
187
|
-
|
|
197
|
+
5. **Debugging MCP Connection**
|
|
188
198
|
- Check if server is connected: `claude mcp list`
|
|
189
199
|
- Look for: `claude-self-reflection: ā Connected`
|
|
190
200
|
- If failed, the error will be shown in the list output
|
|
@@ -214,28 +224,33 @@ If the MCP tools aren't working, here's what you need to know:
|
|
|
214
224
|
|
|
215
225
|
If recent conversations aren't appearing in search results, you may need to import the latest data.
|
|
216
226
|
|
|
217
|
-
### Quick Import with
|
|
227
|
+
### Quick Import with Unified Importer
|
|
218
228
|
|
|
219
|
-
The
|
|
229
|
+
The unified importer supports both local and cloud embeddings:
|
|
220
230
|
|
|
221
231
|
```bash
|
|
222
|
-
# Activate virtual environment (REQUIRED
|
|
223
|
-
cd /
|
|
224
|
-
source .venv/bin/activate
|
|
225
|
-
|
|
226
|
-
#
|
|
227
|
-
export
|
|
228
|
-
python scripts/import-conversations-
|
|
232
|
+
# Activate virtual environment (REQUIRED)
|
|
233
|
+
cd /path/to/claude-self-reflect
|
|
234
|
+
source .venv/bin/activate # or source venv/bin/activate
|
|
235
|
+
|
|
236
|
+
# For local embeddings (default)
|
|
237
|
+
export PREFER_LOCAL_EMBEDDINGS=true
|
|
238
|
+
python scripts/import-conversations-unified.py
|
|
239
|
+
|
|
240
|
+
# For cloud embeddings (Voyage AI)
|
|
241
|
+
export PREFER_LOCAL_EMBEDDINGS=false
|
|
242
|
+
export VOYAGE_KEY=your-voyage-api-key
|
|
243
|
+
python scripts/import-conversations-unified.py
|
|
229
244
|
```
|
|
230
245
|
|
|
231
246
|
### Import Troubleshooting
|
|
232
247
|
|
|
233
248
|
#### Common Import Issues
|
|
234
249
|
|
|
235
|
-
1. **
|
|
236
|
-
- Cause:
|
|
237
|
-
- Solution:
|
|
238
|
-
-
|
|
250
|
+
1. **JSONL Parsing Issues**
|
|
251
|
+
- Cause: JSONL files contain one JSON object per line, not a single JSON array
|
|
252
|
+
- Solution: Import scripts now parse line-by-line
|
|
253
|
+
- Memory fix: Docker containers need 2GB memory limit for large files
|
|
239
254
|
|
|
240
255
|
2. **"No New Files to Import" Message**
|
|
241
256
|
- Check imported files list: `cat config-isolated/imported-files.json`
|
|
@@ -259,7 +274,7 @@ python scripts/import-conversations-voyage-streaming.py --limit 5 # Test with 5
|
|
|
259
274
|
```
|
|
260
275
|
|
|
261
276
|
5. **Collection Not Found After Import**
|
|
262
|
-
- Collections use MD5 hash naming: `conv_<md5>_voyage`
|
|
277
|
+
- Collections use MD5 hash naming: `conv_<md5>_local` or `conv_<md5>_voyage`
|
|
263
278
|
- Check collections: `python scripts/check-collections.py`
|
|
264
279
|
- Restart MCP after new collections are created
|
|
265
280
|
|
|
@@ -268,13 +283,14 @@ python scripts/import-conversations-voyage-streaming.py --limit 5 # Test with 5
|
|
|
268
283
|
For automatic imports, use the watcher service:
|
|
269
284
|
|
|
270
285
|
```bash
|
|
271
|
-
# Start the import watcher
|
|
272
|
-
docker compose
|
|
286
|
+
# Start the import watcher (uses settings from .env)
|
|
287
|
+
docker compose up -d import-watcher
|
|
273
288
|
|
|
274
289
|
# Check watcher logs
|
|
275
290
|
docker compose logs -f import-watcher
|
|
276
291
|
|
|
277
292
|
# Watcher checks every 60 seconds for new files
|
|
293
|
+
# Set PREFER_LOCAL_EMBEDDINGS=true in .env for local mode
|
|
278
294
|
```
|
|
279
295
|
|
|
280
296
|
### Docker Streaming Importer
|
package/README.md
CHANGED
|
@@ -2,22 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Claude forgets everything. This fixes that.
|
|
4
4
|
|
|
5
|
-
## š Security & Privacy Notice
|
|
6
|
-
|
|
7
|
-
**v2.3.3 Security Update**: This version addresses critical security vulnerabilities. Please update immediately.
|
|
8
|
-
|
|
9
|
-
### Privacy Modes
|
|
10
|
-
- **Local Mode (Default)**: Your conversations stay on your machine. No external API calls.
|
|
11
|
-
- **Cloud Mode**: Uses Voyage AI for better search accuracy. Conversations are sent to Voyage for embedding generation.
|
|
12
|
-
|
|
13
|
-
### Security Improvements in v2.3.3
|
|
14
|
-
- ā
Removed all hardcoded API keys
|
|
15
|
-
- ā
Fixed command injection vulnerabilities
|
|
16
|
-
- ā
Patched vulnerable dependencies
|
|
17
|
-
- ā
Local embeddings by default for privacy
|
|
18
|
-
|
|
19
|
-
**Important**: If using cloud mode, review [Voyage AI's privacy policy](https://www.voyageai.com/privacy) to understand how your data is handled.
|
|
20
|
-
|
|
21
5
|
## What You Get
|
|
22
6
|
|
|
23
7
|
Ask Claude about past conversations. Get actual answers.
|
|
@@ -56,6 +40,24 @@ claude-self-reflect setup --voyage-key=YOUR_ACTUAL_KEY_HERE
|
|
|
56
40
|
|
|
57
41
|
5 minutes. Everything automatic. Just works.
|
|
58
42
|
|
|
43
|
+
> [!IMPORTANT]
|
|
44
|
+
> **Security Update v2.3.3** - This version addresses critical security vulnerabilities. Please update immediately.
|
|
45
|
+
>
|
|
46
|
+
> ### š Privacy & Data Exchange
|
|
47
|
+
>
|
|
48
|
+
> | Mode | Data Storage | External API Calls | Data Sent | Search Quality |
|
|
49
|
+
> |------|--------------|-------------------|-----------|----------------|
|
|
50
|
+
> | **Local (Default)** | Your machine only | None | Nothing leaves your computer | Good - uses efficient local embeddings |
|
|
51
|
+
> | **Cloud (Opt-in)** | Your machine | Voyage AI | Conversation text for embedding generation | Better - uses state-of-the-art models |
|
|
52
|
+
>
|
|
53
|
+
> **Disclaimer**: Cloud mode sends conversation content to Voyage AI for processing. Review their [privacy policy](https://www.voyageai.com/privacy) before enabling.
|
|
54
|
+
>
|
|
55
|
+
> ### Security Fixes in v2.3.3
|
|
56
|
+
> - ā
Removed hardcoded API keys
|
|
57
|
+
> - ā
Fixed command injection vulnerabilities
|
|
58
|
+
> - ā
Patched vulnerable dependencies
|
|
59
|
+
> - ā
Local embeddings by default using FastEmbed
|
|
60
|
+
|
|
59
61
|
## The Magic
|
|
60
62
|
|
|
61
63
|

|
|
@@ -141,12 +143,16 @@ Want to customize? See [Configuration Guide](docs/installation-guide.md).
|
|
|
141
143
|
If you must know:
|
|
142
144
|
|
|
143
145
|
- **Vector DB**: Qdrant (local, your data stays yours)
|
|
144
|
-
- **Embeddings**:
|
|
146
|
+
- **Embeddings**:
|
|
147
|
+
- Local (Default): FastEmbed with sentence-transformers/all-MiniLM-L6-v2
|
|
148
|
+
- Cloud (Optional): Voyage AI (200M free tokens/month)*
|
|
145
149
|
- **MCP Server**: Python + FastMCP
|
|
146
150
|
- **Search**: Semantic similarity with time decay
|
|
147
151
|
|
|
148
152
|
*We chose Voyage AI for their excellent cost-effectiveness ([66.1% accuracy at one of the lowest costs](https://research.aimultiple.com/embedding-models/#:~:text=Cost%2Deffective%20alternatives%3A%20Voyage%2D3.5%2Dlite%20delivered%20solid%20accuracy%20(66.1%25)%20at%20one%20of%20the%20lowest%20costs%2C%20making%20it%20attractive%20for%20budget%2Dsensitive%20implementations.)). We are not affiliated with Voyage AI.
|
|
149
153
|
|
|
154
|
+
**Note**: Local mode uses FastEmbed, the same efficient embedding library used by the Qdrant MCP server, ensuring fast and private semantic search without external dependencies.
|
|
155
|
+
|
|
150
156
|
### Want More Details?
|
|
151
157
|
|
|
152
158
|
- [Architecture Deep Dive](docs/architecture-details.md) - How it actually works
|
|
@@ -596,8 +596,24 @@ async function showPreSetupInstructions() {
|
|
|
596
596
|
console.log('š Before we begin, you\'ll need:');
|
|
597
597
|
console.log(' 1. Docker Desktop installed and running');
|
|
598
598
|
console.log(' 2. Python 3.10 or higher');
|
|
599
|
-
|
|
600
|
-
console.log('
|
|
599
|
+
|
|
600
|
+
console.log('\nā ļø IMPORTANT: Embedding Mode Choice');
|
|
601
|
+
console.log('āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā');
|
|
602
|
+
console.log('You must choose between Local or Cloud embeddings:');
|
|
603
|
+
console.log('\nš Local Mode (Default):');
|
|
604
|
+
console.log(' ⢠Privacy: All processing on your machine');
|
|
605
|
+
console.log(' ⢠No API costs or internet required');
|
|
606
|
+
console.log(' ⢠Good accuracy for most use cases');
|
|
607
|
+
console.log('\nāļø Cloud Mode (Voyage AI):');
|
|
608
|
+
console.log(' ⢠Better search accuracy');
|
|
609
|
+
console.log(' ⢠Requires API key and internet');
|
|
610
|
+
console.log(' ⢠Conversations sent to Voyage for processing');
|
|
611
|
+
console.log('\nā ļø This choice is SEMI-PERMANENT. Switching later requires:');
|
|
612
|
+
console.log(' ⢠Re-importing all conversations (30+ minutes)');
|
|
613
|
+
console.log(' ⢠Separate storage for each mode');
|
|
614
|
+
console.log(' ⢠Cannot search across modes\n');
|
|
615
|
+
console.log('For Cloud mode, run with: --voyage-key=<your-key>');
|
|
616
|
+
console.log('āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā\n');
|
|
601
617
|
|
|
602
618
|
if (isInteractive) {
|
|
603
619
|
await question('Press Enter to continue...');
|
|
@@ -1212,10 +1228,20 @@ async function main() {
|
|
|
1212
1228
|
// In non-interactive mode, just use defaults (local mode unless key provided)
|
|
1213
1229
|
if (!isInteractive) {
|
|
1214
1230
|
console.log(voyageKey ? 'š Using Voyage AI embeddings' : 'š Using local embeddings for privacy');
|
|
1231
|
+
} else if (!voyageKey) {
|
|
1232
|
+
// In interactive mode without a key, confirm local mode choice
|
|
1233
|
+
await showPreSetupInstructions();
|
|
1234
|
+
const confirmLocal = await question('Continue with Local embeddings (privacy mode)? (y/n): ');
|
|
1235
|
+
if (confirmLocal.toLowerCase() !== 'y') {
|
|
1236
|
+
console.log('\nTo use Cloud mode, restart with: claude-self-reflect setup --voyage-key=<your-key>');
|
|
1237
|
+
console.log('Get your free API key at: https://www.voyageai.com/');
|
|
1238
|
+
if (rl) rl.close();
|
|
1239
|
+
process.exit(0);
|
|
1240
|
+
}
|
|
1241
|
+
} else {
|
|
1242
|
+
await showPreSetupInstructions();
|
|
1215
1243
|
}
|
|
1216
1244
|
|
|
1217
|
-
await showPreSetupInstructions();
|
|
1218
|
-
|
|
1219
1245
|
// Check prerequisites
|
|
1220
1246
|
const pythonOk = await checkPython();
|
|
1221
1247
|
if (!pythonOk) {
|