Files
Claude-Code-Workflow/ccw/scripts/QUICK-REFERENCE.md
catlog22 1dfabf6bda fix: resolve CodexLens installation issues by correcting package name and improving local path detection
- Updated package name from `codexlens` to `codex-lens` in all relevant files to ensure consistency with `pyproject.toml`.
- Enhanced `findLocalPackagePath()` to always search for local paths, even when running from `node_modules`.
- Removed fallback logic for PyPI installation in several functions, providing clearer error messages for local installation failures.
- Added detailed documentation on installation steps and error handling for local development packages.
- Introduced a new summary document outlining the issues and fixes related to CodexLens installation.
2026-01-21 15:32:41 +08:00

2.3 KiB

Memory Embedder - Quick Reference

Installation

pip install numpy codex-lens[semantic]

Commands

Status

python scripts/memory_embedder.py status <db_path>

Embed All

python scripts/memory_embedder.py embed <db_path>

Embed Specific Source

python scripts/memory_embedder.py embed <db_path> --source-id CMEM-20250101-120000

Re-embed (Force)

python scripts/memory_embedder.py embed <db_path> --force
python scripts/memory_embedder.py search <db_path> "authentication flow"
python scripts/memory_embedder.py search <db_path> "rate limiting" \
  --top-k 5 \
  --min-score 0.5 \
  --type workflow

Database Path

Find your database:

# Linux/Mac
~/.ccw/projects/<project-id>/core-memory/core_memory.db

# Windows
%USERPROFILE%\.ccw\projects\<project-id>\core-memory\core_memory.db

TypeScript Integration

import { execSync } from 'child_process';

// Status
const status = JSON.parse(
  execSync(`python scripts/memory_embedder.py status "${dbPath}"`, {
    encoding: 'utf-8'
  })
);

// Embed
const result = JSON.parse(
  execSync(`python scripts/memory_embedder.py embed "${dbPath}"`, {
    encoding: 'utf-8'
  })
);

// Search
const matches = JSON.parse(
  execSync(
    `python scripts/memory_embedder.py search "${dbPath}" "query"`,
    { encoding: 'utf-8' }
  )
);

Output Examples

Status

{
  "total_chunks": 150,
  "embedded_chunks": 100,
  "pending_chunks": 50,
  "by_type": {
    "core_memory": {"total": 80, "embedded": 60, "pending": 20}
  }
}

Embed

{
  "success": true,
  "chunks_processed": 50,
  "chunks_failed": 0,
  "elapsed_time": 12.34
}

Search

{
  "success": true,
  "matches": [
    {
      "source_id": "WFS-20250101-auth",
      "source_type": "workflow",
      "chunk_index": 2,
      "content": "Implemented JWT authentication...",
      "score": 0.8542,
      "restore_command": "ccw session resume WFS-20250101-auth"
    }
  ]
}

Source Types

  • core_memory - Strategic architectural context
  • workflow - Session-based development history
  • cli_history - Command execution logs

Performance

  • Embedding: ~8 chunks/second
  • Search: ~0.1-0.5s for 1000 chunks
  • Model load: ~0.8s (cached)
  • Batch size: 8 (default, configurable)