claude-self-reflect 2.4.1 → 2.4.3

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.
@@ -41,7 +41,7 @@ You are a conversation memory specialist for the Claude Self Reflect project. Yo
41
41
  Search for relevant past conversations using semantic similarity.
42
42
 
43
43
  ```javascript
44
- // Basic search
44
+ // Basic search (searches current project by default)
45
45
  {
46
46
  query: "streaming importer fixes",
47
47
  limit: 5,
@@ -55,8 +55,29 @@ Search for relevant past conversations using semantic similarity.
55
55
  min_score: 0.05, // Common threshold for relevant results
56
56
  use_decay: 1 // Apply time-based relevance (1=enable, 0=disable, -1=default)
57
57
  }
58
+
59
+ // Search specific project (NEW in v2.4.3)
60
+ {
61
+ query: "Docker setup",
62
+ project: "ShopifyMCPMockShop", // Use actual folder name
63
+ limit: 5
64
+ }
65
+
66
+ // Cross-project search (NEW in v2.4.3)
67
+ {
68
+ query: "error handling patterns",
69
+ project: "all", // Search across all projects
70
+ limit: 10
71
+ }
58
72
  ```
59
73
 
74
+ #### Default Behavior: Project-Scoped Search (NEW in v2.4.3)
75
+ **IMPORTANT**: Searches are now scoped to the current project by default:
76
+ - Auto-detects current project from your working directory
77
+ - Only returns results from that project unless you specify otherwise
78
+ - Use `project: "all"` to explicitly search across all projects
79
+ - Use `project: "ProjectName"` to search a specific project (use the actual folder name)
80
+
60
81
  ### store_reflection
61
82
  Save important insights and decisions for future retrieval.
62
83
 
package/.env.example ADDED
@@ -0,0 +1,29 @@
1
+ # Claude Self-Reflect Environment Variables
2
+ # Copy this file to .env and update with your values
3
+
4
+ # Voyage AI API Key (optional - only needed for cloud mode)
5
+ # Get your key at: https://www.voyageai.com/
6
+ VOYAGE_KEY=your-voyage-api-key-here
7
+
8
+ # Qdrant Configuration
9
+ QDRANT_URL=http://localhost:6333
10
+
11
+ # Embedding Configuration
12
+ # Set to true to use local embeddings (default)
13
+ # Set to false to use Voyage AI embeddings (requires VOYAGE_KEY)
14
+ PREFER_LOCAL_EMBEDDINGS=true
15
+
16
+ # Memory Decay Configuration (optional)
17
+ ENABLE_MEMORY_DECAY=true
18
+ DECAY_WEIGHT=0.3
19
+ DECAY_SCALE_DAYS=90
20
+
21
+ # Import Configuration (optional)
22
+ BATCH_SIZE=50
23
+ CHUNK_SIZE=10
24
+ WATCH_INTERVAL=60
25
+
26
+ # Docker Memory Limits
27
+ # Increase if processing large conversation files
28
+ WATCHER_MEM_LIMIT=2g
29
+ QDRANT_MEM_LIMIT=1g
@@ -0,0 +1,13 @@
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install dependencies
6
+ COPY scripts/requirements.txt .
7
+ RUN pip install --no-cache-dir -r requirements.txt
8
+
9
+ # Copy only the unified import script
10
+ COPY scripts/import-conversations-unified.py .
11
+
12
+ # Run the unified importer
13
+ CMD ["python", "import-conversations-unified.py"]
@@ -0,0 +1,20 @@
1
+ FROM python:3.11-slim
2
+
3
+ RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ curl \
5
+ && rm -rf /var/lib/apt/lists/*
6
+
7
+ # Install Python dependencies
8
+ RUN pip install --no-cache-dir \
9
+ qdrant-client \
10
+ sentence-transformers \
11
+ numpy
12
+
13
+ # Copy the import script with proper permissions
14
+ COPY scripts/import-conversations-isolated.py /app/import.py
15
+ RUN chmod +x /app/import.py
16
+
17
+ WORKDIR /app
18
+
19
+ # Run the import script
20
+ CMD ["python", "import.py"]
@@ -0,0 +1,17 @@
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Copy the MCP server package files
6
+ COPY mcp-server/pyproject.toml ./
7
+ COPY mcp-server/src ./src
8
+
9
+ # Install the package in development mode
10
+ RUN pip install --no-cache-dir -e .
11
+
12
+ # Create a non-root user
13
+ RUN useradd -m -u 1000 mcpuser
14
+ USER mcpuser
15
+
16
+ # Keep the container running and wait for docker exec commands
17
+ CMD ["tail", "-f", "/dev/null"]
@@ -0,0 +1,30 @@
1
+ FROM python:3.11-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ gcc \
6
+ g++ \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Install Python dependencies with specific versions for stability
10
+ # Install torch first from PyTorch index
11
+ RUN pip install --no-cache-dir torch==2.0.1 --index-url https://download.pytorch.org/whl/cpu
12
+
13
+ # Install other dependencies from default PyPI
14
+ RUN pip install --no-cache-dir \
15
+ qdrant-client==1.15.0 \
16
+ sentence-transformers==2.2.2 \
17
+ numpy==1.24.3 \
18
+ psutil==5.9.5
19
+
20
+ # Create non-root user
21
+ RUN useradd -m -u 1000 importer
22
+
23
+ # Set working directory
24
+ WORKDIR /app
25
+
26
+ # Switch to non-root user
27
+ USER importer
28
+
29
+ # Default command
30
+ CMD ["python", "/scripts/streaming-importer.py"]
@@ -0,0 +1,53 @@
1
+ FROM python:3.11-slim
2
+
3
+ # Install build dependencies for psutil
4
+ RUN apt-get update && apt-get install -y \
5
+ gcc \
6
+ python3-dev \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Install Python dependencies
10
+ RUN pip install --no-cache-dir \
11
+ psutil==5.9.5 \
12
+ qdrant-client>=1.7.0 \
13
+ openai>=1.0.0 \
14
+ backoff>=2.2.0 \
15
+ requests>=2.31.0 \
16
+ tqdm>=4.66.0 \
17
+ voyageai>=0.2.0 \
18
+ fastembed>=0.4.0
19
+
20
+ # Create non-root user
21
+ RUN useradd -m -u 1000 watcher
22
+
23
+ # Create scripts directory and copy required files
24
+ RUN mkdir -p /scripts
25
+
26
+ # Copy the unified import script and create a simple watcher
27
+ COPY scripts/import-conversations-unified.py /scripts/
28
+
29
+ # Create a minimal watcher script
30
+ RUN echo '#!/usr/bin/env python3\n\
31
+ import time\n\
32
+ import subprocess\n\
33
+ import os\n\
34
+ \n\
35
+ while True:\n\
36
+ try:\n\
37
+ print("Running import...", flush=True)\n\
38
+ subprocess.run(["/usr/local/bin/python", "/scripts/import-conversations-unified.py"], check=True)\n\
39
+ print("Import complete. Sleeping for 60 seconds...", flush=True)\n\
40
+ except Exception as e:\n\
41
+ print(f"Error: {e}", flush=True)\n\
42
+ time.sleep(60)\n' > /scripts/import-watcher.py
43
+
44
+ RUN chmod +x /scripts/*.py
45
+
46
+ # Set working directory
47
+ WORKDIR /app
48
+
49
+ # Switch to non-root user
50
+ USER watcher
51
+
52
+ # Default command
53
+ CMD ["python", "/scripts/import-watcher.py"]
package/README.md CHANGED
@@ -20,6 +20,12 @@ The reflection specialist is a specialized sub-agent that Claude automatically s
20
20
 
21
21
  Your conversations become searchable. Your decisions stay remembered. Your context persists.
22
22
 
23
+ ## Requirements
24
+
25
+ - **Docker Desktop** (macOS/Windows) or **Docker Engine** (Linux)
26
+ - **Node.js** 16+ (for the setup wizard)
27
+ - **Claude Desktop** app
28
+
23
29
  ## Install
24
30
 
25
31
  ### Quick Start (Local Mode - Default)
@@ -29,11 +35,14 @@ npm install -g claude-self-reflect
29
35
  claude-self-reflect setup
30
36
 
31
37
  # That's it! The setup will:
38
+ # ✅ Run everything in Docker (no Python issues!)
32
39
  # ✅ Configure everything automatically
33
40
  # ✅ Install the MCP in Claude Code
34
41
  # ✅ Start monitoring for new conversations
35
42
  # ✅ Verify the reflection tools work
36
43
  # 🔒 Keep all data local - no API keys needed
44
+ # 🚀 Import watcher runs every 60 seconds
45
+ # ⚡ Memory decay enabled by default (90-day half-life)
37
46
  ```
38
47
 
39
48
  ### Cloud Mode (Better Search Accuracy)
@@ -114,6 +123,30 @@ Once installed, just talk naturally:
114
123
 
115
124
  The reflection specialist automatically activates. No special commands needed.
116
125
 
126
+ ## Project-Scoped Search (New in v2.4.3)
127
+
128
+ Searches are now **project-aware by default**. When you ask about past conversations, Claude automatically searches within your current project:
129
+
130
+ ```
131
+ # In project "ShopifyMCPMockShop"
132
+ You: "What authentication method did we implement?"
133
+ Claude: [Searches only ShopifyMCPMockShop conversations]
134
+
135
+ # Need to search across all projects?
136
+ You: "Search all projects for WebSocket implementations"
137
+ Claude: [Searches across all your projects]
138
+
139
+ # Search a specific project
140
+ You: "Find Docker setup discussions in claude-self-reflect project"
141
+ Claude: [Searches only claude-self-reflect conversations]
142
+ ```
143
+
144
+ **Key behaviors:**
145
+ - **Default**: Searches current project based on your working directory
146
+ - **Cross-project**: Ask for "all projects" or "across projects"
147
+ - **Specific project**: Mention the project name explicitly
148
+ - **Privacy**: Each project's conversations remain isolated
149
+
117
150
  ## Memory Decay
118
151
 
119
152
  Recent conversations matter more. Old ones fade. Like your brain, but reliable.
@@ -131,15 +164,19 @@ Built by developers tired of re-explaining context every conversation.
131
164
  ## Requirements
132
165
 
133
166
  - Claude Code or Claude Desktop
134
- - Python 3.10+
167
+ - Docker Desktop (macOS/Windows) or Docker Engine (Linux)
168
+ - Node.js 16+ (for the setup wizard only)
135
169
  - 5 minutes for setup
136
170
 
137
171
  ## Upgrading from Earlier Versions
138
172
 
139
- **v2.3.7+ includes major improvements:**
173
+ **v2.4.0+ includes major improvements:**
174
+ - **Docker-Only Setup**: No more Python environment issues!
140
175
  - **Privacy First**: Local embeddings by default - your data never leaves your machine
141
176
  - **Smarter Setup**: Handles existing installations gracefully
142
177
  - **Better Security**: Automated vulnerability scanning
178
+ - **Real-Time Import**: Watcher checks for new conversations every 60 seconds
179
+ - **Fixed MCP Server**: Now uses correct server implementation with local embedding support
143
180
 
144
181
  **To upgrade:**
145
182
  ```bash
@@ -0,0 +1,98 @@
1
+ volumes:
2
+ qdrant_data:
3
+
4
+ services:
5
+ # Qdrant vector database - the heart of semantic search
6
+ qdrant:
7
+ image: qdrant/qdrant:v1.15.1
8
+ container_name: claude-reflection-qdrant
9
+ ports:
10
+ - "${QDRANT_PORT:-6333}:6333"
11
+ volumes:
12
+ - qdrant_data:/qdrant/storage
13
+ environment:
14
+ - QDRANT__LOG_LEVEL=INFO
15
+ - QDRANT__SERVICE__HTTP_PORT=6333
16
+ restart: unless-stopped
17
+ mem_limit: ${QDRANT_MEMORY:-1g}
18
+ memswap_limit: ${QDRANT_MEMORY:-1g}
19
+
20
+ # One-time import service (runs once then exits)
21
+ importer:
22
+ build:
23
+ context: .
24
+ dockerfile: Dockerfile.importer
25
+ container_name: claude-reflection-importer
26
+ depends_on:
27
+ - qdrant
28
+ volumes:
29
+ - ${CLAUDE_LOGS_PATH:-~/.claude/projects}:/logs:ro
30
+ - ./config:/config
31
+ - ./scripts:/scripts:ro
32
+ environment:
33
+ - QDRANT_URL=http://qdrant:6333
34
+ - STATE_FILE=/config/imported-files.json
35
+ - OPENAI_API_KEY=${OPENAI_API_KEY:-}
36
+ - VOYAGE_API_KEY=${VOYAGE_API_KEY:-}
37
+ - VOYAGE_KEY=${VOYAGE_KEY:-}
38
+ - PREFER_LOCAL_EMBEDDINGS=${PREFER_LOCAL_EMBEDDINGS:-false}
39
+ - EMBEDDING_MODEL=${EMBEDDING_MODEL:-voyage-3}
40
+ - BATCH_SIZE=${BATCH_SIZE:-50}
41
+ - CHUNK_SIZE=${CHUNK_SIZE:-10}
42
+ - PYTHONUNBUFFERED=1
43
+ restart: "no"
44
+ profiles: ["import"]
45
+ command: python /scripts/import-conversations-unified.py
46
+
47
+ # Continuous watcher service (optional)
48
+ watcher:
49
+ build:
50
+ context: .
51
+ dockerfile: Dockerfile.watcher
52
+ container_name: claude-reflection-watcher
53
+ depends_on:
54
+ - qdrant
55
+ volumes:
56
+ - ${CLAUDE_LOGS_PATH:-~/.claude/projects}:/logs:ro
57
+ - ./config:/config
58
+ - ./scripts:/scripts:ro
59
+ environment:
60
+ - QDRANT_URL=http://qdrant:6333
61
+ - STATE_FILE=/config/imported-files.json
62
+ - OPENAI_API_KEY=${OPENAI_API_KEY:-}
63
+ - VOYAGE_API_KEY=${VOYAGE_API_KEY:-}
64
+ - VOYAGE_KEY=${VOYAGE_KEY:-}
65
+ - PREFER_LOCAL_EMBEDDINGS=${PREFER_LOCAL_EMBEDDINGS:-false}
66
+ - EMBEDDING_MODEL=${EMBEDDING_MODEL:-voyage-3}
67
+ - WATCH_INTERVAL=${WATCH_INTERVAL:-60}
68
+ - PYTHONUNBUFFERED=1
69
+ restart: unless-stopped
70
+ profiles: ["watch"]
71
+ mem_limit: 2g
72
+ memswap_limit: 2g
73
+
74
+ # MCP server for Claude integration
75
+ mcp-server:
76
+ build:
77
+ context: .
78
+ dockerfile: Dockerfile.mcp-server
79
+ container_name: claude-reflection-mcp
80
+ depends_on:
81
+ - qdrant
82
+ environment:
83
+ - QDRANT_URL=http://qdrant:6333
84
+ - VOYAGE_KEY=${VOYAGE_KEY:-}
85
+ - PREFER_LOCAL_EMBEDDINGS=${PREFER_LOCAL_EMBEDDINGS:-true}
86
+ - ENABLE_MEMORY_DECAY=${ENABLE_MEMORY_DECAY:-true}
87
+ - DECAY_WEIGHT=${DECAY_WEIGHT:-0.3}
88
+ - DECAY_SCALE_DAYS=${DECAY_SCALE_DAYS:-90}
89
+ - PYTHONUNBUFFERED=1
90
+ restart: unless-stopped
91
+ stdin_open: true
92
+ tty: true
93
+ profiles: ["mcp"]
94
+
95
+ networks:
96
+ default:
97
+ name: claude-reflection-network
98
+ external: false