mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
- Updated COMMAND_SPEC.md to reflect new version and features including native CodexLens and CLI refactor. - Revised GETTING_STARTED.md and GETTING_STARTED_CN.md for improved onboarding experience with new features. - Enhanced INSTALL_CN.md to highlight the new CodexLens and Dashboard capabilities. - Updated README.md and README_CN.md to showcase version 6.2.0 features and breaking changes. - Introduced memory embedder scripts with comprehensive documentation and quick reference. - Added test suite for memory embedder functionality to ensure reliability and correctness. - Implemented TypeScript integration examples for memory embedder usage.
2.3 KiB
2.3 KiB
Memory Embedder - Quick Reference
Installation
pip install numpy codexlens[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
Search
python scripts/memory_embedder.py search <db_path> "authentication flow"
Advanced Search
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 contextworkflow- Session-based development historycli_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)