mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-09 05:35:21 +09:00
Checkpoint: File edits
Automatic checkpoint created by Claude Code - Branch: main - Timestamp: 2026-01-17T21:06:17Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b42e8a1e44
commit
8a3d41ce5d
1 file changed
+30
-20
@@ -285,40 +285,50 @@ SELECT ruvector_version(), ruvector_simd_info();
|
||||
|
||||
To migrate from Claude-Flow's sql.js/JSON storage to RuVector PostgreSQL:
|
||||
|
||||
### 1. Export current memory
|
||||
### Option 1: Use CLI Import Tool (Recommended)
|
||||
|
||||
```bash
|
||||
# Export memory entries to JSON
|
||||
npx claude-flow@alpha memory list --format json > memory-export.json
|
||||
```
|
||||
# Export current memory to JSON
|
||||
npx claude-flow memory list --format json > memory-export.json
|
||||
|
||||
### 2. Generate SQL import
|
||||
# Import directly to PostgreSQL
|
||||
npx claude-flow ruvector import --input memory-export.json
|
||||
|
||||
```bash
|
||||
# Create SQL from JSON (manual process currently)
|
||||
# For each entry, create an INSERT statement
|
||||
cat memory-export.json | jq -r '.[] | "INSERT INTO claude_flow.embeddings (content, metadata) VALUES (\047\(.value | tostring)\047, \047\(.metadata | tojson)\047::jsonb);"'
|
||||
```
|
||||
|
||||
### 3. Import to PostgreSQL
|
||||
|
||||
```bash
|
||||
# Or generate SQL file first (dry-run)
|
||||
npx claude-flow ruvector import --input memory-export.json --output import.sql
|
||||
docker exec -i ruvector-postgres psql -U claude -d claude_flow < import.sql
|
||||
```
|
||||
|
||||
### 4. Generate embeddings
|
||||
The import tool:
|
||||
- Supports JSON arrays or objects
|
||||
- Handles namespaces and metadata
|
||||
- Uses upsert (ON CONFLICT) for safe re-imports
|
||||
- Shows import statistics
|
||||
|
||||
Embeddings need to be generated externally (via Claude-Flow MCP) and updated:
|
||||
### Option 2: Manual Migration
|
||||
|
||||
```bash
|
||||
# Export memory entries to JSON
|
||||
npx claude-flow memory list --format json > memory-export.json
|
||||
|
||||
# Create SQL from JSON using jq
|
||||
cat memory-export.json | jq -r '.[] | "INSERT INTO claude_flow.memory_entries (key, value, namespace, metadata) VALUES (\047\(.key)\047, \047\(.value | tostring)\047, \047\(.namespace // "default")\047, \047\(.metadata // {} | tojson)\047::jsonb);"' > import.sql
|
||||
|
||||
# Import to PostgreSQL
|
||||
docker exec -i ruvector-postgres psql -U claude -d claude_flow < import.sql
|
||||
```
|
||||
|
||||
### Generate Embeddings
|
||||
|
||||
Embeddings can be generated via Claude-Flow MCP and updated:
|
||||
|
||||
```sql
|
||||
-- After generating embedding via MCP
|
||||
UPDATE claude_flow.embeddings
|
||||
UPDATE claude_flow.memory_entries
|
||||
SET embedding = '[...]'::ruvector(384)
|
||||
WHERE id = 'uuid-here';
|
||||
WHERE key = 'my-key' AND namespace = 'my-namespace';
|
||||
```
|
||||
|
||||
> **Note**: A dedicated migration tool (`npx claude-flow@alpha ruvector import`) is planned for future releases.
|
||||
|
||||
## pgAdmin (Optional)
|
||||
|
||||
For visual database management:
|
||||
|
||||
Reference in new issue
Block a user