claude-self-reflect 2.4.0 → 2.4.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/.claude/agents/README.md +20 -3
- package/.claude/agents/open-source-maintainer.md +287 -11
- package/.claude/agents/reflect-tester.md +278 -0
- package/.env.example +29 -0
- package/Dockerfile.importer +13 -0
- package/Dockerfile.importer-isolated +20 -0
- package/Dockerfile.mcp-server +17 -0
- package/Dockerfile.streaming-importer +30 -0
- package/Dockerfile.watcher +53 -0
- package/README.md +15 -2
- package/docker-compose.yaml +98 -0
- package/installer/setup-wizard-docker.js +433 -0
- package/installer/setup-wizard.js +4 -1484
- package/mcp-server/run-mcp-docker.sh +5 -0
- package/mcp-server/src/__main__.py +2 -1
- package/mcp-server/src/server.py +66 -7
- package/mcp-server/src/server_v2.py +11 -7
- package/package.json +5 -1
- package/scripts/import-conversations-unified.py +16 -1
|
@@ -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)
|
|
@@ -131,15 +140,19 @@ Built by developers tired of re-explaining context every conversation.
|
|
|
131
140
|
## Requirements
|
|
132
141
|
|
|
133
142
|
- Claude Code or Claude Desktop
|
|
134
|
-
-
|
|
143
|
+
- Docker Desktop (macOS/Windows) or Docker Engine (Linux)
|
|
144
|
+
- Node.js 16+ (for the setup wizard only)
|
|
135
145
|
- 5 minutes for setup
|
|
136
146
|
|
|
137
147
|
## Upgrading from Earlier Versions
|
|
138
148
|
|
|
139
|
-
**v2.
|
|
149
|
+
**v2.4.0+ includes major improvements:**
|
|
150
|
+
- **Docker-Only Setup**: No more Python environment issues!
|
|
140
151
|
- **Privacy First**: Local embeddings by default - your data never leaves your machine
|
|
141
152
|
- **Smarter Setup**: Handles existing installations gracefully
|
|
142
153
|
- **Better Security**: Automated vulnerability scanning
|
|
154
|
+
- **Real-Time Import**: Watcher checks for new conversations every 60 seconds
|
|
155
|
+
- **Fixed MCP Server**: Now uses correct server implementation with local embedding support
|
|
143
156
|
|
|
144
157
|
**To upgrade:**
|
|
145
158
|
```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
|