Files
Claude-Code-Workflow/ccw/scripts/QUICK-REFERENCE.md
catlog22 4458af83d8 feat: Upgrade to version 6.2.0 with major enhancements
- 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.
2025-12-20 13:16:09 +08:00

136 lines
2.3 KiB
Markdown

# Memory Embedder - Quick Reference
## Installation
```bash
pip install numpy codexlens[semantic]
```
## Commands
### Status
```bash
python scripts/memory_embedder.py status <db_path>
```
### Embed All
```bash
python scripts/memory_embedder.py embed <db_path>
```
### Embed Specific Source
```bash
python scripts/memory_embedder.py embed <db_path> --source-id CMEM-20250101-120000
```
### Re-embed (Force)
```bash
python scripts/memory_embedder.py embed <db_path> --force
```
### Search
```bash
python scripts/memory_embedder.py search <db_path> "authentication flow"
```
### Advanced Search
```bash
python scripts/memory_embedder.py search <db_path> "rate limiting" \
--top-k 5 \
--min-score 0.5 \
--type workflow
```
## Database Path
Find your database:
```bash
# Linux/Mac
~/.ccw/projects/<project-id>/core-memory/core_memory.db
# Windows
%USERPROFILE%\.ccw\projects\<project-id>\core-memory\core_memory.db
```
## TypeScript Integration
```typescript
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
```json
{
"total_chunks": 150,
"embedded_chunks": 100,
"pending_chunks": 50,
"by_type": {
"core_memory": {"total": 80, "embedded": 60, "pending": 20}
}
}
```
### Embed
```json
{
"success": true,
"chunks_processed": 50,
"chunks_failed": 0,
"elapsed_time": 12.34
}
```
### Search
```json
{
"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)