memory-pro
# Memory Pro (v2)
This skill provides semantic search over your memory files using a local vector database.
## Architecture (v2)
- **Service**: Runs as a `systemd` user service (`memory-pro.service`).
- **Port**: `8001` (hardcoded for stability).
- **Engine**: FAISS + Sentence-Transformers (`all-MiniLM-L6-v2`).
- **Data Source**:
- Daily logs: `${OPENCLAW_WORKSPACE}/memory/*.md`
- Core files: `MEMORY.md`, `SOUL.md`, `STATUS.md`, `AGENTS.md`, `USER.md` (from workspace root).
- **Index**: Stored in `${OPENCLAW_WORKSPACE}/skills/memory-pro/v2/memory.index`.
## Usage
### 1. Semantic Search (Recommended)
Use the python script to query the running service.
```bash
# Basic search
python3 scripts/search_semantic.py "What did I do yesterday?"
# JSON output
python3 scripts/search_semantic.py "project updates" --json
```
### 2. Manual Index Rebuild
The service automatically rebuilds the index on restart. To force an update:
```bash
systemctl --user restart memory-pro.service
```
*Note: Service restart takes ~15-20 seconds to rebuild index and load models. The client script has auto-retry logic.*
### 3. Service Management
```bash
# Check status
systemctl --user status memory-pro.service
# Stop service
systemctl --user stop memory-pro.service
# View logs
journalctl --user -u memory-pro.service -f
```
## Troubleshooting
### "Connection failed"
- The service might be stopped or restarting.
- Check status: `systemctl --user status memory-pro.service`.
- If restarting, wait 15 seconds. The client script retries automatically for up to 20s.
### "Index size mismatch"
- This means `memory.index` and `sentences.txt` are out of sync.
- **Fix**: Restart the service. The startup script `start.sh` automatically runs `build_index.py` to fix this consistency issue before starting the API.
### "Address already in use"
- Port 8001 is taken by a zombie process.
- **Fix**: `kill $(lsof -t -i:8001)` then restart service.
标签
skill
ai